访问iOS 6新API的相机曝光和快门速度 [英] Accessing iOS 6 new APIs for camera exposure and shutter speed

查看:584
本文介绍了访问iOS 6新API的相机曝光和快门速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apple的 iOS 6.0功能页面上,它曾经用来说

On Apple's iOS 6.0 feature page, it used to say


利用内置相机的高级功能。新的API可让您控制焦点,曝光和感兴趣的区域。

Take advantage of the built-in camera’s advanced features. New APIs let you control focus, exposure, and region of interest. You can also access and display faces with face detection APIs, and leverage hardware-enabled video stabilization.

此文字已被移除,因此,我没有找到新的方法在API中用于控制暴露。在 AVCaptureDevice 在曝光设置下没有新的属性/方法为iOS 6.0。你知道我在哪里可以找到曝光的新功能在API?

This text has since been removed, and I can't find new methods in the API for controlling exposure. In class AVCaptureDevice under "Exposure Settings" there is no new property/method for iOS 6.0. Do you know where i can find new features for exposure in API?

推荐答案

这是真的有一个 -exposureMode 属性在 AVCaptureDevice ,但这只是设置模式(关闭/自动/连续),而不是实际的f- ,或ISO。提供曝光控件的照相机应用程序似乎通过后处理来实现。

It's true that there is an -exposureMode property on AVCaptureDevice, but that's only for setting the mode (off/auto/continuous) and not the actual f-stop, SS, or ISO. Camera apps that provide "exposure" control all seem to do it through post-processing.

但是,框架中似乎有未记录的API可以执行此操作。请查看 AVCaptureDevice的完整标题。 h (通过类转储),并注意以下内容方法:

However, it seems there are undocumented APIs in the framework to do this. Check out the full headers for AVCaptureDevice.h (via a class-dump) and note the following methods:

- (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的低光提升模式

My guess is gain is equivalent f-stop (fixed aperture), and duration is shutter speed. I wonder if these are used for the iPhone 5's low-light boost mode.

您还可以使用 otool ,试图将符号拼凑在一起。在 exposureMode 中启用手动控制可能有一个新常量, exposureDuration 似乎也有标志。调用这些时,请务必使用新的 -isExposureModeSupported:并调用 -respondsToSelector:来检查兼容性。

You can also use otool to poke around and try to piece together the symbols. There's likely a new constant in exposureMode for enabling manual control, and exposureDuration seems like it has flags too. When calling these, make sure to use the new -isExposureModeSupported: and also call -respondsToSelector: to check compatibility.

一如既往,使用私人API被苹果所。病,并且被App Store拒绝。可能有一些方法,例如使用 -performSelector: obc_msgsend 与rot13字符串或其他他们只对应用程序二进制文件进行静态分析。

As always, using private APIs is frowned upon by Apple and is cause for rejection from the App Store. There might be ways around this, such as hiding the calls using -performSelector: or obc_msgsend with rot13 strings or something, as I'm pretty sure they only do static analysis on the app binary.

这篇关于访问iOS 6新API的相机曝光和快门速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆