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?
-
Creates a
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 (not visible at all). Default is 1.0.
backgroundColor
Background color to apply for the output image. Default is
nil
. -
Processes the input
ImageProcessItem
with this processor.Note
See documentation of
ImageProcessor
protocol for more.Declaration
Swift
public func process(item: ImageProcessItem, options: KingfisherParsedOptionsInfo) -> Image?
Parameters
item
Input item which will be processed by
self
.options
Options when processing the item.
Return Value
The processed image.