dynamsoft-capture-vision-react-native 2.4.2000-alpha.2 → 2.6.1002
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/LICENSE +5 -0
- package/README.md +32 -4
- package/android/build.gradle +1 -5
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraEnhancerModuleImpl.kt +73 -64
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewManagerImpl.kt +2 -18
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewModuleImpl.kt +49 -51
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNImageEditorView.kt +19 -0
- package/android/src/main/java/com/dynamsoft/reactnativelib/utils/ForDDN.kt +2 -0
- package/android/src/newarch/com/dynamsoft/reactnativelib/CameraViewManager.kt +6 -0
- package/dynamsoft-capture-vision-react-native.podspec +3 -5
- package/ios/CPP/RNDynamsoft+JSI.h +19 -0
- package/ios/CPP/RNDynamsoft+JSI.mm +145 -0
- package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/RNDynamsoft+Json.h +12 -5
- package/ios/{RNDynamsoftCaptureVision/CPP/RNDynamsoft+Json.mm → CPP/RNDynamsoft+Json.m} +6 -124
- package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCaptureVisionRouter.mm → RNDynamsoftCaptureVisionRouter.mm} +1 -0
- package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageEditorViewManager.mm → RNDynamsoftImageEditorViewManager.mm} +5 -1
- package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageManager.mm → RNDynamsoftImageManager.mm} +6 -2
- package/package.json +2 -2
- package/src/core/CapturedResultItem.tsx +18 -2
- package/src/core/CompletionListener.tsx +4 -3
- package/src/core/CoreModule.tsx +3 -3
- package/src/core/DSRect.tsx +28 -21
- package/src/core/EnumCaptureResultItemType.tsx +38 -7
- package/src/core/EnumColourChannelUsageType.tsx +25 -7
- package/src/core/EnumCrossVerificationStatus.tsx +43 -0
- package/src/core/EnumGrayscaleEnhancementMode.tsx +40 -7
- package/src/core/EnumGrayscaleTransformationMode.tsx +29 -5
- package/src/core/EnumPixelFormat.tsx +37 -32
- package/src/core/ImageData.tsx +51 -4
- package/src/core/ImageSourceAdapter.tsx +132 -72
- package/src/core/NativeDynamsoftImageSourceAdapterModule.tsx +24 -13
- package/src/core/Point.tsx +12 -9
- package/src/core/Quadrilateral.tsx +9 -5
- package/src/core/Rect.tsx +19 -16
- package/src/cvr/CaptureVisionRouter.tsx +571 -279
- package/src/cvr/CapturedResult.tsx +117 -76
- package/src/cvr/CapturedResultFilter.tsx +7 -0
- package/src/cvr/CapturedResultReceiver.tsx +59 -3
- package/src/cvr/EnumPresetTemplate.tsx +66 -1
- package/src/cvr/SimplifiedCaptureVisionSettings.tsx +45 -0
- package/src/dbr/BarcodeResultItem.tsx +31 -1
- package/src/dbr/DecodedBarcodesResult.tsx +18 -0
- package/src/dbr/EnumBarcodeFormat.tsx +61 -50
- package/src/dbr/EnumDeblurMode.tsx +28 -12
- package/src/dbr/EnumLocalizationMode.tsx +15 -1
- package/src/dbr/SimplifiedBarcodeReaderSettings.tsx +72 -12
- package/src/dce/CameraEnhancer.tsx +211 -89
- package/src/dce/CameraView.tsx +18 -1
- package/src/dce/DynamsoftCameraViewNativeComponent.ts +43 -0
- package/src/dce/EnumCameraPosition.tsx +3 -0
- package/src/dce/EnumDrawingLayerId.tsx +11 -0
- package/src/dce/EnumEnhancedFeatures.tsx +23 -7
- package/src/dce/EnumFocusMode.tsx +2 -0
- package/src/dce/FeedBack.tsx +9 -0
- package/src/dce/ImageEditorView.tsx +35 -2
- package/src/dcp/EnumMappingStatus.tsx +12 -3
- package/src/dcp/EnumValidationStatus.tsx +12 -3
- package/src/dcp/ParsedResult.tsx +16 -0
- package/src/dcp/ParsedResultItem.tsx +35 -0
- package/src/ddn/DetectedQuadResultItem.tsx +23 -0
- package/src/ddn/DetectedQuadsResult.tsx +20 -1
- package/src/ddn/EnumImageColourMode.tsx +9 -0
- package/src/ddn/NormalizedImageResultItem.tsx +25 -0
- package/src/ddn/NormalizedImagesResult.tsx +17 -1
- package/src/ddn/SimplifiedDocumentNormalizerSettings.tsx +38 -2
- package/src/dlr/CharacterResult.tsx +17 -0
- package/src/dlr/RecognizedTextLinesResult.tsx +23 -1
- package/src/dlr/SimplifiedLabelRecognizerSettings.tsx +21 -0
- package/src/dlr/TextLineResultItem.tsx +26 -0
- package/src/license/LicenseManager.tsx +19 -0
- package/src/utility/ImageManager.tsx +23 -0
- package/src/utility/MultiFrameResultCrossFilter.tsx +99 -6
- package/android/.gitignore +0 -4
- package/ios/ReactNativeDcv.xcodeproj/project.pbxproj +0 -390
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/DSImageData+HostObject.h +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/DSImageData+HostObject.mm +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/ImageDataHostObject.cpp +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/ImageDataHostObject.hpp +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/MutableRawBuffer.cpp +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/MutableRawBuffer.hpp +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/YeetJSIUtils.h +0 -0
- /package/ios/{RNDynamsoftCaptureVision/CPP → CPP}/YeetJSIUtils.mm +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCameraView.h → RNDynamsoftCameraView.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCameraView.m → RNDynamsoftCameraView.m} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCameraViewManager.h → RNDynamsoftCameraViewManager.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCameraViewManager.m → RNDynamsoftCameraViewManager.m} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftCaptureVisionRouter.h → RNDynamsoftCaptureVisionRouter.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageEditorView.h → RNDynamsoftImageEditorView.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageEditorView.m → RNDynamsoftImageEditorView.m} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageEditorViewManager.h → RNDynamsoftImageEditorViewManager.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageManager.h → RNDynamsoftImageManager.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageSourceAdapter.h → RNDynamsoftImageSourceAdapter.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftImageSourceAdapter.mm → RNDynamsoftImageSourceAdapter.mm} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftLicense.h → RNDynamsoftLicense.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftLicense.m → RNDynamsoftLicense.m} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftMultiCrossFilter.h → RNDynamsoftMultiCrossFilter.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftMultiCrossFilter.m → RNDynamsoftMultiCrossFilter.m} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftVersions.h → RNDynamsoftVersions.h} +0 -0
- /package/ios/{RNDynamsoftCaptureVision/RNDynamsoftVersions.m → RNDynamsoftVersions.m} +0 -0
|
@@ -3,20 +3,63 @@ import codegenNativeComponent from "react-native/Libraries/Utilities/codegenNati
|
|
|
3
3
|
import type {Int32} from "react-native/Libraries/Types/CodegenTypes";
|
|
4
4
|
|
|
5
5
|
export interface CameraViewNativeProps extends ViewProps {
|
|
6
|
+
/**
|
|
7
|
+
* CameraView has three default drawing layers corresponding to
|
|
8
|
+
* {@link EnumDrawingLayerId.DBR_LAYER_ID}/{@link EnumDrawingLayerId.DLR_LAYER_ID}/{@link EnumDrawingLayerId.DDN_LAYER_ID},
|
|
9
|
+
* they will draw the corresponding {@link DecodedBarcodesResult}/{@link RecognizedTextLinesResult}/{@link DetectedQuadsResult} or {@link NormalizedImagesResult} on the camera preview.
|
|
10
|
+
* If visibleLayerIds is undefined, all layer will be visible.
|
|
11
|
+
* If defined, only the DrawingLayer corresponding to the layerId in the array will be visible.
|
|
12
|
+
*
|
|
13
|
+
* @see EnumDrawingLayerId
|
|
14
|
+
* */
|
|
6
15
|
visibleLayerIds?: number[]
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set the visibility of the scan region mask.
|
|
19
|
+
* Only available when set a scan region to CameraEnhancer.
|
|
20
|
+
* Default is true.
|
|
21
|
+
* */
|
|
7
22
|
scanRegionMaskVisible?: boolean
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Set the visibility of the scan laser.
|
|
26
|
+
* Only available when set a scan region to CameraEnhancer.
|
|
27
|
+
* Default is false.
|
|
28
|
+
* */
|
|
8
29
|
scanLaserVisible?: boolean
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Add a torch button that can control the torch on your view.
|
|
33
|
+
* If you are using enhanced feature - {@link EnumEnhancedFeatures.EF_SMART_TORCH},
|
|
34
|
+
* the style of this torch button will be applied to the smart torch as well.
|
|
35
|
+
* */
|
|
9
36
|
torchButton?: {
|
|
37
|
+
/**
|
|
38
|
+
* Set the top-left point and width and height of the torch button.(All by px)
|
|
39
|
+
* */
|
|
10
40
|
location?: {
|
|
11
41
|
x?: Int32;
|
|
12
42
|
y?: Int32;
|
|
13
43
|
width?: Int32;
|
|
14
44
|
height?: Int32;
|
|
15
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Set the visibility of the torch button. Default is false.
|
|
48
|
+
* */
|
|
16
49
|
visible?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The torch button image that you want to display when the torch is on.
|
|
52
|
+
* */
|
|
17
53
|
torchOnImageBase64?: string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The torch button image that you want to display when the torch is off.
|
|
57
|
+
* */
|
|
18
58
|
torchOffImageBase64?: string;
|
|
19
59
|
};
|
|
60
|
+
/**
|
|
61
|
+
* Set the visibility of the torch button. Default is false.
|
|
62
|
+
* */
|
|
20
63
|
torchButtonVisible?: boolean
|
|
21
64
|
}
|
|
22
65
|
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
export enum EnumDrawingLayerId {
|
|
2
|
+
/**
|
|
3
|
+
* The preset DrawingLayer of Dynamsoft Document Normalizer.
|
|
4
|
+
* */
|
|
2
5
|
DDN_LAYER_ID = 1,
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The preset DrawingLayer of Dynamsoft Barcode Reader.
|
|
9
|
+
* */
|
|
3
10
|
DBR_LAYER_ID = 2,
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The preset DrawingLayer of Dynamsoft Label Recognizer.
|
|
14
|
+
* */
|
|
4
15
|
DLR_LAYER_ID = 3,
|
|
5
16
|
TIP_LAYER_ID = 999
|
|
6
17
|
}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enumeration EnhancedFeatures indicates the advanced features of Dynamsoft Camera Enhancer.
|
|
3
|
+
* */
|
|
1
4
|
export enum EnumEnhancedFeatures {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `Frame Filter`: The frame sharpness filter feature of DCE. By enabling this feature, the low-quality frame will be recognized and discarded automatically.
|
|
7
|
+
* */
|
|
8
|
+
EF_FRAME_FILTER = 1,
|
|
9
|
+
|
|
10
|
+
/**`Sensor Control`: The sensor filter feature of DCE. By enabling this feature, the frames will be discarded automatically while the device is shaking.*/
|
|
11
|
+
EF_SENSOR_CONTROL = 2,
|
|
12
|
+
|
|
13
|
+
/**`Enhanced Focus`: The enhanced focus feature. DCE will support the camera in triggering auto-focus.*/
|
|
14
|
+
EF_ENHANCED_FOCUS = 4,
|
|
15
|
+
EF_FAST_MODE = 8,
|
|
16
|
+
|
|
17
|
+
/**`Auto Zoom`: The auto-zoom feature of DCE. By enabling this feature, the camera will automatically zoom in to the interest area.*/
|
|
18
|
+
EF_AUTO_ZOOM = 16,
|
|
19
|
+
|
|
20
|
+
/**`Smart Torch`: Add a smart torch on the UI. The torch will be hided when the environment brightness is high and displayed when the brightness is low.*/
|
|
21
|
+
EF_SMART_TORCH = 32,
|
|
22
|
+
|
|
23
|
+
/**Enable all.*/
|
|
24
|
+
EF_ALL = 63
|
|
9
25
|
}
|
package/src/dce/FeedBack.tsx
CHANGED
|
@@ -7,11 +7,20 @@ const DynamsoftCameraEnhancerModule = isTurboModuleEnabled ?
|
|
|
7
7
|
require("./NativeDynamsoftCameraViewModule").default :
|
|
8
8
|
NativeModules.DynamsoftCameraView;
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* The Feedback class provides methods to trigger feedbacks from the hardware, such as vibrate and beep.
|
|
12
|
+
* */
|
|
10
13
|
export class FeedBack {
|
|
14
|
+
/**
|
|
15
|
+
* Trigger a beep.
|
|
16
|
+
* */
|
|
11
17
|
static beep(): void {
|
|
12
18
|
DynamsoftCameraEnhancerModule.beep();
|
|
13
19
|
}
|
|
14
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Trigger a vibrate.
|
|
23
|
+
* */
|
|
15
24
|
static vibrate(): void {
|
|
16
25
|
DynamsoftCameraEnhancerModule.vibrate();
|
|
17
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React, {Component, createElement} from "react";
|
|
2
3
|
import {
|
|
3
4
|
findNodeHandle,
|
|
4
5
|
type HostComponent,
|
|
@@ -40,14 +41,28 @@ declare var global: {
|
|
|
40
41
|
|
|
41
42
|
type RefType = React.Component<ImageEditorViewNativeProps> & Readonly<NativeMethods>;
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* The ImageEditorView class is a React Component for image editing that wraps the native ImageEditorView.
|
|
46
|
+
* It encapsulates interactions with the native view and provides functionality
|
|
47
|
+
* to set images and edit quadrilaterals.
|
|
48
|
+
* @prop CameraViewNativeProps
|
|
49
|
+
* @see CameraViewNativeProps
|
|
50
|
+
* @see CameraEnhancer.setCameraView
|
|
51
|
+
*/
|
|
43
52
|
export class ImageEditorView extends Component<ImageEditorViewNativeProps, any> {
|
|
53
|
+
// A Ref object pointing to the native ImageEditorView
|
|
44
54
|
private readonly nativeImageEditorViewRef: React.RefObject<RefType> = React.createRef<RefType>();
|
|
55
|
+
private drawingQuads: Array<Quadrilateral> | null | undefined;
|
|
45
56
|
|
|
46
57
|
/** @internal */
|
|
47
58
|
public get nativeCameraViewHandle(): number | null {
|
|
48
59
|
return findNodeHandle(this.nativeImageEditorViewRef.current);
|
|
49
60
|
}
|
|
50
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Sets the original image in the native image editor.
|
|
64
|
+
* @param imageData The {@link ImageData} Object to be set as the original image.
|
|
65
|
+
*/
|
|
51
66
|
public setOriginalImage(imageData: ImageData) {
|
|
52
67
|
installMethods();
|
|
53
68
|
if (this.nativeCameraViewHandle != null) {
|
|
@@ -55,15 +70,32 @@ export class ImageEditorView extends Component<ImageEditorViewNativeProps, any>
|
|
|
55
70
|
}
|
|
56
71
|
}
|
|
57
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Updates the quadrilaterals in the editor for a specific drawing layer.
|
|
75
|
+
* @param quads The quadrilaterals to set, or null/undefined to clear them. The coordinate base of the point is "image".
|
|
76
|
+
* @param layerId The ID of the drawing layer to update.
|
|
77
|
+
* @returns A promise that resolves once the operation completes.
|
|
78
|
+
*/
|
|
58
79
|
public async setQuads(quads: Quadrilateral[] | null | undefined, layerId: EnumDrawingLayerId | number): Promise<void> {
|
|
59
80
|
if (this.nativeCameraViewHandle != null) {
|
|
81
|
+
this.drawingQuads = quads;
|
|
60
82
|
await ImageEditorViewModule.setQuads(this.nativeCameraViewHandle!, quads, layerId);
|
|
61
83
|
}
|
|
62
84
|
}
|
|
63
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Retrieves the currently selected quadrilateral from the editor.
|
|
88
|
+
* @returns A promise that resolves to the selected quadrilateral, or first Quadrilateral if none is selected.
|
|
89
|
+
*/
|
|
64
90
|
public async getSelectedQuad(): Promise<Quadrilateral | null> {
|
|
65
91
|
if (this.nativeCameraViewHandle != null) {
|
|
66
|
-
|
|
92
|
+
let selectedQuad = await ImageEditorViewModule.getSelectedQuad(this.nativeCameraViewHandle!);
|
|
93
|
+
if(selectedQuad) {
|
|
94
|
+
return selectedQuad;
|
|
95
|
+
} else if(this.drawingQuads && this.drawingQuads.length > 0) {
|
|
96
|
+
selectedQuad = this.drawingQuads[0]
|
|
97
|
+
}
|
|
98
|
+
return selectedQuad;
|
|
67
99
|
} else {
|
|
68
100
|
return null;
|
|
69
101
|
}
|
|
@@ -73,6 +105,7 @@ export class ImageEditorView extends Component<ImageEditorViewNativeProps, any>
|
|
|
73
105
|
return (
|
|
74
106
|
<View style={[styles.blackBg, this.props?.style]}>
|
|
75
107
|
<NativeImageEditorView
|
|
108
|
+
collapsable={false}
|
|
76
109
|
style={StyleSheet.absoluteFill}
|
|
77
110
|
ref={this.nativeImageEditorViewRef}
|
|
78
111
|
/>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `MappingStatus` represents the outcome of a mapping operation on a field.
|
|
3
|
+
* @see ParsedField.validationStatus
|
|
4
|
+
* */
|
|
1
5
|
export enum EnumMappingStatus {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
/** The field has no mapping specified. */
|
|
7
|
+
MS_NONE,
|
|
8
|
+
|
|
9
|
+
/** Find a mapping for the field value. */
|
|
10
|
+
MS_SUCCEEDED,
|
|
11
|
+
|
|
12
|
+
/** Failed to find a mapping for the field value. */
|
|
13
|
+
MS_FAILED
|
|
5
14
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ValidationStatus` describes the outcome of a validation process on a field.
|
|
3
|
+
* @see ParsedField.mappingStatus
|
|
4
|
+
* */
|
|
1
5
|
export enum EnumValidationStatus {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
/** The field has no validation specified. */
|
|
7
|
+
VS_NONE,
|
|
8
|
+
|
|
9
|
+
/** The validation for the field has been succeeded. */
|
|
10
|
+
VS_SUCCEEDED,
|
|
11
|
+
|
|
12
|
+
/** The validation for the field has been succeeded. */
|
|
13
|
+
VS_FAILED
|
|
5
14
|
}
|
package/src/dcp/ParsedResult.tsx
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import type {ParsedResultItem} from "./ParsedResultItem";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The ParsedResult interface provides a structure representing the result object returned by Dynamsoft Code Parser.
|
|
5
|
+
* @see CapturedResultReceiver.onParsedResultsReceived
|
|
6
|
+
* */
|
|
3
7
|
export interface ParsedResult {
|
|
8
|
+
/**
|
|
9
|
+
* A unique identifier or hash of the original image from which the barcodes were decoded. It can be used to associate the result with a specific input image.
|
|
10
|
+
* @see IntermediateResultManager.getOriginalImage
|
|
11
|
+
* */
|
|
4
12
|
originalImageHashId: string;
|
|
13
|
+
|
|
14
|
+
/**An array that contains all {@link ParsedResultItem}s.
|
|
15
|
+
* @see ParsedResultItem
|
|
16
|
+
* */
|
|
5
17
|
items?: Array<ParsedResultItem>;
|
|
18
|
+
|
|
19
|
+
/**The error code of the parsing operation., if an error occurred.*/
|
|
6
20
|
errorCode: number;
|
|
21
|
+
|
|
22
|
+
/**The error message of parsing operation., if an error occurred.*/
|
|
7
23
|
errorMessage?: string;
|
|
8
24
|
}
|
|
@@ -2,14 +2,49 @@ import type {CapturedResultItem} from "../core/CapturedResultItem";
|
|
|
2
2
|
import type {EnumMappingStatus} from "./EnumMappingStatus";
|
|
3
3
|
import type {EnumValidationStatus} from "./EnumValidationStatus";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The ParsedResultItem interface provides a structure representing the result items returned by Dynamsoft Code Parser.
|
|
7
|
+
* @see EnumCapturedResultItemType.CRIT_PARSED_RESULT
|
|
8
|
+
* */
|
|
5
9
|
export interface ParsedResultItem extends CapturedResultItem{
|
|
10
|
+
/**
|
|
11
|
+
* The code type of the parsed result.
|
|
12
|
+
* */
|
|
6
13
|
codeType: string
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The parsed result as a JSON formatted string.
|
|
17
|
+
* */
|
|
7
18
|
jsonString: string
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional fields containing parsed data. Each field represents a specific component
|
|
22
|
+
* of the parsed code, such as a value, mapping status, or validation status.
|
|
23
|
+
* The key is the field name, and the value is an object containing additional details.
|
|
24
|
+
*/
|
|
8
25
|
parsedFields?: Record<string, ParsedField>
|
|
9
26
|
}
|
|
10
27
|
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The ParsedField interface defines the structure for individual parsed fields within a ParsedResultItem.
|
|
31
|
+
* It provides information about the field value and its statuses.
|
|
32
|
+
*/
|
|
11
33
|
export interface ParsedField {
|
|
34
|
+
/**
|
|
35
|
+
* The value of the parsed field as a string. This represents the extracted data for the field.
|
|
36
|
+
*/
|
|
12
37
|
value?: string,
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The mapping status of the field.
|
|
41
|
+
* @see EnumMappingStatus
|
|
42
|
+
*/
|
|
13
43
|
mappingStatus?: EnumMappingStatus | number,
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The validation status of the field.
|
|
47
|
+
* @see EnumValidationStatus
|
|
48
|
+
* */
|
|
14
49
|
validationStatus?: EnumValidationStatus | number
|
|
15
50
|
}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import type {CapturedResultItem} from "../core/CapturedResultItem";
|
|
2
2
|
import type {Quadrilateral} from "../core/Quadrilateral";
|
|
3
|
+
import type {EnumCrossVerificationStatus} from "../core/EnumCrossVerificationStatus";
|
|
3
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The DetectedQuadResultItem interface extends the {@link CapturedResultItem} interface and represents a detected quadrilateral result item.
|
|
7
|
+
* @see EnumCapturedResultItemType.CRIT_DETECTED_QUAD
|
|
8
|
+
* @see DetectedQuadsResult
|
|
9
|
+
* */
|
|
4
10
|
export interface DetectedQuadResultItem extends CapturedResultItem {
|
|
11
|
+
/**
|
|
12
|
+
* The location of the detected quadrilateral within the original image, represented as a quadrilateral shape.
|
|
13
|
+
* @see Quadrilateral
|
|
14
|
+
* */
|
|
5
15
|
location: Quadrilateral;
|
|
16
|
+
/**A confidence score measuring the certainty that the detected quadrilateral represents the boundary of a document.*/
|
|
6
17
|
confidenceAsDocumentBoundary: number;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The cross verification status of type {@link EnumCrossVerificationStatus}.
|
|
21
|
+
*
|
|
22
|
+
* @remarks If {@link CaptureVisionRouter} doesn't add {@link MultiFrameResultCrossFilter} via {@link CaptureVisionRouter.addFilter}
|
|
23
|
+
* or added {@link MultiFrameResultCrossFilter} doesn't enable verification for the corresponding type,
|
|
24
|
+
* the crossVerificationStatus property of the item for that type will always remain {@link CVS_NOT_VERIFIED}.
|
|
25
|
+
*
|
|
26
|
+
* @see EnumCrossVerificationStatus
|
|
27
|
+
* @see MultiFrameResultCrossFilter.enableResultCrossVerification
|
|
28
|
+
* */
|
|
29
|
+
crossVerificationStatus: EnumCrossVerificationStatus | number
|
|
7
30
|
}
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import type {DetectedQuadResultItem} from "./DetectedQuadResultItem";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The DetectedQuadsResult interface holds information on detected quadrilaterals,
|
|
5
|
+
* of type {@link DetectedQuadResultItem}, within an image.
|
|
6
|
+
* @see CapturedResultReceiver.onDetectedQuadsReceived
|
|
7
|
+
* */
|
|
3
8
|
export interface DetectedQuadsResult {
|
|
9
|
+
/**
|
|
10
|
+
* The hash ID of the original image.
|
|
11
|
+
* @see IntermediateResultManager.getOriginalImage
|
|
12
|
+
* */
|
|
4
13
|
originalImageHashId: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An array of {@link DetectedQuadResultItem} objects, each representing a detected quadrilateral within the original image.
|
|
17
|
+
* */
|
|
5
18
|
items?: Array<DetectedQuadResultItem>;
|
|
19
|
+
|
|
20
|
+
/**The error code of the barcode reading result, if an error occurred.*/
|
|
6
21
|
errorCode: number;
|
|
7
|
-
|
|
22
|
+
|
|
23
|
+
/**The error message of the barcode reading result, if an error occurred.*/
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
|
|
26
|
+
/**the rotation transformation matrix of the original image relative to the rotated image.*/
|
|
8
27
|
rotationTransformMatrix: Array<number>;
|
|
9
28
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `ImageColourMode` describes the output colour mode of the normalized image.
|
|
3
|
+
* @see SimplifiedDocumentNormalizerSettings.colourMode
|
|
4
|
+
* */
|
|
1
5
|
export enum EnumImageColourMode {
|
|
6
|
+
/** Output image in colour mode. */
|
|
2
7
|
ICM_COLOUR,
|
|
8
|
+
|
|
9
|
+
/** Output image in grayscale mode. */
|
|
3
10
|
ICM_GRAYSCALE,
|
|
11
|
+
|
|
12
|
+
/** Output image in binary mode. */
|
|
4
13
|
ICM_BINARY
|
|
5
14
|
}
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import type {CapturedResultItem} from "../core/CapturedResultItem";
|
|
2
2
|
import type {ImageData} from "../core/ImageData";
|
|
3
3
|
import type {Quadrilateral} from "../core/Quadrilateral";
|
|
4
|
+
import type {EnumCrossVerificationStatus} from "../core/EnumCrossVerificationStatus";
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The NormalizedImageResultItem interface extends the CapturedResultItem interface and represents a normalized image result item.
|
|
8
|
+
* @see NormalizedImagesResult
|
|
9
|
+
* @see EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE
|
|
10
|
+
* */
|
|
5
11
|
export interface NormalizedImageResultItem extends CapturedResultItem {
|
|
12
|
+
/**
|
|
13
|
+
* The location where the normalized image was extracted from within the original image, represented as a quadrilateral.
|
|
14
|
+
* @see Quadrilateral
|
|
15
|
+
* */
|
|
6
16
|
location: Quadrilateral;
|
|
17
|
+
|
|
18
|
+
/**The image data for the normalized image result.
|
|
19
|
+
* @see ImageData*/
|
|
7
20
|
imageData: ImageData;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The cross verification status of type {@link EnumCrossVerificationStatus}.
|
|
24
|
+
*
|
|
25
|
+
* @remarks If {@link CaptureVisionRouter} doesn't add {@link MultiFrameResultCrossFilter} via {@link CaptureVisionRouter.addFilter}
|
|
26
|
+
* or added {@link MultiFrameResultCrossFilter} doesn't enable verification for the corresponding type,
|
|
27
|
+
* the crossVerificationStatus property of the item for that type will always remain {@link CVS_NOT_VERIFIED}.
|
|
28
|
+
*
|
|
29
|
+
* @see EnumCrossVerificationStatus
|
|
30
|
+
* @see MultiFrameResultCrossFilter.enableResultCrossVerification
|
|
31
|
+
* */
|
|
32
|
+
crossVerificationStatus: EnumCrossVerificationStatus | number
|
|
8
33
|
}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import type {NormalizedImageResultItem} from "./NormalizedImageResultItem";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The NormalizedImagesResult interface holds information on normalized images, of type NormalizedImageResultItem, derived from an original image.
|
|
5
|
+
* @see CapturedResultReceiver.onNormalizedImagesReceived
|
|
6
|
+
* */
|
|
3
7
|
export interface NormalizedImagesResult {
|
|
8
|
+
/**
|
|
9
|
+
* The hash ID of the original image.
|
|
10
|
+
* @see IntermediateResultManager.getOriginalImage
|
|
11
|
+
* */
|
|
4
12
|
originalImageHashId: string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* An array of {@link NormalizedImageResultItem} objects, each representing a piece of the original image after normalization.
|
|
16
|
+
* */
|
|
5
17
|
items?: Array<NormalizedImageResultItem>;
|
|
18
|
+
|
|
19
|
+
/**The error code of the barcode reading result, if an error occurred.*/
|
|
6
20
|
errorCode: number;
|
|
7
|
-
|
|
21
|
+
|
|
22
|
+
/**The error message of the barcode reading result, if an error occurred.*/
|
|
23
|
+
errorMessage?: string;
|
|
8
24
|
}
|
|
@@ -2,13 +2,49 @@ import type {EnumGrayscaleEnhancementMode} from "../core/EnumGrayscaleEnhancemen
|
|
|
2
2
|
import type {EnumGrayscaleTransformationMode} from "../core/EnumGrayscaleTransformationMode";
|
|
3
3
|
import type {EnumImageColourMode} from "./EnumImageColourMode";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* This interface defines simplified settings for document normalizer tasks.
|
|
7
|
+
* @see SimplifiedCaptureVisionSettings.documentSettings
|
|
8
|
+
* */
|
|
5
9
|
export interface SimplifiedDocumentNormalizerSettings {
|
|
10
|
+
/**
|
|
11
|
+
* Set the grayscale transformation modes with an array of enumeration GrayscaleTransformationMode.
|
|
12
|
+
* View the reference page of GrayscaleTransformationModes for more detail about grayscale transformation modes.
|
|
13
|
+
* @see EnumGrayscaleTransformationMode
|
|
14
|
+
* */
|
|
6
15
|
grayscaleTransformationModes?: Int32Array | Array<EnumGrayscaleTransformationMode>
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set the grayscale enhancement modes with an array of enumeration GrayscaleEnhancementMode.
|
|
19
|
+
* View the reference page of GrayscaleEnhancementModes for more detail about grayscale enhancement modes.
|
|
20
|
+
* @see EnumGrayscaleEnhancementMode
|
|
21
|
+
* */
|
|
7
22
|
grayscaleEnhancementModes?: Int32Array | Array<EnumGrayscaleEnhancementMode>
|
|
8
|
-
|
|
9
|
-
|
|
23
|
+
|
|
24
|
+
/**Sets the page size (width and height in pixels) of the normalized image.*/
|
|
25
|
+
pageSize?: [number, number]
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Sets the colour mode of the normalized image with enumeration ImageColourMode. View the reference page of ImageColourMode for more detail about colour mode.
|
|
29
|
+
* @see EnumImageColourMode
|
|
30
|
+
* */
|
|
31
|
+
colourMode?: number | EnumImageColourMode
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Sets the brightness of the normalized image. The value range is [-100,100].
|
|
35
|
+
* */
|
|
10
36
|
brightness?: number
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the contrast of the normalized image. The value range is [-100,100].
|
|
40
|
+
* */
|
|
11
41
|
contrast?: number
|
|
12
42
|
maxThreadsInOneTask?: number
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Set the threshold for scaling down the input image during document detection.
|
|
46
|
+
* If the shorter edge size of the image is larger than this threshold,the original may be scaled down to reduce processing time.
|
|
47
|
+
* The default value is 2300.
|
|
48
|
+
* */
|
|
13
49
|
scaleDownThreshold?: number
|
|
14
50
|
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* The CharacterResult interface represents the result of a character recognition process.
|
|
4
|
+
* It contains the characters recognized (high, medium, and low confidence),
|
|
5
|
+
* their respective confidences, and the location of the character in a quadrilateral shape.
|
|
6
|
+
* */
|
|
1
7
|
export interface CharacterResult {
|
|
8
|
+
/**The character with high confidence.*/
|
|
2
9
|
characterH: string;
|
|
10
|
+
|
|
11
|
+
/**The character with medium confidence.*/
|
|
3
12
|
characterM: string;
|
|
13
|
+
|
|
14
|
+
/**The character with low confidence.*/
|
|
4
15
|
characterL: string;
|
|
16
|
+
|
|
17
|
+
/**The confidence of the character with high confidence.*/
|
|
5
18
|
characterHConfidence: number;
|
|
19
|
+
|
|
20
|
+
/**The confidence of the character with medium confidence.*/
|
|
6
21
|
characterMConfidence: number;
|
|
22
|
+
|
|
23
|
+
/**The confidence of the character with low confidence.*/
|
|
7
24
|
characterLConfidence: number;
|
|
8
25
|
}
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import type {TextLineResultItem} from "./TextLineResultItem";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The RecognizedTextLinesResult interface represents the result of a text recognition process.
|
|
5
|
+
* It provides access to information about the recognized text lines,
|
|
6
|
+
* the original image, and any errors that occurred during the recognition process.
|
|
7
|
+
*
|
|
8
|
+
* @see CapturedResultReceiver.onRecognizedTextLinesReceived
|
|
9
|
+
* */
|
|
3
10
|
export interface RecognizedTextLinesResult {
|
|
11
|
+
/**
|
|
12
|
+
* The hash ID of the original image.
|
|
13
|
+
* @see IntermediateResultManager.getOriginalImage
|
|
14
|
+
* */
|
|
4
15
|
originalImageHashId: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* All the recognized text line result items.
|
|
19
|
+
* @see TextLineResultItem
|
|
20
|
+
* */
|
|
5
21
|
items?: Array<TextLineResultItem>;
|
|
22
|
+
|
|
23
|
+
/**The error code of the barcode reading result, if an error occurred.*/
|
|
6
24
|
errorCode: number;
|
|
7
|
-
|
|
25
|
+
|
|
26
|
+
/**The error message of the barcode reading result, if an error occurred.*/
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
|
|
29
|
+
/**the rotation transformation matrix of the original image relative to the rotated image.*/
|
|
8
30
|
rotationTransformMatrix: Array<number>;
|
|
9
31
|
}
|
|
@@ -1,11 +1,32 @@
|
|
|
1
1
|
import {EnumGrayscaleTransformationMode} from "../core/EnumGrayscaleTransformationMode";
|
|
2
2
|
import {EnumGrayscaleEnhancementMode} from "../core/EnumGrayscaleEnhancementMode";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* The SimplifiedLabelRecognizerSettings interface defines simplified settings for label recognizing.
|
|
6
|
+
* @see SimplifiedCaptureVisionSettings.labelSettings
|
|
7
|
+
* */
|
|
4
8
|
export interface SimplifiedLabelRecognizerSettings {
|
|
9
|
+
/**
|
|
10
|
+
* Set the grayscale transformation modes with an array of enumeration GrayscaleTransformationMode.
|
|
11
|
+
* View the reference page of GrayscaleTransformationModes for more detail about grayscale transformation modes.
|
|
12
|
+
* @see EnumGrayscaleTransformationMode
|
|
13
|
+
* */
|
|
5
14
|
grayscaleTransformationModes?: Int32Array | Array<EnumGrayscaleTransformationMode>
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Set the grayscale enhancement modes with an array of enumeration GrayscaleEnhancementMode.
|
|
18
|
+
* View the reference page of GrayscaleEnhancementModes for more detail about grayscale enhancement modes.
|
|
19
|
+
* @see EnumGrayscaleEnhancementMode
|
|
20
|
+
* */
|
|
6
21
|
grayscaleEnhancementModes?: Int32Array | Array<EnumGrayscaleEnhancementMode>
|
|
22
|
+
|
|
23
|
+
/**Specifies a character model by its name.*/
|
|
7
24
|
characterModelName?: string
|
|
25
|
+
|
|
26
|
+
/**Sets the RegEx pattern of the text line string to filter out the unqualified results.*/
|
|
8
27
|
lineStringRegExPattern?: string
|
|
28
|
+
|
|
29
|
+
/**Sets the threshold value that determines when the original image is scaled down.*/
|
|
9
30
|
scaleDownThreshold?: number
|
|
10
31
|
maxThreadsInOneTask?: number
|
|
11
32
|
}
|
|
@@ -2,10 +2,36 @@ import type {CapturedResultItem} from "../core/CapturedResultItem";
|
|
|
2
2
|
import type {Quadrilateral} from "../core/Quadrilateral";
|
|
3
3
|
import type {CharacterResult} from "./CharacterResult";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The TextLineResultItem interface represents a text line result item recognized by the library.
|
|
7
|
+
*
|
|
8
|
+
* @see EnumCapturedResultItemType.CRIT_TEXT_LINE
|
|
9
|
+
* @see RecognizedTextLinesResult
|
|
10
|
+
* */
|
|
5
11
|
export interface TextLineResultItem extends CapturedResultItem {
|
|
12
|
+
/**
|
|
13
|
+
* The location of the text line in the form of a quadrilateral.
|
|
14
|
+
* @see Quadrilateral
|
|
15
|
+
* */
|
|
6
16
|
location: Quadrilateral;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The text content of the text line.
|
|
20
|
+
* */
|
|
7
21
|
text: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The confidence of the text line recognition result.
|
|
25
|
+
* */
|
|
8
26
|
confidence: number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* All the characters in the text line.
|
|
30
|
+
* */
|
|
9
31
|
characterResults: CharacterResult[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The name of the text line specification that generated this element.
|
|
35
|
+
* */
|
|
10
36
|
specificationName:string;
|
|
11
37
|
}
|