setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues:handler:)
Sets white balance to locked mode with explicit temperature and tint values.
Declaration
func setWhiteBalanceModeLocked(whiteBalanceTemperatureAndTintValues: AVCaptureDevice.WhiteBalanceTemperatureAndTintValues, handler: ((CMTime) -> Void)? = nil)Parameters
- whiteBalanceTemperatureAndTintValues:
The white balance temperature and tint values, as computed from Temperatureandtintvalues(for:) method, Whitebalancetemperatureandtintvalues presets or manual input.
- handler:
A block to be called when white balance values have been set to the values specified and Whitebalancemode Swift.property is set to
AVCaptureWhiteBalanceModeLocked. If Setwhitebalancemodelocked(whitebalancetemperatureandtintvalues:handler:) is called multiple times, the completion handlers are called in FIFO order. The block receives a timestamp which matches that of the first buffer to which all settings have been applied. Note that the timestamp is synchronized to the device clock, and thus must be converted to the Synchronizationclock prior to comparison with the timestamps of buffers delivered via an Avcapturevideodataoutput. This parameter may benilif synchronization is not required.
Discussion
This method takes a AVCaptureDevice.WhiteBalanceTemperatureAndTintValues struct and applies the appropriate AVCaptureDevice.WhiteBalanceGains. This method throws an NSRangeException if any of the values are set to an unsupported level. This method throws an NSGenericException if called without first obtaining exclusive access to the device using lockForConfiguration().