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.

  • 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.