繁体   English   中英

iOS:AVFoundation:焦点

[英]iOS: AVFoundation: Focus Point

自动对焦完成后,有没有办法随时获取对焦点?

在Apple的示例代码中,他们使用:

    - (void)subjectAreaDidChange:(NSNotification *)notification

{

     CGPoint devicePoint = CGPointMake(.5, .5);

     [self focusWithMode:AVCaptureFocusModeContinuousAutoFocus exposeWithMode:AVCaptureExposureModeContinuousAutoExposure atDevicePoint:devicePoint monitorSubjectAreaChange:NO];

}

上面的代码仅适用于“点击以集中注意力”。 同样,它会迫使相机聚焦在屏幕中央。 我想在自动对焦完成后一直获取焦点。

看起来您可以只读取focusPointOfInterest属性来获取当前焦点:

- (void)subjectAreaDidChange:(NSNotification *)notification
{
     CGPoint devicePoint = device.focusPointOfInterest;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM