Kingfisher Documentation

Structure Cropping​Image​Processor

public struct CroppingImageProcessor: ImageProcessor  

Processor for cropping an image. Only CG-based images are supported. watchOS is not supported.

%223 CroppingImageProcessor CroppingImageProcessor ImageProcessor ImageProcessor CroppingImageProcessor->ImageProcessor

Conforms To

ImageProcessor

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

Initializers

init(size:​anchor:​)

public init(size: CGSize, anchor: CGPoint = CGPoint(x: 0.5, y: 0.5))  

Creates a CroppingImageProcessor.

Parameters

size CGSize

Target size of output image should be.

anchor CGPoint

The anchor point from which the size should be calculated. Default is CGPoint(x: 0.5, y: 0.5), which means the center of input image.

Properties

identifier

public let identifier: String

Identifier of the processor.

size

public let size: CGSize

Target size of output image should be.

anchor

public let anchor: CGPoint

Anchor point from which the output size should be calculate. The anchor point is consisted by two values between 0.0 and 1.0. It indicates a related point in current image. See CroppingImageProcessor.init(size:anchor:) for more.

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.