gpt4 book ai didi

ios - 如何在自定义相机上使用 UISlider 调整亮度?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:59:34 25 4
gpt4 key购买 nike

iOS 8 Camara 功能可在点击相机时调整亮度。

enter image description here

我也试过这段代码,但没有用。

  AVCaptureDevice *device =[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

AVCaptureWhiteBalanceGains deviceWhiteBalance;// = [device deviceWhiteBalanceGains];

AVCaptureWhiteBalanceTemperatureAndTintValues tempAndTint = [device temperatureAndTintValuesForDeviceWhiteBalanceGains:[device deviceWhiteBalanceGains]];

tempAndTint.temperature = (slider.value*100)*10000/100;
if (slider.value < 0.50) {
tempAndTint.tint = -(slider.value*100)*150/100;
}
else{
tempAndTint.tint = (slider.value*100)*150/100;
}


deviceWhiteBalance = [device deviceWhiteBalanceGainsForTemperatureAndTintValues:tempAndTint];
[device chromaticityValuesForDeviceWhiteBalanceGains:deviceWhiteBalance];


dispatch_async(dispatch_get_main_queue(), ^{

AVCaptureDevice *device =[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if (device) {
[device setWhiteBalanceModeLockedWithDeviceWhiteBalanceGains:deviceWhiteBalance completionHandler:^(CMTime syncTime) {

}];
}
});

最佳答案

我找到了解决方案。并获取支持 ios 8.0 版本以下的所有新更改

AVCamMenual - ios 8 Camera features

enter image description here

关于ios - 如何在自定义相机上使用 UISlider 调整亮度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33102033/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com