Instance Method

metadataOutputRectConverted(fromOutputRect:)

Converts a rectangle in the capture output object’s coordinate system to one in the coordinate system used for metadata outputs.

Declaration

func metadataOutputRectConverted(fromOutputRect rectInOutputCoordinates: CGRect) -> CGRect

Parameters

rectInOutputCoordinates

A rectangle in the AVCaptureOutput object’s coordinate system.

Return Value

A rectangle in the AVCaptureMetadataOutput coordinate system.

Discussion

The rectangle of interest for an AVCaptureMetadataOutput object is in a coordinate system extending from (0,0) in the top left to (1,1) in the bottom right, relative to the device’s natural orientation. A capture output object uses a pixel coordinate space which may be zoomed, rotated, or mirrored. Use this convenience method to quickly convert between coordinate spaces.

See Also

Converting Between Coordinate Systems

func outputRectConverted(fromMetadataOutputRect: CGRect) -> CGRect

Converts a rectangle in the coordinate system used for metadata outputs to one in the capture output object’s coordinate system.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software