RRCaptureCameraDevice

Objective-C

@interface RRCaptureCameraDevice : NSObject

Swift

class RRCaptureCameraDevice : NSObject

RRCaptureCameraDevice uses AVCapturePhotoOutput and AVCaptureVideoDataOutput simulteneously photo output to capture high resolution photos video output to grab current camera low quality preview

  • Undocumented

    Declaration

    Objective-C

    @property(nonatomic, readonly) CALayer * _Nonnull previewLayer

    Swift

    var previewLayer: CALayer { get }
  • Exposure value in the range (0…1). 0 stands for mimimum exposure bias and 1 for maximum exposure bias.

    Declaration

    Objective-C

    @property (nonatomic) double cameraExposure;

    Swift

    var cameraExposure: Double { get set }
  • Listen to AVCaptureVideoPreview continuous updates

    • Get preview sample pixel buffer converted to UIImage

    Warning

    calling -listenPreviewImageUpdates: will add additional output to AVCaptureSession

    Declaration

    Objective-C

    - (void)listenPreviewImageUpdates:(RRPreviewUpdatesHandler _Nonnull)handler;

    Swift

    func listenPreviewImageUpdates(_ handler: @escaping RRPreviewUpdatesHandler)

    Parameters

    handler

    RRPreviewUpdatesHandler is being called continuously with frequency depending on your back camera device

  • Allows to capture high quality image from back camera. The procedure can take a while depending on camera preset which is selected automatically accordingly to your device

    Warning

    image data could be nil (f.e. camera device is not ready, or to much of capturePhoto call)

    Declaration

    Objective-C

    - (void)capturePhoto:(RRPhotoCaptureHandler _Nonnull)handler;

    Swift

    func capturePhoto(_ handler: @escaping RRPhotoCaptureHandler)

    Parameters

    handler

    block is being called when the photo capture and processing will be finished.

  • Lock the camera’s white balance and exposure settings

    Declaration

    Objective-C

    - (void)lockExposureAndWhiteBalance;

    Swift

    func lockExposureAndWhiteBalance()
  • Reset settings to their original defaults

    Declaration

    Objective-C

    - (void)resetSettings;

    Swift

    func resetSettings()