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.WhiteBalanceGainsParameters
- tempAndTintValues:
An Whitebalancetemperatureandtintvalues structure containing the temperature and tint values.
Return Value
A fully populated AVCaptureDevice.WhiteBalanceGains structure containing device-specific RGB gain values.
Discussion
Call this method 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].