我想得到当前增益的值,并将rgb增益的值正常化。
在ios中,苹果提供 setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:completionHandler
.
- (void)setWhiteBalanceGains:(AVCaptureWhiteBalanceGains)gains
{
NSError *error = nil;
if ( [self.captureDevice lockForConfiguration:&error] ) {
AVCaptureWhiteBalanceGains normalizedGains = [self normalizedGains:gains];
[self.captureDevice setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:normalizedGains completionHandler:nil];
[self.captureDevice unlockForConfiguration];
}
else {
NSLog( @"Could not lock device for configuration: %@", error );
}
}
- (AVCaptureWhiteBalanceGains)normalizedGains:(AVCaptureWhiteBalanceGains) g
{
AVCaptureWhiteBalanceGains gains = g;
gains.redGain = MAX(gains.redGain, 1.0f);
gains.greenGain = MAX(gains.greenGain, 3.0f);
gains.blueGain = MAX(gains.blueGain, 18.0f);
return gains;
}
我们如何使用camerax在android中实现这一点?
COLOR_CORRECTION_GAINS COLOR_CORRECTION_MODE
我已经检查了有关渠道控制的文件。但是我们如何使用新控件更改颜色校正和重置camerax预览?
暂无答案!
目前还没有任何答案,快来回答吧!