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.