ImageProcessor
public protocol ImageProcessor
An ImageProcessor would be used to convert some downloaded data to an image.
-
Identifier of the processor. It will be used to identify the processor when caching and retrieving an image. You might want to make sure that processors with same properties/functionality have the same identifiers, so correct processed images could be retrived with proper key.
Note
Do not supply an empty string for a customized processor, which is already taken by theDefaultImageProcessor. It is recommended to use a reverse domain name notation string of your own for the identifier.Declaration
Swift
var identifier: String -
Process an input
ImageProcessItemitem to an image for this processor.Note
The return value will be
nilif processing failed while converting data to image. If input item is already an image and there is any errors in processing, the input image itself will be returned.Note
Most processor only supports CG-based images. watchOS is not supported for processers containing filter, the input image will be returned directly on watchOS.
Declaration
Swift
func process(item: ImageProcessItem, options: KingfisherOptionsInfo) -> Image?Parameters
itemInput item which will be processed by
selfoptionsOptions when processing the item.
Return Value
The processed image.
-
append(another:)Extension methodAppend an
ImageProcessorto another. The identifier of the newImageProcessorwill be\(self.identifier)|>\(another.identifier)
.Declaration
Swift
public func append(another: ImageProcessor) -> ImageProcessorParameters
anotherAn
ImageProcessoryou want to append toself.Return Value
The new
ImageProcessorwill process the image in the order of the two processors concatenated.
View on GitHub
Install in Dash
ImageProcessor Protocol Reference