Instance Method


Returns a dictionary representation of the depth data suitable for writing into an image file.


func dictionaryRepresentation(forAuxiliaryDataType outAuxDataType: AutoreleasingUnsafeMutablePointer<NSString?>?) -> [AnyHashable : Any]?



On output, either kCGImageAuxiliaryDataTypeDisparity or kCGImageAuxiliaryDataTypeDepth, depending on the depth data's type.


When using CGImageDestination functions to write depth data (along with image data) to a HEIF, JPEG, or DNG file, you can use this method to obtain a dictionary of primitive depth map information, then use the CGImageDestinationAddAuxiliaryDataInfo(_:_:_:) function to embed that data into the output file.

See Also

Creating Depth Data

Creating Auxiliary Depth Data Manually

Generate a depth image and attach it to your own image.

init(fromDictionaryRepresentation: [AnyHashable : Any])

Creates a depth data object from depth information such as that found in an image file.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software