Type Method

photoSettingsWithFormat:

Creates a photo settings object with the specified output format.

Declaration

+ (instancetype)photoSettingsWithFormat:(NSDictionary<NSString *,id> *)format;

Parameters

format

A dictionary of Core Video pixel buffer attributes or AVFoundation video settings constants (see Video Settings).

To capture a photo in an uncompressed format, such as 420f, 420v, or BGRA, set the key kCVPixelBufferPixelFormatTypeKey in the format dictionary. The corresponding value must be one of the pixel format identifiers listed in the availablePhotoPixelFormatTypes array of your photo capture output.

To capture a photo in a compressed format, such as JPEG, set the key AVVideoCodecKey in the format dictionary. The corresponding value must be one of the codec identifiers listed in the availablePhotoCodecTypes array of your photo capture output. For a compressed format, you can also specify a compression level with the key AVVideoQualityKey.

Return Value

A new photo settings object.

Discussion

Requesting capture in a processed format adds requirements for other photo settings: for details, see the format property. The capture output validates these requirements when you call the capturePhotoWithSettings:delegate: method. If your settings and delegate do not meet these requirements, that method raises an exception.

See Also

Creating Photo Settings

+ photoSettings

Creates a photo settings object with default settings.

+ photoSettingsWithRawPixelFormatType:

Creates a photo settings object for RAW-format-only capture with the specified pixel format.

+ photoSettingsWithRawPixelFormatType:processedFormat:

Creates a photo settings object for capture in both RAW format and a processed format.

+ photoSettingsWithRawPixelFormatType:rawFileType:processedFormat:processedFileType:

Creates a photo settings object for capture in both RAW format and a processed format with the specified output file types.

format

A dictionary describing the processed format (for example, JPEG) to deliver captured photos in.

processedFileType

The container file format for eventual output of the processed image.

rawFileType

The container file format for eventual output of the RAW image.

rawPhotoPixelFormatType

An identifier for the Bayer RAW pixel format to deliver captured RAW photos in.

AVFileType

A uniform type identifier for various file formats.

Video Settings Dictionaries

Define output image and video formats by using the key and value constants.

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