---
title: "replacingDepthDataMap(with:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avdepthdata/replacingdepthdatamap(with:)"
---

# replacingDepthDataMap(with:)

Returns a derivative depth data object by replacing the depth data map.

## Declaration

```swift
func replacingDepthDataMap(with pixelBuffer: CVPixelBuffer) throws -> Self
```

## Parameters

- `pixelBuffer`: A pixel buffer containing depth or disparity information in a compatible format.

## Return Value

Return Value A new depth data object containing the pixel buffer.

## Discussion

Discussion If you apply simple transforms to media containing depth data, you can use the applyingExifOrientation(_:) method to apply parallel transforms to the corresponding depth data. More complex transforms and edits require creating a derivative depth map reflecting whatever edits you make to the corresponding image. In such cases, use this replacingDepthDataMap(with:) method to create a derivative depth data object. note: This method cannot ensure correspondence between an arbitrarily edited depth map and the camera parameters that generated the initial depth map, so the new depth data object’s cameraCalibrationData property is always nil.

## See Also

### Transforming and processing

- [applyingExifOrientation(_:)](avfoundation/avdepthdata/applyingexiforientation(_:).md)
- [converting(toDepthDataType:)](avfoundation/avdepthdata/converting(todepthdatatype:).md)
- [availableDepthDataTypes](avfoundation/avdepthdata/availabledepthdatatypes-3ifx1.md)
