---
title: "metadataOutputRectConverted(fromLayerRect:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturevideopreviewlayer/metadataoutputrectconverted(fromlayerrect:)"
---

# metadataOutputRectConverted(fromLayerRect:)

Converts a rectangle from layer coordinates to the coordinate space of the metadata output.

## Declaration

```swift
func metadataOutputRectConverted(fromLayerRect rectInLayerCoordinates: CGRect) -> CGRect
```

## Parameters

- `rectInLayerCoordinates`: A rectangle in the doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureVideoPreviewLayer object’s coordinate system.

## Return Value

Return Value A rectangle in the metadata output’s coordinate system.

## Discussion

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.

## See Also

### Converting between coordinate spaces

- [layerPointConverted(fromCaptureDevicePoint:)](avfoundation/avcapturevideopreviewlayer/layerpointconverted(fromcapturedevicepoint:).md)
- [captureDevicePointConverted(fromLayerPoint:)](avfoundation/avcapturevideopreviewlayer/capturedevicepointconverted(fromlayerpoint:).md)
- [layerRectConverted(fromMetadataOutputRect:)](avfoundation/avcapturevideopreviewlayer/layerrectconverted(frommetadataoutputrect:).md)
- [transformedMetadataObject(for:)](avfoundation/avcapturevideopreviewlayer/transformedmetadataobject(for:).md)
