MBCameraSettings

Objective-C


@interface MBCameraSettings : NSObject <NSCopying>

Swift

class MBCameraSettings : NSObject, NSCopying

Settings class containing parameters for camera capture

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

    Default: MBCameraPresetOptimal

    Declaration

    Objective-C

    @property (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 (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 (nonatomic) NSTimeInterval autofocusInterval;

    Swift

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

    Default: MBCameraAutofocusRestrictionNone

    Declaration

    Objective-C

    @property (nonatomic) MBCameraAutofocusRestriction cameraAutofocusRestriction;

    Swift

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

    Default: AVLayerVideoGravityResizeAspectFill

    Declaration

    Objective-C

    @property (nonatomic, weak) 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 (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 (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 (nonatomic) BOOL cameraMirroredVertically;

    Swift

    var cameraMirroredVertically: Bool { get set }
  • Set the back side preview camera layer zoom factor. 1.0 means there is no zoom, 2.0 double the zoom - preview layer is 2x zoomed than video output. Valid ranges are [1.0, 2.0] - rounded to nearest two decimals. Setting previewZoomScale out of valid ranges throws an exception.

    Default: 1.0

    Declaration

    Objective-C

    @property (nonatomic) CGFloat previewZoomScale;

    Swift

    var previewZoomScale: CGFloat { 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

  • Force using kCVPixelFormatType_420YpCbCr8BiPlanarFullRange. As kCVPixelFormatType_420YpCbCr8BiPlanarFullRange is an experimental feature, no support will be provided while this flag is active.

    Default: NO

    Declaration

    Objective-C

    @property (nonatomic) BOOL forceUsingPixelFormatTypeBiPlanarFullRange;

    Swift

    var forceUsingPixelFormatTypeBiPlanarFullRange: Bool { get set }