metadataOutputRectConverted(fromLayerRect:)
Converts a rectangle from layer coordinates to the coordinate space of the metadata output.
Declaration
func metadataOutputRectConverted(fromLayerRect rectInLayerCoordinates: CGRect) -> CGRectParameters
- rectInLayerCoordinates:
A rectangle in the Avcapturevideopreviewlayer object’s coordinate system.
Return Value
A rectangle in the metadata output’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.