有没有办法将iPhone相机上的曝光区域限制在指定的方格,而不仅仅是中心点?我感兴趣的区域之外的明亮或黑暗区域正在影响整体曝光。现在我正在使用exposurePointOfInterest,但这只允许指定一个中心点。
答案 0 :(得分:0)
看起来你可以将CGPoint传递给方法。
示例:
- (void) focusAtPoint:(CGPoint)point
{
AVCaptureDevice *device = [[self videoInput] device];
if ([device isFocusPointOfInterestSupported] && [device isFocusModeSupported:AVCaptureFocusModeAutoFocus]) {
NSError *error;
if ([device lockForConfiguration:&error]) {
[device setFocusPointOfInterest:point];
[device exposurePointOfInterest:location];
[device setFocusMode:AVCaptureFocusModeAutoFocus];
[device unlockForConfiguration];
} else {
id delegate = [self delegate];
if ([delegate respondsToSelector:@selector(acquiringDeviceLockFailedWithError:)]) {
[delegate acquiringDeviceLockFailedWithError:error];
}
}
}
}