Instance Method

setExposureModeCustom(duration:iso:completionHandler:)

Locks the exposure duration and ISO at the specified values.

Declaration

func setExposureModeCustom(duration: CMTime, iso ISO: Float, completionHandler handler: ((CMTime) -> Void)? = nil)

Parameters

duration

The exposure duration.

A value of currentExposureDuration can be used to indicate that the caller does not wish to specify a value for exposureDuration. Note that changes to this property may result in changes to activeVideoMinFrameDuration or activeVideoMaxFrameDuration.

ISO

The exposure ISO value.

A value of currentISO can be used to indicate that the caller does not wish to specify a value for ISO.

handler

A block to be called when both exposureDuration and ISO have been set to the values specified and exposureMode is AVCaptureDevice.ExposureMode.custom.

The block receives a timestamp matching that of the first buffer to which all settings have been applied. The timestamp is synchronized to the device clock, and thus must be converted to the master clock before comparison with the timestamps of buffers delivered via an AVCaptureVideoDataOutput instance.

Pass nil for the handler parameter if knowledge of the operation's completion is not required.

Discussion

This method is the only way to set exposureDuration and iso.

This method throws an invalidArgumentException exception if either exposureDuration or ISO is set to an unsupported level. A genericException exception is thrown if this method is invoked without first obtaining exclusive access to the receiver using lockForConfiguration().

See Also

Managing Image Exposure

var exposureDuration: CMTime

The length of time over which exposure takes place.

var exposureTargetOffset: Float

The metered exposure level's offset from the target exposure value, in EV units.

var exposureTargetBias: Float

Bias applied to the target exposure value, in EV units.

var minExposureTargetBias: Float

The minimum supported exposure bias, in EV units.

var maxExposureTargetBias: Float

The maximum supported exposure bias, in EV units.

var activeMaxExposureDuration: CMTime

The maximum exposure duration, in seconds, defined in the auto-exposure algorithm.

func setExposureTargetBias(Float, completionHandler: ((CMTime) -> Void)?)

Sets the bias to be applied to the target exposure value.

class let currentExposureTargetBias: Float

A special constant representing the current exposure bias value.

class let currentExposureDuration: CMTime

A special constant representing the current exposure duration setting.

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