MBCameraSettings


@interface MBCameraSettings : NSObject <NSCopying>

Settings class containing parameters for camera capture

  • Camera preset. With this property you can set the resolution of the camera

    Default: PPCameraPresetOptimal

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBCameraPreset cameraPreset;

    Swift

    var cameraPreset: MBCameraPreset { get set }
  • Camera type. You can choose between front and back facing.

    Default: MBCameraTypeBack

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBCameraType cameraType;

    Swift

    var cameraType: MBCameraType { get set }
  • Interval between forcing two camera focuses. If <= 0, forced focuses arent performed and only continuous autofocus mode will be used.

    Default

    • 10.0f for BlinkID and BlinkOCR product
    • 8.0f for PhotoPay, pdf417 and other products

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSTimeInterval autofocusInterval;

    Swift

    var autofocusInterval: TimeInterval { get set }
  • Range restriction for camera autofocus.

    Default: PPCameraAutofocusRestrictionNone

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic)
        MBCameraAutofocusRestriction cameraAutofocusRestriction;

    Swift

    var cameraAutofocusRestriction: MBCameraAutofocusRestriction { get set }
  • Gravity of Camera preview on screen.

    Default: AVLayerVideoGravityResizeAspectFill

    Declaration

    Objective-C

    @property (readwrite, nonatomic) NSString *videoGravity;

    Swift

    weak var videoGravity: NSString! { get set }
  • Point against which the autofocus will be performed

    Default (0.5f, 0.5f) - middle of the screen.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGPoint focusPoint;

    Swift

    var focusPoint: CGPoint { get set }
  • Tells whether camera input images should be mirrored horizontally before processing

    Default: NO

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL cameraMirroredHorizontally;

    Swift

    var cameraMirroredHorizontally: Bool { get set }
  • Tells whether camera input images should be mirrored vertically before processing

    Default: NO

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) BOOL cameraMirroredVertically;

    Swift

    var cameraMirroredVertically: Bool { get set }
  • Designated initializer. Initializes the object with default settings (see above for defaults)

    Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init!()

    Return Value

    object initialized with default values.

  • Returns an optimal AVFoundation session preset based on cameraPreset value.

    Declaration

    Objective-C

    - (NSString *)calcSessionPreset;

    Swift

    func calcSessionPreset() -> String!

    Return Value

    optimal AVFoundation session preset

  • Returns an optimal AVFoundation autofocus range restriction value based on cameraAutofocusRestriction.

    Declaration

    Objective-C

    - (AVCaptureAutoFocusRangeRestriction)calcAutofocusRangeRestriction;

    Swift

    func calcAutofocusRangeRestriction() -> AVCaptureDevice.AutoFocusRangeRestriction

    Return Value

    optimal AVFoundation autofocus range restriction