CompositingImageProcessor
public struct CompositingImageProcessor : ImageProcessor
Processor for adding an compositing operation to images. Only CG-based images are supported in macOS.
-
Identifier of the processor.
Note
See documentation ofImageProcessor
protocol for more.Declaration
Swift
public let identifier: String
-
Compositing operation will be used to the input image.
Declaration
Swift
public let compositingOperation: NSCompositingOperation
-
Alpha will be used when compositing image.
Declaration
Swift
public let alpha: CGFloat
-
Background color of the output image. If
nil
, it will stay transparent.Declaration
Swift
public let backgroundColor: KFCrossPlatformColor?
-
Creates a
CompositingImageProcessor
Declaration
Swift
public init(compositingOperation: NSCompositingOperation, alpha: CGFloat = 1.0, backgroundColor: KFCrossPlatformColor? = nil)
Parameters
compositingOperation
Compositing operation will be used to the input image.
alpha
Alpha will be used when compositing image. From 0.0 to 1.0. 1.0 means solid image, 0.0 means transparent image. 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) -> KFCrossPlatformImage?
Parameters
item
Input item which will be processed by
self
.options
Options when processing the item.
Return Value
The processed image.