Skip to main content
←API Reference ←NSDK ←ImageMath

affineCrop

Returns an affine transformation that crops the source size to match the aspect ratio of the target size.

Declaration​

static func affineCrop(source: CGSize, target: CGSize) -> CGAffineTransform

Summary​

Returns an affine transformation that crops the source size to match the aspect ratio of the target size.

Returns​

An affine transformation matrix that crops the source to fit the target aspect ratio.

Parameters​

NameTypeSummary
sourceCGSize
The size of the source container.
targetCGSize
The size of the target container.