BlendImageProcessor
public struct BlendImageProcessor: ImageProcessor
Processor for adding an blend mode to images. Only CG-based images are supported.
-
Identifier of the processor.
Note
See documentation ofImageProcessor
protocol for more.Declaration
Swift
public let identifier: String
-
Blend Mode will be used to blend the input image.
Declaration
Swift
public let blendMode: CGBlendMode
-
Alpha will be used when blend image.
Declaration
Swift
public let alpha: CGFloat
-
Background color of the output image. If
nil
, it will stay transparent.Declaration
Swift
public let backgroundColor: Color?
-
Initialize an
BlendImageProcessor
Declaration
Swift
public init(blendMode: CGBlendMode, alpha: CGFloat = 1.0, backgroundColor: Color? = nil)
Parameters
blendMode
Blend Mode will be used to blend the input image.
alpha
Alpha will be used when blend image. From 0.0 to 1.0. 1.0 means solid image, 0.0 means transparent image. Default is 1.0.
backgroundColor
Backgroud color to apply for the output image. Default is
nil
. -
Process an input
ImageProcessItem
item to an image for this processor.Note
See documentation of
ImageProcessor
protocol for more.Declaration
Swift
public func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?
Parameters
item
Input item which will be processed by
self
options
Options when processing the item.
Return Value
The processed image.