Skip to main content
←API Reference ←NSDK ←ImageMath

affineFit

Returns an affine transformation that maps normalized coordinates in the source frame to normalized coordinates in the target frame.

Declaration​

static func affineFit(source: CGSize, sourceOrientation: UIInterfaceOrientation, target: CGSize, targetOrientation: UIInterfaceOrientation) -> CGAffineTransform

Summary​

Returns an affine transformation that maps normalized coordinates in the source frame to normalized coordinates in the target frame.

Returns​

An affine transformation matrix that fits the source into the target.

Notice

Note: In portrait, this function aligns the top and bottom edges to the target.

Parameters​

NameTypeSummary
sourceCGSize
The size of the source container.
sourceOrientationUIInterfaceOrientation
The orientation of the source container.
targetCGSize
The size of the target container.
targetOrientationUIInterfaceOrientation
The orientation of the target container.