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
-
Maximum angle for document detection
Default 25.0
Declaration
Objective-C
@property (assign, readwrite, nonatomic) CGFloat maxAngle;
Swift
var maxAngle: Int32 { 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 }
-
Physical size of document in inches
Declaration
Objective-C
@property (readonly, assign, nonatomic) CGFloat physicalSizeInInches;
Swift
var physicalSizeInInches: Int32 { get }