Instance Method

fileDataRepresentation

Generates and returns a flat data representation of the photo and its attachments.

Declaration

- (NSData *)fileDataRepresentation;

Return Value

Data appropriate for writing to a file of the type specified when requesting photo capture, or nil if the photo and attachment data cannot be flattened.

Discussion

When you request a photo capture with the AVCapturePhotoOutput capturePhotoWithSettings:delegate: method, the AVCapturePhotoSettings object you provide specifies image data formats (such as JPEG and HEVC) and container file formats (such as JFIF and HEIF) for the resulting image file. Calling this method formats and packages the image pixel buffer, along with metadata and other attachments created during capture (such as preview photos and depth maps), into data appropriate for writing to a file of that type.

See Also

Packaging Data for File Output

AVCapturePhotoFileDataRepresentationCustomizer

A set of delegate callbacks to be implemented by callers of fileDataRepresentationWithCustomizer:.

- CGImageRepresentation

Extracts and returns the captured photo's primary image as a Core Graphics image object.

- previewCGImageRepresentation

Extracts and returns the captured photo's preview image as a CoreGraphics image object.

- fileDataRepresentationWithReplacementMetadata:replacementEmbeddedThumbnailPhotoFormat:replacementEmbeddedThumbnailPixelBuffer:replacementDepthData:

Generates and returns a flat data representation of the photo, using the specified replacements for some or all of its attachments.

Deprecated

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