在苹果的iOS 6.0 功能页面 https://developer.apple.com/technologies/ios6/,过去常说
利用内置摄像头的高级功能。新的 API 可让您控制焦点、曝光和感兴趣区域。您还可以使用人脸检测 API 访问和显示人脸,并利用硬件支持的视频稳定功能。
此文本已被删除,并且我在 API 中找不到用于控制曝光的新方法。在班上AVCaptureDevice
在“曝光设置”下,iOS 6.0 没有新的属性/方法。你知道我可以在哪里找到 API 中公开的新功能吗?
确实有一个-exposureMode
属性于AVCaptureDevice
,但这仅用于设置模式(关闭/自动/连续),而不是实际的光圈值、SS 或 ISO。提供“曝光”控制的相机应用程序似乎都是通过后期处理来实现的。
然而,框架中似乎有未记录的 API 可以执行此操作。查看完整标题AVCaptureDevice.h https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/AVFoundation.framework/AVCaptureDevice.h (via a 类转储 http://www.codethecode.com/projects/class-dump/)并注意以下方法:
- (void)setManualExposureSupportEnabled:(BOOL)arg1;
- (BOOL)isManualExposureSupportEnabled;
- (void)setExposureGain:(float)arg1;
- (float)exposureGain;
- (void)setExposureDuration:(struct { long long x1; int x2; unsigned int x3; long long x4; })arg1;
- (struct { long long x1; int x2; unsigned int x3; long long x4; })exposureDuration;
- (void)setExposureMode:(int)arg1;
- (int)exposureMode;
- (BOOL)isExposureModeSupported:(int)arg1;
我的猜测是gain
是等效光圈值(固定光圈),并且duration
是快门速度。我想知道这些是否用于 iPhone 5弱光增强模式 http://blog.crushapps.com/2012/09/the-iphone-5s-low-light-boost-mode/.
您还可以使用otool https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/otool.1.html四处探索并尝试将这些符号拼凑在一起。可能有一个新的常数exposureMode
用于启用手动控制,以及exposureDuration
似乎它也有标志。调用这些时,请确保使用新的-isExposureModeSupported:
并且还打电话-respondsToSelector:
以检查兼容性。
与往常一样,Apple 不赞成使用私有 API,并且会被 App Store 拒绝。可能有解决这个问题的方法,例如使用隐藏调用-performSelector:
or obc_msgsend https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html#//apple_ref/c/func/objc_msgSend使用 rot13 字符串或其他东西,因为我很确定它们只对应用程序二进制文件进行静态分析。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)