如何更改android中的白平衡增益值?

92dk7w1h  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(199)

我想得到当前增益的值,并将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预览?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题