1

有没有办法将 iPhone 相机上的曝光区域限制在指定的正方形,而不仅仅是一个中心点?我感兴趣的区域之外的明亮或黑暗区域正在影响整体曝光。现在我正在使用exposurePointOfInterest,但这只允许指定一个中心点。

4

1 回答 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];
            }

        }        

    }

}

http://developer.apple.com/library/mac/#documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html#//apple_ref/occ/instp/AVCaptureDevice/exposurePointOfInterestSupported

于 2013-01-02T21:50:36.840 回答