ALDocumentScanPlugin Class Reference

Inherits from NSObject
Declared in ALDocumentScanPlugin.h

Overview

The ALDocumentScanPlugin class declares the programmatic interface for an object that manages easy access to Anylines document detection. All its capabilities are bundled into this AnylineAbstractModuleView subclass. Management of the scanning process happens within the view object. It is configurable via interface builder.

Communication with the host application is managed with a delegate that conforms to ALDocumentScanPluginDelegate.

  delegates

@property (nonatomic, strong, readonly) NSHashTable<ALDocumentScanPluginDelegate> *delegates

  infoDelegates

@property (nonatomic, strong, readonly) NSHashTable<ALDocumentInfoDelegate> *infoDelegates

  pluginID

@property (nullable, nonatomic, strong, readonly) NSString *pluginID

  scanImage

@property (nullable, nonatomic, strong, readonly) ALImage *scanImage

  coreController

@property (nullable, nonatomic, strong) ALCoreController *coreController

  imageProvider

@property (nullable, nonatomic, assign) id<ALImageProvider> imageProvider

  justDetectCornersIfPossible

@property (atomic, assign) BOOL justDetectCornersIfPossible

– initWithPluginID:licenseKey:delegate:error:

Constructor for the DocumentScanPlugin

- (instancetype _Nullable)initWithPluginID:(NSString *_Nullable)pluginID licenseKey:(NSString *_Nonnull)licenseKey delegate:(id<ALDocumentScanPluginDelegate> _Nonnull)delegate error:(NSError *_Nullable *_Nullable)error

Parameters

pluginID

An unique pluginID

licenseKey

The Anyline license key

delegate

The delegate which receives the results

error

The Error object if something fails

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALDocumentScanPlugin.h

– init

- (instancetype _Nullable)init

– start:error:

- (BOOL)start:(id<ALImageProvider> _Nonnull)imageProvider error:(NSError *_Nullable *_Nullable)error

– stopAndReturnError:

- (BOOL)stopAndReturnError:(NSError *_Nullable *_Nullable)error

– enableReporting:

- (void)enableReporting:(BOOL)enable

– isRunning

- (BOOL)isRunning

– triggerPictureCornerDetectionAndReturnError:

- (BOOL)triggerPictureCornerDetectionAndReturnError:(NSError *_Nullable *_Nullable)error

– transformImageWithSquare:image:error:

Crops an arbitrary rectangle (e.g. trapezoid) of the input image and perspectively transforms it to a rectangle (e.g. square). After the transformation is complete the result delegate anylineDocumentScanPlugin:hasResult:fullImage:documentCorners will be triggered. In any case call [ALDocumentScanPlugin cancelScanningAndReturnError:] before using this method.

- (BOOL)transformImageWithSquare:(ALSquare *_Nullable)square image:(UIImage *_Nullable)image error:(NSError *_Nullable *_Nullable)error

Parameters

square

The input image will be transformed to this square

image

The UIImage which will be processed and transformed

error

The error that occured

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALDocumentScanPlugin.h

– transformALImageWithSquare:image:error:

Crops an arbitrary rectangle (e.g. trapezoid) of the input image and perspectively transforms it to a rectangle (e.g. square). After the transformation is complete the result delegate anylineDocumentScanPlugin:hasResult:fullImage:documentCorners will be triggered. In any case call [ALDocumentScanPlugin cancelScanningAndReturnError:] before using this method.

- (BOOL)transformALImageWithSquare:(ALSquare *_Nullable)square image:(ALImage *_Nullable)image error:(NSError *_Nullable *_Nullable)error

Parameters

square

The input image will be transformed to this square

image

The ALImage which will be processed and transformed

error

The error that occured

Return Value

Boolean indicating the success / failure of the call.

Declared In

ALDocumentScanPlugin.h

  maxDocumentRatioDeviation

Maximum deviation for the ratio. 0.15 is the default

@property (nonnull, nonatomic, strong) NSNumber *maxDocumentRatioDeviation

Availability

3.8

Discussion

Warning: Parameter can only be changed when the scanning is not running.

Declared In

ALDocumentScanPlugin.h

  maxOutputResolution

Maximum resolution of the output image

@property (nonatomic, assign) CGSize maxOutputResolution

Availability

3.19

Discussion

Warning: Parameter can only be changed when the scanning is not running.

Declared In

ALDocumentScanPlugin.h

  documentRatios

Sets custom document ratios (NSNumbers) that should be supported (or null to set back to all supported types).

@property (nullable, nonatomic, strong) NSArray<NSNumber*> *documentRatios

Parameters

ratios

all supported formats

Availability

3.8

Discussion

Warning: Parameter can only be changed when the scanning is not running.

Declared In

ALDocumentScanPlugin.h

  postProcessingEnabled

@property (nonatomic, assign) BOOL postProcessingEnabled

– addDelegate:

- (void)addDelegate:(id<ALDocumentScanPluginDelegate> _Nonnull)delegate

– removeDelegate:

- (void)removeDelegate:(id<ALDocumentScanPluginDelegate> _Nonnull)delegate

– addInfoDelegate:

- (void)addInfoDelegate:(id<ALDocumentInfoDelegate> _Nonnull)infoDelegate

– removeInfoDelegate:

- (void)removeInfoDelegate:(id<ALDocumentInfoDelegate> _Nonnull)infoDelegate