MBIDocumentSpecification


@interface MBIDocumentSpecification : 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: CGFloat, physicalSizeInInches: CGFloat)

    Parameters

    aspectRatio

    Aspect ratio of the document. Calculated as width / height

    Return Value

    initialized object

  • Unavailable

    Undocumented

    Declaration

    Objective-C

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

    Declaration

    Objective-C

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

    Swift

    class func create(from preset: MBIDocumentSpecificationPreset) -> 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:(MBIScale)scale;

    Swift

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

    Default 25.0

    Declaration

    Objective-C

    @property (nonatomic) CGFloat maxAngle;

    Swift

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

    Default: MBIMakeScale(1.0, 0.0)

    Declaration

    Objective-C

    @property (nonatomic) MBIScale portraitScale;

    Swift

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

    Default: MBIMakeScale(1.0, 0.0)

    Declaration

    Objective-C

    @property (nonatomic) MBIScale landscapeScale;

    Swift

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

    Default: MBIScanningModeAuto

    Declaration

    Objective-C

    @property (nonatomic) MBIScanningMode scanningMode;

    Swift

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

    Default: MBIMakeRange(-1, -1);

    Declaration

    Objective-C

    @property (nonatomic) MBIRange xRange;

    Swift

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

    Default: MBIMakeRange(-1, -1);

    Declaration

    Objective-C

    @property (nonatomic) MBIRange yRange;

    Swift

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

    Declaration

    Objective-C

    @property (nonatomic, readonly) CGFloat physicalSizeInInches;

    Swift

    var physicalSizeInInches: CGFloat { get }