scanbot-web-sdk 2.7.0 → 2.8.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/document-scanner-view.d.ts +6 -1
- package/@types/model/document/document-detection-result.d.ts +2 -4
- package/@types/utils/dto/VideoSize.d.ts +4 -0
- package/@types/utils/math-utils.d.ts +1 -0
- package/@types/utils/predicate/polygon-movement-predicate.d.ts +14 -0
- package/bundle/ScanbotSDK.min.js +2 -2
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ import { DocumentDetectionResult } from "./model/document/document-detection-res
|
|
|
4
4
|
import { ScanbotCameraProps, ScanbotCameraState, ScannerView } from "./scanner-view";
|
|
5
5
|
import { ShutterButton, ShutterButtonAction } from "./view/shutter-button";
|
|
6
6
|
import { DocumentOutline } from "./view/document-outline";
|
|
7
|
+
import { PolygonMovementPredicate } from "./utils/predicate/polygon-movement-predicate";
|
|
8
|
+
import { Polygon } from "./utils/dto/Polygon";
|
|
7
9
|
declare class DocumentScannerState extends ScanbotCameraState {
|
|
8
10
|
action: ShutterButtonAction;
|
|
9
11
|
}
|
|
@@ -14,6 +16,7 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
|
|
|
14
16
|
static DETECT_AND_CROP_RESOLUTION: number;
|
|
15
17
|
outline: DocumentOutline | null;
|
|
16
18
|
button: ShutterButton | null;
|
|
19
|
+
polygonMovementPredicate: PolygonMovementPredicate;
|
|
17
20
|
autoCaptureToken: any;
|
|
18
21
|
constructor(props: ScanbotCameraProps);
|
|
19
22
|
get defaultAction(): ShutterButtonAction;
|
|
@@ -36,9 +39,11 @@ export default class DocumentScannerView extends ScannerView<DocumentScannerProp
|
|
|
36
39
|
detect(): Promise<void>;
|
|
37
40
|
getStatusString(detectionResult: any): string;
|
|
38
41
|
detectInWebWorker(): Promise<any>;
|
|
39
|
-
handleAutoCapture(statusOk: boolean): Promise<void>;
|
|
42
|
+
handleAutoCapture(statusOk: boolean, polygon?: Polygon): Promise<void>;
|
|
40
43
|
updateButton(action: ShutterButtonAction): void;
|
|
41
44
|
render(): JSX.Element;
|
|
42
45
|
defaultCaptureButtonClick: () => Promise<void>;
|
|
46
|
+
private polygonPointsToPixels;
|
|
47
|
+
private runMovementPredicate;
|
|
43
48
|
}
|
|
44
49
|
export {};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { VideoSize } from "../../utils/dto/VideoSize";
|
|
1
2
|
import { ContourDetectionResult } from "./contour-detection-result";
|
|
2
3
|
export declare class DocumentDetectionResult extends ContourDetectionResult {
|
|
3
4
|
cropped?: Uint8Array;
|
|
4
5
|
original: Uint8Array;
|
|
5
|
-
videoSize:
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
};
|
|
6
|
+
videoSize: VideoSize;
|
|
9
7
|
constructor(contourDetectionResult?: ContourDetectionResult);
|
|
10
8
|
}
|
|
@@ -6,4 +6,5 @@ export declare class MathUtils {
|
|
|
6
6
|
* Specifically this algorithm because it's simpler: the returned polygon will always be simple (non self-intersecting)
|
|
7
7
|
*/
|
|
8
8
|
static isConvex(_vertices: Point[]): boolean;
|
|
9
|
+
static distanceBetweenPoints(point1: Point, point2: Point): number;
|
|
9
10
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Polygon } from "../dto/Polygon";
|
|
2
|
+
import { VideoSize } from "../dto/VideoSize";
|
|
3
|
+
export declare class PolygonMovementPredicate {
|
|
4
|
+
private static DEFAULT_SENSITIVITY;
|
|
5
|
+
private lastPolygon;
|
|
6
|
+
private maxDistance;
|
|
7
|
+
private sensitivity;
|
|
8
|
+
constructor(videoSize: VideoSize, sensitivity?: Number);
|
|
9
|
+
checkPredicate(polygon: Polygon): boolean;
|
|
10
|
+
resetPredicate(): void;
|
|
11
|
+
updatePredicate(polygon: Polygon): void;
|
|
12
|
+
private isPointMoved;
|
|
13
|
+
private calculateMaxDistance;
|
|
14
|
+
}
|