iPhone 5的低光增亮模式 [英] iPhone 5's low light boost mode
问题描述
有没有人能够得到iPhone 5的新的低光提升模式在他们的自定义相机应用程序工作?我试过下面的代码,但没有注意到没有什么区别 - 而本机相机应用程序显着提高了亮度。
Has anyone been able to get the iPhone 5's new low light boost mode to work in their custom camera app? I tried the following code, but noticed no difference - whereas the native camera app significantly boosted the brightness.
if ([[captureManager backFacingCamera] isLowLightBoostEnabled]) {
[[captureManager backFacingCamera] automaticallyEnablesLowLightBoostWhenAvailable];
}
推荐答案
$ c> lockForConfiguration ,根据docs(以及头文件):
You need to lockForConfiguration
, according to the docs (well, the header file):
if ([[self backFacingCamera] respondsToSelector:@selector(isLowLightBoostSupported)]) {
if ([[self backFacingCamera] lockForConfiguration:nil]) {
if ([self backFacingCamera].isLowLightBoostSupported)
[self backFacingCamera].automaticallyEnablesLowLightBoostWhenAvailable = YES;
[[self backFacingCamera] unlockForConfiguration];
}
}
此外, isLowLightBoostEnabled
告诉你低光是否实际上是提升,而不是它是否可以。这是
isLowLightBoostSupported
选择器,如上所述(只有iOS 6设备响应)。
Also, isLowLightBoostEnabled
tells you whether or not the low light is actually being boosted, not whether it can be. That's the isLowLightBoostSupported
selector, as above (to which only iOS 6 devices respond).
这篇关于iPhone 5的低光增亮模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!