MBDocumentSpecification


@interface MBDocumentSpecification : NSObject <NSCopying>

Document class describes a document which is being detected by DocumentDetector. We encurage users to create specifications with one of our presets, if possible.

  • Use this initializer for specifiying a document format.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAspectRatio:(CGFloat)aspectRatio
                           physicalSizeInInches:(CGFloat)physicalSizeInInches;

    Swift

    init(aspectRatio: Any!, physicalSizeInInches: Any!)

    Parameters

    aspectRatio

    Aspect ratio of the document. Calculated as width / height

    Return Value

    initialized object

  • Undocumented

    Declaration

    Objective-C

    - (instancetype)init NS_UNAVAILABLE;
  • Factory method which creates Document specification based on a preset

    Declaration

    Objective-C

    + (nonnull instancetype)createFromPreset:(MBDocumentSpecificationPreset)preset;

    Swift

    class func create(from preset: MBDocumentSpecificationPreset) -> Self

    Parameters

    preset

    document preset

    Return Value

    new instance for a given document preset

  • Sets scale and scale tolerance that will be used when detecting document in both orientations.

    Declaration

    Objective-C

    - (void)setPortraitAndLandscapeScale:(MBScale)scale;

    Swift

    func setPortraitAndLandscapeScale(_ scale: MBScale)
  • Maximum angle for document detection

    Default 25.0

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) CGFloat maxAngle;

    Swift

    var maxAngle: Int32 { get set }
  • Scale and scale tolerance that will be used when detecting document in portrait orientation.

    Default: MBMakeScale(1.0, 0.0)

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBScale portraitScale;

    Swift

    var portraitScale: MBScale { get set }
  • Scale and scale tolerance that will be used when detecting document in landscape orientation.

    Default: MBMakeScale(1.0, 0.0)

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBScale landscapeScale;

    Swift

    var landscapeScale: MBScale { get set }
  • Scanning mode that defines in which orientations can this document be detected.

    Default: PPScanningModeAuto

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBScanningMode scanningMode;

    Swift

    var scanningMode: MBScanningMode { get set }
  • Percentage of possible document offset on x axis.

    Default: MBMakeRange(-1, -1);

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBRange xRange;

    Swift

    var xRange: MBRange { get set }
  • Percentage of possible document offset on y axis.

    Default: MBMakeRange(-1, -1);

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MBRange yRange;

    Swift

    var yRange: MBRange { get set }
  • Physical size of document in inches

    Declaration

    Objective-C

    @property (readonly, assign, nonatomic) CGFloat physicalSizeInInches;

    Swift

    var physicalSizeInInches: Int32 { get }