是什么类型/如何初始化' currentDevice'在这段代码?

时间:2014-04-29 06:28:27

标签: ios avfoundation autofocus

我试图告诉我的应用中的相机(围绕OpenFrameworks构建)自动对焦。阅读this SO post后,我通读AV Foundation Programming Guide了解如何设置对焦模式。他们给出的代码是:

if ([currentDevice isExposureModeSupported:AVCaptureExposureModeContinuousAutoExposure]) {
    CGPoint exposurePoint = CGPointMake(0.5f, 0.5f);
    [currentDevice setExposurePointOfInterest:exposurePoint];
    [currentDevice setExposureMode:AVCaptureExposureModeContinuousAutoExposure];
}

我还没有弄清楚如何在if语句之外初始化currentDevice,而且它不在文档中。应该如何初始化/它是什么类型的?感谢。

1 个答案:

答案 0 :(得分:1)

您可以阅读有关AVCaptureDevice Class Reference

的更多信息

指的是前置或后置摄像头。并且不要忘记导入AVFoundation.framework