Kingfisher Documentation

Structure Compositing​Image​Processor

public struct CompositingImageProcessor: ImageProcessor  

Processor for adding an compositing operation to images. Only CG-based images are supported in macOS.

%105 CompositingImageProcessor CompositingImageProcessor ImageProcessor ImageProcessor CompositingImageProcessor->ImageProcessor

Conforms To

ImageProcessor

An ImageProcessor would be used to convert some downloaded data to an image.

Initializers

init(compositing​Operation:​alpha:​background​Color:​)

public init(compositingOperation: NSCompositingOperation,
                alpha: CGFloat = 1.0,
                backgroundColor: KFCrossPlatformColor? = nil) 

Creates a CompositingImageProcessor

Parameters

compositing​Operation NSCompositing​Operation

Compositing operation will be used to the input image.

alpha CGFloat

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.

background​Color KFCross​Platform​Color?

Background color to apply for the output image. Default is nil.

Properties

identifier

public let identifier: String

Identifier of the processor.

compositing​Operation

public let compositingOperation: NSCompositingOperation

Compositing operation will be used to the input image.

alpha

public let alpha: CGFloat

Alpha will be used when compositing image.

background​Color

public let backgroundColor: KFCrossPlatformColor? 

Background color of the output image. If nil, it will stay transparent.

Methods

process(item:​options:​)

public func process(item: ImageProcessItem, options: KingfisherParsedOptionsInfo) -> KFCrossPlatformImage?  

Processes the input ImageProcessItem with this processor.

Parameters

item Image​Process​Item

Input item which will be processed by self.

options Kingfisher​Parsed​Options​Info

Options when processing the item.

Returns

The processed image.