layerRectConverted(fromMetadataOutputRect:)
Converts a rectangle from metadata output coordinates to the coordinate space of the layer.
Declaration
func layerRectConverted(fromMetadataOutputRect rectInMetadataOutputCoordinates: CGRect) -> CGRectParameters
- rectInMetadataOutputCoordinates:
A rectangle in the Avcapturemetadataoutput coordinate system.
Return Value
A rectangle in the preview layer’s coordinate system.
Discussion
A metadata capture output’s rectOfInterest a CGRect value where {0,0} represents the top-left of the picture area, and {1,1} represents the bottom-right on an unrotated image.
The system takes the layer’s frame size and its videoGravity into consideration when making the conversion.