scanbot-web-sdk 6.0.0-dev.2 → 6.0.0-dev.3
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/consume-type.d.ts +2 -1
- package/@types/core/bridge/common.d.ts +1 -1
- package/@types/core/bridge/compiled/BarcodeScannerTypes.d.ts +5 -3
- package/@types/core/bridge/compiled/GDRTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocument.d.ts +38 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerConfigs.d.ts +183 -0
- package/@types/core/bridge/compiled/GenericDocumentRecognizerTypes.d.ts +7 -6
- package/@types/core/bridge/compiled/GenericDocumentTypes.d.ts +38 -0
- package/@types/core/bridge/compiled/ParametricFilters.d.ts +4 -2
- package/@types/core/bridge/worker-bridge.d.ts +584 -26
- package/@types/core/worker/ScanbotSDK.Core.d.ts +18 -7
- package/@types/core-types.d.ts +3 -1
- package/@types/document-scanner-view.d.ts +3 -1
- package/@types/index.d.ts +39 -4
- package/@types/model/barcode/barcode-result.d.ts +12 -2
- package/@types/model/barcode/barcode.d.ts +2 -1
- package/@types/model/camera-info.d.ts +3 -2
- package/@types/model/configuration/barcode-scanner-configuration.d.ts +6 -3
- package/@types/model/configuration/cropping-view-configuration.d.ts +5 -0
- package/@types/model/configuration/document-scanner-configuration.d.ts +2 -8
- package/@types/model/configuration/generic-document-recognizer-configuration.d.ts +1 -1
- package/@types/model/configuration/initialization-options.d.ts +8 -0
- package/@types/model/configuration/mrz-scanner-configuration.d.ts +1 -1
- package/@types/model/configuration/scanner-configuration.d.ts +7 -0
- package/@types/model/configuration/selection-overlay-configuration.d.ts +2 -2
- package/@types/model/configuration/view-finder-scanner-configuration.d.ts +1 -1
- package/@types/model/error/media-error.d.ts +1 -0
- package/@types/scanbot-sdk.d.ts +355 -52
- package/@types/service/generic-document-recognizer.d.ts +3 -1
- package/@types/service/simple-mrz-recognizer.d.ts +3 -1
- package/@types/service/text-data-recognizer.d.ts +3 -1
- package/@types/ui2/common.d.ts +8 -0
- package/@types/ui2/configuration/ActionBarConfiguration.d.ts +30 -30
- package/@types/ui2/configuration/ArTrackingOverlayConfiguration.d.ts +220 -220
- package/@types/ui2/configuration/BarcodeInfoMapping.d.ts +51 -51
- package/@types/ui2/configuration/BarcodeItemMapper.d.ts +2 -2
- package/@types/ui2/configuration/BarcodeRecognizerConfiguration.d.ts +32 -32
- package/@types/ui2/configuration/BarcodeScannerConfiguration.d.ts +168 -168
- package/@types/ui2/configuration/BarcodeScannerTypes.d.ts +1 -6
- package/@types/ui2/configuration/BarcodeScannerUIResult.d.ts +29 -0
- package/@types/ui2/configuration/BarcodeTextLocalization.d.ts +124 -69
- package/@types/ui2/configuration/BarcodeTypes.d.ts +1 -1
- package/@types/ui2/configuration/BarcodeUseCase.d.ts +4 -3
- package/@types/ui2/configuration/CameraConfiguration.d.ts +32 -32
- package/@types/ui2/configuration/CameraPermission.d.ts +33 -33
- package/@types/ui2/configuration/Common.d.ts +190 -190
- package/@types/ui2/configuration/CommonFieldType.d.ts +1 -0
- package/@types/ui2/configuration/FindAndPickScanningModeUseCase.d.ts +364 -12
- package/@types/ui2/configuration/GenericDocument.d.ts +1 -0
- package/@types/ui2/configuration/MultipleScanningModeUseCase.d.ts +488 -488
- package/@types/ui2/configuration/ScanbotAlertDialog.d.ts +27 -27
- package/@types/ui2/configuration/SingleScanningModeUseCase.d.ts +169 -169
- package/@types/ui2/configuration/TopBarConfiguration.d.ts +36 -36
- package/@types/ui2/configuration/UserGuidanceConfiguration.d.ts +16 -16
- package/@types/ui2/configuration/ViewFinderConfiguration.d.ts +45 -45
- package/@types/ui2/configuration.d.ts +2 -1
- package/@types/ui2/controllers/barcode-scanner-controller.d.ts +2 -2
- package/@types/ui2/controllers/multiple-scanning-mode-controller.d.ts +4 -2
- package/@types/ui2/controllers/single-scanning-mode-controller.d.ts +4 -2
- package/@types/ui2/model/counted-barcodes.d.ts +12 -19
- package/@types/ui2/scanbot-sdk-ui.d.ts +2 -2
- package/@types/ui2/scanbot-ui-library.d.ts +3 -2
- package/@types/ui2/utils/barcode-mapper/expected-barcode-mapper.d.ts +13 -0
- package/@types/ui2/utils/barcode-mapper/i-barcode-mapper.d.ts +18 -0
- package/@types/ui2/utils/{barcode-mapper.d.ts → barcode-mapper/user-barcode-mapper.d.ts} +4 -16
- package/@types/ui2/utils/find-and-pick.ts/expected-barcode-counter.d.ts +7 -0
- package/@types/ui2/utils/styled-badge.d.ts +1 -1
- package/@types/ui2/views/ar/ar-badge.d.ts +18 -0
- package/@types/ui2/views/ar/ar-overlay-barcode-info.d.ts +5 -1
- package/@types/ui2/views/ar/vertical-positions.d.ts +12 -0
- package/@types/ui2/views/barcode-info/barcode-info.d.ts +3 -1
- package/@types/ui2/views/barcode-scanner.d.ts +5 -5
- package/@types/ui2/views/dialog/base/confirmation-dialog.d.ts +20 -0
- package/@types/ui2/views/dialog/find-and-pick-submit-dialog.d.ts +10 -0
- package/@types/ui2/views/drawer/barcode-result-drawer.d.ts +1 -1
- package/@types/ui2/views/drawer/counting-button.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-drawer-empty-state.d.ts +1 -1
- package/@types/ui2/views/drawer/subviews/barcode-list-item.d.ts +5 -4
- package/@types/ui2/views/drawer/subviews/barcode-list.d.ts +8 -1
- package/@types/ui2/views/drawer/subviews/drawer-header-content.d.ts +1 -1
- package/@types/utils/barcode-utils.d.ts +10 -0
- package/@types/utils/browser-cameras.d.ts +92 -0
- package/@types/utils/dto/Polygon.d.ts +2 -1
- package/@types/utils/stats.d.ts +4 -0
- package/@types/utils/video-stream.d.ts +3 -3
- package/@types/utils/video-to-image-data/two-d-video-to-image-data.d.ts +8 -0
- package/@types/utils/video-to-image-data/video-to-image-data.d.ts +5 -0
- package/@types/utils/video-to-image-data/webgl-video-to-image-data.d.ts +21 -0
- package/@types/view/barcode-polygon/animated-barcode-selection-overlay.d.ts +1 -0
- package/@types/view/scanbot-camera-view.d.ts +9 -3
- package/@types/worker/worker-bridge.d.ts +587 -30
- package/bundle/ScanbotSDK.min.js +4 -4
- package/bundle/ScanbotSDK.ui2.min.js +16 -16
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
- package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
- package/package.json +2 -2
- package/@types/core/bridge/compiled_schemas_v3/BarcodeConfigs.d.ts +0 -973
- package/@types/core/bridge/compiled_schemas_v3/BarcodeScannerTypes.d.ts +0 -183
- package/@types/core/bridge/compiled_schemas_v3/BarcodeTypes.d.ts +0 -183
- package/@types/core/bridge/compiled_schemas_v3/CheckRecognizerTypes.d.ts +0 -29
- package/@types/core/bridge/compiled_schemas_v3/CommonFieldType.d.ts +0 -59
- package/@types/core/bridge/compiled_schemas_v3/DocumentDetectorTypes.d.ts +0 -196
- package/@types/core/bridge/compiled_schemas_v3/DocumentQualityAnalyzerTypes.d.ts +0 -105
- package/@types/core/bridge/compiled_schemas_v3/EhicTypes.d.ts +0 -218
- package/@types/core/bridge/compiled_schemas_v3/FrameUtilities.d.ts +0 -18
- package/@types/core/bridge/compiled_schemas_v3/GenericDocument.d.ts +0 -198
- package/@types/core/bridge/compiled_schemas_v3/GenericDocumentRecognizerTypes.d.ts +0 -104
- package/@types/core/bridge/compiled_schemas_v3/GenericTextLineScannerTypes.d.ts +0 -165
- package/@types/core/bridge/compiled_schemas_v3/Geometry.d.ts +0 -49
- package/@types/core/bridge/compiled_schemas_v3/ImageProcessorTypes.d.ts +0 -13
- package/@types/core/bridge/compiled_schemas_v3/LicensePlateScannerTypes.d.ts +0 -67
- package/@types/core/bridge/compiled_schemas_v3/MRZTypes.d.ts +0 -52
- package/@types/core/bridge/compiled_schemas_v3/MedicalCertificateTypes.d.ts +0 -306
- package/@types/core/bridge/compiled_schemas_v3/OcrElements.d.ts +0 -129
- package/@types/core/bridge/compiled_schemas_v3/ParametricFilters.d.ts +0 -186
- package/@types/core/bridge/compiled_schemas_v3/PdfConfig.d.ts +0 -197
- package/@types/core/bridge/compiled_schemas_v3/TiffTypes.d.ts +0 -183
- package/@types/ui2/configuration/BarcodeItem.d.ts +0 -6
- package/@types/ui2/configuration/utils.d.ts +0 -6
- /package/@types/ui2/views/dialog/{styled-dialog.d.ts → base/styled-dialog.d.ts} +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { CameraFacingMode, CameraInfo } from "../model/camera-info";
|
|
2
|
+
/**
|
|
3
|
+
* The {@link BrowserCameras} can provide information about the browser's cameras in two different ways.
|
|
4
|
+
*
|
|
5
|
+
* - `SLOW`:
|
|
6
|
+
* Slow but accurate.
|
|
7
|
+
* This mode discovers camera information by starting a camera stream for each of the cameras that the
|
|
8
|
+
* browsers offers access to. This is done because the browser offers the most accurate information about
|
|
9
|
+
* a camera only when a stream of that camera is running.
|
|
10
|
+
* Using this data, {@link BrowserCameras.getMainCamera} can make the best possible predictions of which
|
|
11
|
+
* camera is the "main" one.
|
|
12
|
+
* On most devices, this method of starting all camera streams will cause the "camera is running" indicator
|
|
13
|
+
* light or notification to be displayed. Other effects like clicking camera lenses might also be observable.
|
|
14
|
+
* This process can be slow. On some devices, this mode has a running time of several seconds.
|
|
15
|
+
*
|
|
16
|
+
* - `FAST`:
|
|
17
|
+
* Fast but less accurate.
|
|
18
|
+
* This mode discovers camera information by guess-parsing the browser-provided camera labels.
|
|
19
|
+
* Using this data, {@link BrowserCameras.getMainCamera} can make good predictions of which camera is the "main" one.
|
|
20
|
+
* However, this technique is limited and cannot provide information about the torch control capabilities.
|
|
21
|
+
* Additionally, information about the camera resolution might be missing.
|
|
22
|
+
* On most devices, this mode has a runtime of less than 500ms.
|
|
23
|
+
*/
|
|
24
|
+
export type DiscoverCameraMode = 'FAST' | 'SLOW';
|
|
25
|
+
/**
|
|
26
|
+
* Describes the strategy used to obtain information about the browser's cameras in {@link BrowserCameras}.
|
|
27
|
+
* This information is used to automatically choose the best (=main) camera on devices with multiple cameras.
|
|
28
|
+
* - If `SLOW_DEFERRED` or `FAST_DEFERRED` is used, the camera information is obtained when a scanner is opened for the
|
|
29
|
+
* first time. Because querying the camera information takes some time, this might cause a small delay when the
|
|
30
|
+
* scanner is opened.
|
|
31
|
+
* - If `SLOW` or `FAST` is used, the camera information is being gathered in the background as soon as you start the
|
|
32
|
+
* SDK's initialization. When you open a scanner a bit later, the necessary camera information might already be
|
|
33
|
+
* gathered and the scanner opens a bit faster than with the `*_DEFERRED` modes.
|
|
34
|
+
* Please note that this might trigger the user's camera permission dialog when you initialize the SDK.
|
|
35
|
+
* - If `NONE` is used, no additional camera information is gathered. On multi-camera devices, the choice of the
|
|
36
|
+
* camera is left to the browser. On a few devices, the browser chooses a camera with a 'fish-eye' or telephoto lens
|
|
37
|
+
* which is usually undesirable for scans.
|
|
38
|
+
*
|
|
39
|
+
* For the difference between `SLOW` and `FAST` see {@link DiscoverCameraMode}.
|
|
40
|
+
*
|
|
41
|
+
* @default `SLOW_DEFERRED`
|
|
42
|
+
*
|
|
43
|
+
* @see {@link BrowserCameras.load}
|
|
44
|
+
*/
|
|
45
|
+
export type CameraDetectionStrategy = 'SLOW' | 'FAST' | 'SLOW_DEFERRED' | 'FAST_DEFERRED' | 'NONE';
|
|
46
|
+
/**
|
|
47
|
+
* This class has two purposes:
|
|
48
|
+
* 1. It provides a list of the cameras that the browser offers access to.
|
|
49
|
+
* 2. It tries to answer the difficult question of "which of these cameras is the main one".
|
|
50
|
+
*/
|
|
51
|
+
export declare class BrowserCameras {
|
|
52
|
+
private static _INSTANCE?;
|
|
53
|
+
static get INSTANCE(): BrowserCameras;
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* Most likely, you want to use {@link INSTANCE} instead.
|
|
57
|
+
* */
|
|
58
|
+
constructor();
|
|
59
|
+
/** Call {@link load} to populate this list. */
|
|
60
|
+
listOfCameras: CameraInfo[];
|
|
61
|
+
private loadSlowResult?;
|
|
62
|
+
private loadFastResult?;
|
|
63
|
+
private strategy;
|
|
64
|
+
/** @internal */
|
|
65
|
+
initialize(strategy?: CameraDetectionStrategy): void;
|
|
66
|
+
/**
|
|
67
|
+
* This method populates the internally cached list of cameras.
|
|
68
|
+
* Results to this method are cached and subsequent calls will faster.
|
|
69
|
+
* See {@link DiscoverCameraMode} for a detailed description of this function's behavior.
|
|
70
|
+
* If no value for `mode` is given, the global default set during SDK initialization is used.
|
|
71
|
+
* @returns The gathered camera information
|
|
72
|
+
*/
|
|
73
|
+
load(mode?: DiscoverCameraMode): Promise<CameraInfo[]>;
|
|
74
|
+
private loadSlow;
|
|
75
|
+
private loadFast;
|
|
76
|
+
/**
|
|
77
|
+
* You need to call {@link load} before calling this function to populate the list of cameras.
|
|
78
|
+
* @return The "main" camera of the device. Typically, this is the camera with the highest resolution. Typically, it
|
|
79
|
+
* has a "regular" lens (i.e. not fish-eye or telephoto lens).
|
|
80
|
+
*/
|
|
81
|
+
getMainCamera(facingMode: 'front' | 'back'): CameraInfo | null;
|
|
82
|
+
private getVideoDevices;
|
|
83
|
+
private stopStream;
|
|
84
|
+
private static guessparseCameraLabelFacingMode;
|
|
85
|
+
private static guessparseCameraLabelMaxNumPixels;
|
|
86
|
+
private assertPermissionsAreOk;
|
|
87
|
+
/** @internal */
|
|
88
|
+
static getCameraInfoFromStream(stream: MediaStream): CameraInfo;
|
|
89
|
+
private getUserMedia;
|
|
90
|
+
}
|
|
91
|
+
export declare function parseFacingMode(browserFacingMode?: string): CameraFacingMode;
|
|
92
|
+
export declare function getMaxNumPixelsFromCapabilities(capabilities?: MediaTrackCapabilities): number | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
export interface VideoStreamProps {
|
|
3
|
-
videoConstraints:
|
|
3
|
+
videoConstraints: MediaTrackConstraints;
|
|
4
4
|
preferredCamera?: string;
|
|
5
5
|
onReady: () => void;
|
|
6
6
|
onStreamChanged: (stream: MediaStream) => void;
|
|
@@ -14,11 +14,11 @@ export interface VideoStreamState {
|
|
|
14
14
|
export default class VideoStream extends React.Component<VideoStreamProps, VideoStreamState> {
|
|
15
15
|
constructor(props: VideoStreamProps);
|
|
16
16
|
orientationChanged(e: Event): void;
|
|
17
|
-
setDeviceIdInConstraints(constraints:
|
|
17
|
+
setDeviceIdInConstraints(constraints: MediaTrackConstraints): Promise<MediaTrackConstraints>;
|
|
18
18
|
private readonly orientationchangeCallback;
|
|
19
19
|
componentDidMount(): Promise<void>;
|
|
20
20
|
refreshStream(): Promise<void>;
|
|
21
|
-
stopCurrentStreams():
|
|
21
|
+
stopCurrentStreams(): void;
|
|
22
22
|
componentWillUnmount(): void;
|
|
23
23
|
/**
|
|
24
24
|
* Base class that does not specifically require a render function.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { VideoToImageData } from "./video-to-image-data";
|
|
2
|
+
export declare class TwoDVideoToImageData implements VideoToImageData {
|
|
3
|
+
_type: string;
|
|
4
|
+
private readonly canvas;
|
|
5
|
+
private readonly ctx;
|
|
6
|
+
constructor();
|
|
7
|
+
getImageData(source: HTMLVideoElement | HTMLCanvasElement, sourceCropOffsetX: number, sourceCropOffsetY: number, sourceCropWidth: number, sourceCropHeight: number, targetWidth: number, targetHeight: number, reuseBufferIfPossible: Uint8ClampedArray | null): ImageData;
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface VideoToImageData {
|
|
2
|
+
getImageData(source: HTMLVideoElement | HTMLCanvasElement, sourceCropOffsetX: number, sourceCropOffsetY: number, sourceCropWidth: number, sourceCropHeight: number, targetWidth: number, targetHeight: number, reuseBufferIfPossible: Uint8ClampedArray | null): ImageData;
|
|
3
|
+
_type: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function createVideoToImageData(): VideoToImageData;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VideoToImageData } from "./video-to-image-data";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts single video frames as ImageData objects.
|
|
4
|
+
* Supports cropping and scaling.
|
|
5
|
+
**/
|
|
6
|
+
export declare class WebGLVideoToImageData implements VideoToImageData {
|
|
7
|
+
_type: string;
|
|
8
|
+
private readonly canvas;
|
|
9
|
+
private readonly gl;
|
|
10
|
+
private readonly program;
|
|
11
|
+
static isSupported(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* While WebGL easily allows us to read a video into a texture, there are no ready-to-use methods for
|
|
14
|
+
* scaling and cropping the texture to our desired size.
|
|
15
|
+
* Therefore, we write a custom shader that does this for us. It works by mapping the desired part of the texture
|
|
16
|
+
* onto a screen-filling quad.
|
|
17
|
+
* Adapted from https://stackoverflow.com/questions/52507592/how-to-scale-a-texture-in-webgl
|
|
18
|
+
*/
|
|
19
|
+
constructor();
|
|
20
|
+
getImageData(source: HTMLVideoElement | HTMLCanvasElement, sourceCropOffsetX: number, sourceCropOffsetY: number, sourceCropWidth: number, sourceCropHeight: number, targetWidth: number, targetHeight: number, reuseBufferIfPossible: Uint8ClampedArray | null): ImageData;
|
|
21
|
+
}
|
|
@@ -26,6 +26,7 @@ export declare class SelectionOverlayProps {
|
|
|
26
26
|
labelComponentConfig: {} | AROverlayBarcodeInfoConfig;
|
|
27
27
|
}
|
|
28
28
|
export default class AnimatedBarcodeSelectionOverlay extends React.Component<SelectionOverlayProps, any> {
|
|
29
|
+
container: HTMLDivElement;
|
|
29
30
|
constructor(props: SelectionOverlayProps);
|
|
30
31
|
update(finderRect: Frame, camera: ScanbotCameraView, originalImageSize: Size, codes: BarcodeScannerTypes.BarcodeItem[]): void;
|
|
31
32
|
onPolygonClick(model: BarcodeOverlay): void;
|
|
@@ -4,6 +4,7 @@ import { Size } from "../utils/dto/Size";
|
|
|
4
4
|
import { Frame } from "../utils/dto/Frame";
|
|
5
5
|
import { CameraInfo } from "../model/camera-info";
|
|
6
6
|
import { ScannerConfiguration } from "../model/configuration/scanner-configuration";
|
|
7
|
+
import { VideoToImageData } from "../utils/video-to-image-data/video-to-image-data";
|
|
7
8
|
export interface ScanbotCameraViewProps {
|
|
8
9
|
configuration?: ScannerConfiguration;
|
|
9
10
|
videoConstraints: MediaTrackConstraints;
|
|
@@ -21,7 +22,7 @@ export interface ScanbotCameraViewState {
|
|
|
21
22
|
export default class ScanbotCameraView extends React.Component<ScanbotCameraViewProps, ScanbotCameraViewState> {
|
|
22
23
|
video: HTMLVideoElement | null;
|
|
23
24
|
videoStream: VideoStream | null;
|
|
24
|
-
canvas:
|
|
25
|
+
canvas: VideoToImageData | null;
|
|
25
26
|
videoLoaded: boolean;
|
|
26
27
|
reloadCanvas: boolean;
|
|
27
28
|
swapCameraEnabled: boolean;
|
|
@@ -38,8 +39,13 @@ export default class ScanbotCameraView extends React.Component<ScanbotCameraView
|
|
|
38
39
|
zoom(): number;
|
|
39
40
|
private capture?;
|
|
40
41
|
private imageCapture;
|
|
42
|
+
private _reusableImageBuffer;
|
|
43
|
+
/**
|
|
44
|
+
* If set and the provided buffer has the correct size, `createImageData` will write the ImageData into this buffer.
|
|
45
|
+
* Otherwise, `createImageData` will create a new Buffer.
|
|
46
|
+
**/
|
|
47
|
+
set reusableImageBuffer(buffer: Uint8ClampedArray);
|
|
41
48
|
createImageData(maxLargerLength?: number, useImageCaptureAPI?: boolean): Promise<ImageData>;
|
|
42
|
-
drawVideoOnCanvasAndExtractFrameFromIt(frame: Frame): Promise<void>;
|
|
43
49
|
windowSize(): Frame;
|
|
44
50
|
/**
|
|
45
51
|
* The max size of the video frame that will be extracted from the video stream.
|
|
@@ -52,7 +58,7 @@ export default class ScanbotCameraView extends React.Component<ScanbotCameraView
|
|
|
52
58
|
coef: number;
|
|
53
59
|
};
|
|
54
60
|
calculateFrameSize(maxLargerLength: number, videoWidth: number, videoHeight: number): Size;
|
|
55
|
-
getCanvasRenderingContext():
|
|
61
|
+
getCanvasRenderingContext(): VideoToImageData;
|
|
56
62
|
releaseCanvas(): void;
|
|
57
63
|
componentWillUnmount(): void;
|
|
58
64
|
onStreamChanged: (stream: MediaStream) => void;
|