自动对焦完成后,是否有办法随时获得对焦点?
在Apple的示例代码中,他们使用:
- (void)subjectAreaDidChange:(NSNotification *)notification
{
CGPoint devicePoint = CGPointMake(.5, .5);
[self focusWithMode:AVCaptureFocusModeContinuousAutoFocus exposeWithMode:AVCaptureExposureModeContinuousAutoExposure atDevicePoint:devicePoint monitorSubjectAreaChange:NO];
}
以上代码仅适用于“点击以关注”。它还会强制相机对焦在屏幕中央。我想在自动对焦完成后立即获得对焦点。
答案 0 :(得分:3)
看起来您只需阅读focusPointOfInterest
属性即可获得当前焦点:
- (void)subjectAreaDidChange:(NSNotification *)notification
{
CGPoint devicePoint = device.focusPointOfInterest;
}