orientationTransform(forExifOrientation:)
Returns the transformation needed to reorient the image to the specified orientation.
Declaration
func orientationTransform(forExifOrientation orientation: Int32) -> CGAffineTransformParameters
- orientation:
An integer specifying an image orientation according to the EXIF specification. For details, see Kcgimagepropertyorientation.
Return Value
An affine transform that will rotate or mirror the image to match the specified orientation when applied.
Discussion
This method determines the transformation needed to match the specified orientation, but does not apply that transformation to the image. To apply the transformation (possibly after concatenating it with other transformations), use the transformed(by:) method or the CIAffineTransform filter. To determine and apply the transformation in a single step, use the oriented(forExifOrientation:) method.