Instance Method


Returns an affine transform for converting between normalized image coordinates and a coordinate space appropriate for rendering the camera image onscreen.


func displayTransform(for orientation: UIInterfaceOrientation, viewportSize: CGSize) -> CGAffineTransform



The orientation intended for presenting the view.


The size, in points, of the view intended for rendering the camera image.

Return Value

A transform matrix that converts from normalized image coordinates in the captured image to normalized image coordinates that account for the specified parameters.


Normalized image coordinates range from (0,0) in the upper left corner of the image to (1,1) in the lower right corner.

This method creates an affine transform representing the rotation and aspect-fit crop operations necessary to adapt the camera image to the specified orientation and to the aspect ratio of the specified viewport. The affine transform does not scale to the viewport's pixel size.

The capturedImage pixel buffer is the original image captured by the device camera, and thus not adjusted for device orientation or view aspect ratio.

See Also

Examining Scene Parameters

var camera: ARCamera

Information about the camera position, orientation, and imaging parameters used to capture the frame.

var lightEstimate: ARLightEstimate?

An estimate of lighting conditions based on the camera image.