Kingfisher Documentation

Structure Downsampling​Image​Processor

public struct DownsamplingImageProcessor: ImageProcessor  

Processor for downsampling an image. Compared to ResizingImageProcessor, this processor does not render the images to resize. Instead, it downsamples the input data directly to an image. It is a more efficient than ResizingImageProcessor. Prefer to use DownsamplingImageProcessor as possible as you can than the ResizingImageProcessor.

Only CG-based images are supported. Animated images (like GIF) is not supported.

%157 DownsamplingImageProcessor DownsamplingImageProcessor ImageProcessor ImageProcessor DownsamplingImageProcessor->ImageProcessor

Conforms To

ImageProcessor

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

Initializers

init(size:​)

public init(size: CGSize)  

Creates a DownsamplingImageProcessor.

Parameters

size CGSize

The target size of the downsample operation.

Properties

size

public let size: CGSize

Target size of output image should be. It should be smaller than the size of input image. If it is larger, the result image will be the same size of input data without downsampling.

identifier

public let identifier: String

Identifier of the processor.

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.