SCCameraKitPhotoCaptureOutput

Objective-C


@interface SCCameraKitPhotoCaptureOutput : NSObject

Swift

class PhotoCaptureOutput : NSObject

An output that will capture photos. You should add this as an output for your CameraKit instance.

  • Flip the captured photo horizontally

    Warning

    If your camera pipeline uses AVFoundation, you do not need to set this property.

    Note

    By default, this is NO. When set to NO, the capture will be mirrored on the front and not mirrored on the back camera.

    Note

    If set to YES, the capture will be mirrored on top of any mirroring done by AVFoundation: Capture is mirrored if either horizontallyMirrored is YES or device set to front camera is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL horizontallyMirror;

    Swift

    var horizontallyMirror: Bool { get set }
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    + (instancetype)new NS_UNAVAILABLE;
  • Instantiates a capturer with the specified AVCapturePhotoOutput and capture settings.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithCapturePhotoOutput:
        (nullable AVCapturePhotoOutput *)output;

    Swift

    init(capturePhotoOutput output: AVCapturePhotoOutput?)

    Parameters

    output

    the photo output to be used if possible. May be nil (in which case a frame from the video stream will be captured).

  • Capture a photo and call a completion with the resulting image when done.

    Declaration

    Objective-C

    - (void)
        capturePhotoWithCaptureSettings:(nullable AVCapturePhotoSettings *)settings
                             outputSize:(CGSize)outputSize
                             completion:
                                 (nonnull void (^)(UIImage *_Nullable,
                                                   NSError *_Nullable))completion;

    Swift

    func capture(with settings: AVCapturePhotoSettings?, outputSize: CGSize) async throws -> UIImage

    Parameters

    settings

    the photo capture settings to be used. If nil, the default settings will be used.

    outputSize

    the size of the captured photo that should be outputted. Defaults to CGSizeZero which means default system size.

    completion

    the completion block called with the captured image.

  • Capture a photo and call a completion with the resulting image when done.

    Declaration

    Objective-C

    - (void)
        capturePhotoWithCaptureSettings:(nullable AVCapturePhotoSettings *)settings
                             completion:
                                 (nonnull void (^)(UIImage *_Nullable,
                                                   NSError *_Nullable))completion;

    Swift

    func capture(with settings: AVCapturePhotoSettings?) async throws -> UIImage

    Parameters

    settings

    the photo capture settings to be used. If nil, the default settings will be used.

    completion

    the completion block called with the captured image.