Instance Method

deviceWhiteBalanceGains(for:)

Converts device-independent temperature and tint values to device-specific white balance RGB gain values.

Declaration

func deviceWhiteBalanceGains(for tempAndTintValues: AVCaptureDevice.WhiteBalanceTemperatureAndTintValues) -> AVCaptureDevice.WhiteBalanceGains

Parameters

tempAndTintValues

An AVCaptureDevice.WhiteBalanceTemperatureAndTintValues structure containing the temperature and tint values.

Return Value

A fully populated AVCaptureDevice.WhiteBalanceGains structure containing device-specific RGB gain values.

Discussion

This method is invoked to convert device-independent temperature and tint values to device-specific RGB white balance gain values.

You may pass any temperature and tint values and corresponding white balance gains will be produced. Note, though, that some temperature and tint combinations yield out-of-range device RGB values that will cause an exception to be thrown if passed directly to setWhiteBalanceModeLocked(with:completionHandler:). Be sure to verify that the red, green, and blue gain values are within the range of [1.0 - maxWhiteBalanceGain].

See Also

Managing the White Balance

func isWhiteBalanceModeSupported(AVCaptureDevice.WhiteBalanceMode) -> Bool

Returns a Boolean value that indicates whether the given white balance mode is supported.

var isAdjustingWhiteBalance: Bool

Indicates whether the devise is currently adjusting the white balance.

func chromaticityValues(for: AVCaptureDevice.WhiteBalanceGains) -> AVCaptureDevice.WhiteBalanceChromaticityValues

Converts device-specific white balance RGB gain values to device-independent chromaticity values.

var deviceWhiteBalanceGains: AVCaptureDevice.WhiteBalanceGains

The current device-specific RGB white balance gain values.

var maxWhiteBalanceGain: Float

The maximum supported value to which a channel in the AVCaptureWhiteBalanceGains may be set.

func deviceWhiteBalanceGains(for: AVCaptureDevice.WhiteBalanceChromaticityValues) -> AVCaptureDevice.WhiteBalanceGains

Converts device-independent chromaticity values to device-specific white balance RGB gain values.

var grayWorldDeviceWhiteBalanceGains: AVCaptureDevice.WhiteBalanceGains

The current device-specific white balance values required for a neutral gray white point.

func setWhiteBalanceModeLocked(with: AVCaptureDevice.WhiteBalanceGains, completionHandler: ((CMTime) -> Void)?)

Sets white balance to locked mode with the specified deviceWhiteBalanceGains values.

func temperatureAndTintValues(for: AVCaptureDevice.WhiteBalanceGains) -> AVCaptureDevice.WhiteBalanceTemperatureAndTintValues

Converts device-specific white balance RGB gain values to device-independent temperature and tint values.

var isLockingWhiteBalanceWithCustomDeviceGainsSupported: Bool

A Boolean value indicating whether the device supports locking white balance to specific gain values.

class let currentWhiteBalanceGains: AVCaptureDevice.WhiteBalanceGains

A special constant representing the current white balance setting.

struct AVCaptureDevice.WhiteBalanceGains

Structure containing RGB white balance gain values.

struct AVCaptureDevice.WhiteBalanceChromaticityValues

Structure containing CIE 1931 xy chromaticity values.

struct AVCaptureDevice.WhiteBalanceTemperatureAndTintValues

Structure containing temperature and tint values correlated to a white-balance color.

enum AVCaptureDevice.WhiteBalanceMode

Constants to specify the white balance mode of a capture device.