有没有办法将 iPhone 相机上的曝光区域限制在指定的正方形,而不仅仅是一个中心点?我感兴趣的区域之外的明亮或黑暗区域正在影响整体曝光。现在我正在使用exposurePointOfInterest,但这只允许指定一个中心点。
问问题
1690 次
1 回答
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];
}
}
}
}
于 2013-01-02T21:50:36.840 回答