TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2016 |
SPMSupports SPM | ✗ |
Maintained by muukii0803, muukii, muukii.
Easy Chaining ImageFilter with CoreImage
First, create FilterComponent
s. Then create a FilterChain
using them.
image1 >>> colorControl --* addition
blendImage >>> addition --* overlay
image2 >>> colorControl2 >>> overlay
You can connect FilterChain
s with each other using >>>
let colorControl = LightRoom.ColorAdjustment.ExposureAdjust(ev: 1)
let chain1 = FilterChain { (image: CIImage?) -> CIImage? in
image >>> colorControl
return colorControl.outputImage
}
let colorControl2 = LightRoom.ColorAdjustment.ColorControls(saturation: 0.3, brightness: 0, contrast: 1)
let chain2 = FilterChain { (image: CIImage?) -> CIImage? in
image >>> colorControl2
return colorControl2.outputImage
}
image1 >>> chain1 >>> chain2
chain2.outputImage
FilterComponent has a CIFilter, which is cached and will be created only once.
This structure is advantageous in performance, and is great for real-time filtering camera implementation.