Converts device-independent temperature and tint values to device-specific white balance RGB gain values.
SDKs
- iOS 8.0+
- Mac Catalyst 13.0+
Framework
- AVFoundation
Declaration
func deviceWhiteBalanceGains(for tempAndTintValues: AVCapture Device.White Balance Temperature And Tint Values) -> AVCapture Device.White Balance Gains
Parameters
tempAndTintValues
An
AVCapture
structure containing the temperature and tint values.Device .White Balance Temperature And Tint Values
Return Value
A fully populated AVCapture
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 set
. Be sure to verify that the red, green, and blue gain values are within the range of [1
- max
].