Nuke Documentation

Structure Image​Processors.​Resize

public struct Resize: ImageProcessing, Hashable, CustomStringConvertible  

Scales an image to a specified size.

ImageProcessors.Resize ImageProcessors.Resize CustomStringConvertible CustomStringConvertible ImageProcessors.Resize->CustomStringConvertible ImageProcessing ImageProcessing ImageProcessors.Resize->ImageProcessing Hashable Hashable ImageProcessors.Resize->Hashable

Member Of

ImageProcessors

A namespace for all processors that implement ImageProcessing protocol.

Nested Types

ImageProcessors.Resize.ContentMode

An option for how to resize the image.

Conforms To

ImageProcessing

Performs image processing.

CustomStringConvertible
Hashable

Initializers

init(size:​unit:​content​Mode:​crop:​upscale:​)

public init(size: CGSize, unit: ImageProcessingOptions.Unit = .points, contentMode: ContentMode = .aspectFill, crop: Bool = false, upscale: Bool = false)  

Initializes the processor with the given size.

Parameters

size CGSize

The target size.

unit Image​Processing​Options.​Unit

Unit of the target size, .points by default.

content​Mode Content​Mode

.aspectFill by default.

crop Bool

If true will crop the image to match the target size. Does nothing with content mode .aspectFill. false by default.

upscale Bool

false by default.

init(width:​unit:​upscale:​)

public init(width: CGFloat, unit: ImageProcessingOptions.Unit = .points, upscale: Bool = false)  

Resizes the image to the given width preserving aspect ratio.

Parameters

unit Image​Processing​Options.​Unit

Unit of the target size, .points by default.

init(height:​unit:​upscale:​)

public init(height: CGFloat, unit: ImageProcessingOptions.Unit = .points, upscale: Bool = false)  

Resizes the image to the given height preserving aspect ratio.

Parameters

unit Image​Processing​Options.​Unit

Unit of the target size, .points by default.

Properties

identifier

public var identifier: String  

hashable​Identifier

public var hashableIdentifier: AnyHashable  

description

public var description: String  

Methods

process(_:​)

public func process(_ image: PlatformImage) -> PlatformImage?