---
title: "metadataOutputRectConverted(fromOutputRect:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcaptureoutput/metadataoutputrectconverted(fromoutputrect:)"
---

# metadataOutputRectConverted(fromOutputRect:)

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

## Declaration

```swift
func metadataOutputRectConverted(fromOutputRect rectInOutputCoordinates: CGRect) -> CGRect
```

## Parameters

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

## Return Value

Return Value A rectangle in the AVCaptureMetadataOutput coordinate system.

## Discussion

Discussion An AVCaptureMetadataOutput object expresses its rectOfInterest as a CGRect where 0,0 represents the top-left of the picture area, and 1,1 represents the bottom-right on an unrotated picture. This convenience method converts a rectangle in the coordinate space of the output to a rectangle of interest in the coordinate space of a metadata output whose capture device provides input to the output. The conversion takes orientation, mirroring, and scaling into consideration. See transformedMetadataObject(for:connection:) for a full discussion of how the system applies orientation and mirroring to sample buffers passing through the output.

## See Also

### Converting between coordinate systems

- [transformedMetadataObject(for:connection:)](avfoundation/avcaptureoutput/transformedmetadataobject(for:connection:).md)
- [outputRectConverted(fromMetadataOutputRect:)](avfoundation/avcaptureoutput/outputrectconverted(frommetadataoutputrect:).md)
