Comments (5)
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.
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.
@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.
Okay sounds great. Just let me know if you need anything from me!
from alamofireimage.
Completed in #14.
from alamofireimage.
Related Issues (20)
- SwiftUI Extensions HOT 4
- IPHONEOS_DEPLOYMENT_TARGET is set to 8.0 but Xcode 12 does't support it anymore HOT 1
- Crash on af.setImage HOT 3
- unable to generate request in macOS Big Sur HOT 1
- CGDataProviderCopyData crash in production HOT 1
- Useless concurrent attribute for synchronizationQueue in AutoPurgingImageCache HOT 1
- Cannot find type 'ImageDownloader' in scope HOT 1
- how can I achieve an AutoPurgingImageCache with unlimited size? HOT 1
- Fix Package.swift and release 3.5.3 for older version use via SPM HOT 1
- Always downloading images in 2000, 1000 as max size HOT 5
- Can't resolve dependencies starting on version 4.0.0 HOT 1
- unpredictable crash HOT 1
- Response Content-Type "text/plain" does not match any acceptable types HOT 1
- I
- Image is not cashing if we download image using ImageDownloader and restart the application HOT 2
- How do you cancel all pending and current image download requests in AlamofireImage? (Possible Feature Request) HOT 1
- Feature request: Support `image/avif` to Accept header for iOS 16, macOS Ventura and more. HOT 5
- App crash on ios 11.0.2, xcode 14.0.1 HOT 1
- Does AlamofireImage support resizing animated GIF? HOT 1
- Incorrect associatedObject use generates many Xcode 15 warnings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alamofireimage.