是否允许调节焦点模式
- (BOOL)isFocusModeSupported:(AVCaptureFocusMode)focusMode;
typedef NS_ENUM(NSInteger, AVCaptureFocusMode) {
AVCaptureFocusModeLocked = 0, 关闭对焦
AVCaptureFocusModeAutoFocus = 1, 自动对焦
AVCaptureFocusModeContinuousAutoFocus = 2, 自动连续对焦
} NS_AVAILABLE(10_7, 4_0) __TVOS_PROHIBITED;
对焦模式
@property(nonatomic) AVCaptureFocusMode focusMode;
是否允许设置自己感兴趣的焦点
@property(nonatomic, readonly, getter=isFocusPointOfInterestSupported) BOOL focusPointOfInterestSupported;
设置自己感兴趣的对焦点
@property(nonatomic) CGPoint focusPointOfInterest;
是否正在对焦
@property(nonatomic, readonly, getter=isAdjustingFocus) BOOL adjustingFocus;
是否支持自动对焦范围
@property(nonatomic, readonly, getter=isAutoFocusRangeRestrictionSupported) BOOL autoFocusRangeRestrictionSupported NS_AVAILABLE_IOS(7_0);
设置自动对焦范围
@property(nonatomic) AVCaptureAutoFocusRangeRestriction autoFocusRangeRestriction NS_AVAILABLE_IOS(7_0);
typedef NS_ENUM(NSInteger, AVCaptureAutoFocusRangeRestriction) {
AVCaptureAutoFocusRangeRestrictionNone = 0, 没有限制
AVCaptureAutoFocusRangeRestrictionNear = 1, 近处
AVCaptureAutoFocusRangeRestrictionFar = 2, 远处
} NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED;
是否支持平滑对焦
@property(nonatomic, readonly, getter=isSmoothAutoFocusSupported) BOOL smoothAutoFocusSupported NS_AVAILABLE_IOS(7_0);
是否允许平滑对焦
@property(nonatomic, getter=isSmoothAutoFocusEnabled) BOOL smoothAutoFocusEnabled NS_AVAILABLE_IOS(7_0);
读取镜头位置
@property(nonatomic, readonly) float lensPosition NS_AVAILABLE_IOS(8_0);
设置镜头位置
- (void)setFocusModeLockedWithLensPosition:(float)lensPosition completionHandler:(nullable void (^)(CMTime syncTime))handler NS_AVAILABLE_IOS(8_0);