Giter Club home page Giter Club logo

Comments (5)

damienrambout avatar damienrambout commented on July 18, 2024

We can even think of a custom operator to create composite image filters:

let filter = SizeToFillFilter(size: size) => CircleFilter() => MyCustomFilter()

which is clearer and shorted than:

let filter = CompositeImageFilter(filters: SizeToFillFilter(size: size), CircleFilter(), MyCustomFilter())

from alamofireimage.

cnoon avatar cnoon commented on July 18, 2024

I think something like DynamicImageFilter or CustomImageFilter that takes an identifier and trailing filter closure in the initializer could definitely be useful. If you want to take a stab at this along with some tests, that would be awesome!

As for a similar type of CompositeImageFilter, I think it would be good to have one that has an initializer that takes an array of filters. I think a variadic initializer is fine as well. How about both? Also, how about a name like DynamicCompositeImageFilter?

Now as for adding operator overloads, I'm hesitant. If you'd like to put that together in the PR, then I'll gladly take a look. No promises though on actually merging that. Just thinking through it off the top of my head it would have to merge two ImageFilter comforming objects into a CompositeImageFilter, then append additional filters into the composite. It would certainly be more clear and only slightly more verbose to use a variadic initializer on the DynamicCompositeImageFilter. My two cents...

from alamofireimage.

damienrambout avatar damienrambout commented on July 18, 2024

@cnoon ok, let's first start with DynamicImageFilter and DynamicCompositeImageFilter. I think we'll have to use them before deciding wether custom operators are useful for creating composite filters.
I'll try to PR in the next few days.

from alamofireimage.

cnoon avatar cnoon commented on July 18, 2024

Okay sounds great. Just let me know if you need anything from me!

from alamofireimage.

cnoon avatar cnoon commented on July 18, 2024

Completed in #14.

from alamofireimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.