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,102 +3,143 @@ import type {BarcodeResultItem, DecodedBarcodesResult} from "../dbr";
|
|
|
3
3
|
import type {ParsedResult, ParsedResultItem} from "../dcp";
|
|
4
4
|
import type {RecognizedTextLinesResult, TextLineResultItem} from "../dlr";
|
|
5
5
|
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
DetectedQuadResultItem,
|
|
7
|
+
DetectedQuadsResult,
|
|
8
|
+
NormalizedImageResultItem,
|
|
9
|
+
NormalizedImagesResult
|
|
10
10
|
} from "../ddn";
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The CapturedResult interface describes the basic structure of a result object returned by Dynamsoft Capture Vision Router({@link CaptureVisionRouter}).
|
|
14
|
+
*
|
|
15
|
+
* @remarks Depending on the functional module that generated the result item, the interface may vary:
|
|
16
|
+
* - dynamsoft-barcode-reader: {@link DecodedBarcodesResult}
|
|
17
|
+
* - dynamsoft-label-recognizer: {@link RecognizedTextLinesResult}
|
|
18
|
+
* - dynamsoft-document-normalizer: {@link DetectedQuadsResult} or {@link NormalizedImagesResult}
|
|
19
|
+
* - dynamsoft-code-parser: {@link ParsedResult}
|
|
20
|
+
*
|
|
21
|
+
* @see CapturedResultReceiver.onCapturedResultReceived
|
|
22
|
+
* */
|
|
12
23
|
export interface CapturedResult {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The hash ID of the original image.
|
|
26
|
+
* @see IntermediateResultManager.getOriginalImage
|
|
27
|
+
* */
|
|
28
|
+
originalImageHashId: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* An array of CapturedResultItem objects representing the captured result items.
|
|
32
|
+
* */
|
|
33
|
+
items?: Array<CapturedResultItem>;
|
|
34
|
+
|
|
35
|
+
/**Error code associated with the capture result.*/
|
|
36
|
+
errorCode: number;
|
|
37
|
+
|
|
38
|
+
/**Error string providing details about the error.*/
|
|
39
|
+
errorMessage: string;
|
|
40
|
+
|
|
41
|
+
/**the rotation transformation matrix of the original image relative to the rotated image.*/
|
|
42
|
+
rotationTransformMatrix: Array<number>;
|
|
43
|
+
|
|
44
|
+
/**Get a {@link DecodedBarcodesResult} object that contains all the {@link BarcodeResultItem} in this CapturedResult.*/
|
|
45
|
+
decodedBarcodesResult?: DecodedBarcodesResult;
|
|
46
|
+
|
|
47
|
+
/**Get a {@link RecognizedTextLinesResult} object that contains all the {@link TextLineResultItem} in this CapturedResult.*/
|
|
48
|
+
recognizedTextLinesResult?: RecognizedTextLinesResult;
|
|
49
|
+
|
|
50
|
+
/**Get a {@link DetectedQuadsResult} object that contains all the {@link DetectedQuadResultItem} in this CapturedResult.*/
|
|
51
|
+
detectedQuadsResult?: DetectedQuadsResult;
|
|
52
|
+
|
|
53
|
+
/**Get a {@link NormalizedImagesResult} object that contains all the {@link NormalizedImageResultItem} in this CapturedResult.*/
|
|
54
|
+
normalizedImagesResult?: NormalizedImagesResult;
|
|
55
|
+
|
|
56
|
+
/**Get a {@link ParsedResult} object that contains all the {@link ParsedResultItem} in this CapturedResult.*/
|
|
57
|
+
parsedResult?: ParsedResult;
|
|
23
58
|
}
|
|
24
59
|
|
|
60
|
+
/**@internal*/
|
|
25
61
|
export function _populateResults(result: CapturedResult | null | undefined) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
62
|
+
if (result) {
|
|
63
|
+
result.decodedBarcodesResult = getDecodedBarcodesResult(result)
|
|
64
|
+
result.recognizedTextLinesResult = getRecognizedTextLinesResult(result)
|
|
65
|
+
result.detectedQuadsResult = getDetectedQuadsResult(result)
|
|
66
|
+
result.normalizedImagesResult = getNormalizedImagesResult(result)
|
|
67
|
+
result.parsedResult = getParsedResult(result)
|
|
68
|
+
}
|
|
33
69
|
}
|
|
34
70
|
|
|
35
71
|
|
|
72
|
+
/**@internal*/
|
|
36
73
|
function getDecodedBarcodesResult(result: CapturedResult): DecodedBarcodesResult {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
74
|
+
return {
|
|
75
|
+
originalImageHashId: result.originalImageHashId,
|
|
76
|
+
errorCode: result.errorCode,
|
|
77
|
+
errorMessage: result.errorMessage,
|
|
78
|
+
rotationTransformMatrix: result.rotationTransformMatrix,
|
|
79
|
+
items: result.items?.filter(item => {
|
|
80
|
+
return item.type == EnumCapturedResultItemType.CRIT_BARCODE
|
|
81
|
+
}).map(item => {
|
|
82
|
+
return item as BarcodeResultItem
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
} as DecodedBarcodesResult;
|
|
49
86
|
}
|
|
50
87
|
|
|
88
|
+
/**@internal*/
|
|
51
89
|
function getRecognizedTextLinesResult(result: CapturedResult): RecognizedTextLinesResult {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
90
|
+
return {
|
|
91
|
+
originalImageHashId: result.originalImageHashId,
|
|
92
|
+
errorCode: result.errorCode,
|
|
93
|
+
errorString: result.errorMessage,
|
|
94
|
+
rotationTransformMatrix: result.rotationTransformMatrix,
|
|
95
|
+
items: result.items?.filter(item => {
|
|
96
|
+
return item.type == EnumCapturedResultItemType.CRIT_TEXT_LINE
|
|
97
|
+
}).map(item => {
|
|
98
|
+
return item as TextLineResultItem
|
|
99
|
+
})
|
|
100
|
+
} as RecognizedTextLinesResult;
|
|
63
101
|
}
|
|
64
102
|
|
|
103
|
+
/**@internal*/
|
|
65
104
|
function getDetectedQuadsResult(result: CapturedResult): DetectedQuadsResult {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
105
|
+
return {
|
|
106
|
+
originalImageHashId: result.originalImageHashId,
|
|
107
|
+
errorCode: result.errorCode,
|
|
108
|
+
errorString: result.errorMessage,
|
|
109
|
+
rotationTransformMatrix: result.rotationTransformMatrix,
|
|
110
|
+
items: result.items?.filter(item => {
|
|
111
|
+
return item.type == EnumCapturedResultItemType.CRIT_DETECTED_QUAD
|
|
112
|
+
}).map(item => {
|
|
113
|
+
return item as DetectedQuadResultItem
|
|
114
|
+
})
|
|
115
|
+
} as DetectedQuadsResult;
|
|
77
116
|
}
|
|
78
117
|
|
|
118
|
+
/**@internal*/
|
|
79
119
|
function getNormalizedImagesResult(result: CapturedResult): NormalizedImagesResult {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
120
|
+
return {
|
|
121
|
+
originalImageHashId: result.originalImageHashId,
|
|
122
|
+
errorCode: result.errorCode,
|
|
123
|
+
errorString: result.errorMessage,
|
|
124
|
+
rotationTransformMatrix: result.rotationTransformMatrix,
|
|
125
|
+
items: result.items?.filter(item => {
|
|
126
|
+
return item.type == EnumCapturedResultItemType.CRIT_NORMALIZED_IMAGE
|
|
127
|
+
}).map(item => {
|
|
128
|
+
return item as NormalizedImageResultItem
|
|
129
|
+
})
|
|
130
|
+
} as NormalizedImagesResult;
|
|
91
131
|
}
|
|
92
132
|
|
|
133
|
+
/**@internal*/
|
|
93
134
|
function getParsedResult(result: CapturedResult): ParsedResult {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
135
|
+
return {
|
|
136
|
+
originalImageHashId: result.originalImageHashId,
|
|
137
|
+
errorCode: result.errorCode,
|
|
138
|
+
errorMessage: result.errorMessage,
|
|
139
|
+
items: result.items?.filter(item => {
|
|
140
|
+
return item.type == EnumCapturedResultItemType.CRIT_PARSED_RESULT
|
|
141
|
+
}).map(item => {
|
|
142
|
+
return item as ParsedResultItem
|
|
143
|
+
})
|
|
144
|
+
} as ParsedResult;
|
|
104
145
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CapturedResultFilter interface represents a captured result filter, which is responsible for filtering different types of captured results,
|
|
3
|
+
* including original image, decoded barcodes, recognized text lines, detected quads, normalized images, and parsed results.
|
|
4
|
+
*
|
|
5
|
+
* @remarks Can only use specific inherited classes {@link MultiFrameResultCrossFilter} for now.
|
|
6
|
+
* @see CaptureVisionRouter.addFilter
|
|
7
|
+
* */
|
|
1
8
|
export interface CapturedResultFilter {
|
|
2
9
|
/**@internal*/
|
|
3
10
|
_getFilterId():string;
|
|
@@ -4,19 +4,75 @@ import type {DetectedQuadsResult, NormalizedImagesResult} from "../ddn";
|
|
|
4
4
|
import type {RecognizedTextLinesResult} from "../dlr";
|
|
5
5
|
import type {ParsedResult} from "../dcp";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The CapturedResultReceiver class is designed as a standardized way for retrieving captured results in the Dynamsoft Capture Vision architecture.
|
|
9
|
+
* It adopts an event-driven approach, with events dedicated to various result types,
|
|
10
|
+
* such as the original image, decoded barcodes, recognized text lines, detected quads, normalized images, and parsed results, etc.
|
|
11
|
+
* <p>
|
|
12
|
+
* code snippet:
|
|
13
|
+
* ```
|
|
14
|
+
* val router: CaptureVisionRouter
|
|
15
|
+
* router.addResultReceiver({
|
|
16
|
+
* onDecodedBarcodesReceived: result => {
|
|
17
|
+
* //Handle barcodes. `result` is an instance of DecodedBarcodesResult.
|
|
18
|
+
* },
|
|
19
|
+
*
|
|
20
|
+
* onRecognizedTextLinesReceived: result => {
|
|
21
|
+
* //Handle the result of text recognition. `result` is an instance of RecognizedTextLinesResult.
|
|
22
|
+
* },
|
|
23
|
+
* })
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @see CaptureVisionRouter.addResultReceiver
|
|
27
|
+
* */
|
|
7
28
|
export interface CapturedResultReceiver {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Event triggered when a generic captured result is available, occurring each time an image finishes its processing.
|
|
31
|
+
* This event can be used for any result that does not fit into the specific categories of the other callback events.
|
|
32
|
+
*
|
|
33
|
+
* @see CapturedResult
|
|
34
|
+
* */
|
|
11
35
|
onCapturedResultReceived?: (result: CapturedResult) => void;
|
|
12
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Event triggered when decoded barcodes are available.
|
|
39
|
+
* This event is used to handle barcodes that have been successfully decoded by Dynamsoft Barcode Reader.
|
|
40
|
+
*
|
|
41
|
+
* @see DecodedBarcodesResult
|
|
42
|
+
* */
|
|
13
43
|
onDecodedBarcodesReceived?: (result: DecodedBarcodesResult) => void;
|
|
14
44
|
|
|
45
|
+
/**
|
|
46
|
+
* Event triggered when detected quads are available.
|
|
47
|
+
* This event is used to handle the detection of quadrilateral shapes, typically used as document boundaries,
|
|
48
|
+
* by Dynamsoft Document Normalizer.
|
|
49
|
+
*
|
|
50
|
+
* @see DetectedQuadsResult
|
|
51
|
+
* */
|
|
15
52
|
onDetectedQuadsReceived?: (result: DetectedQuadsResult) => void;
|
|
16
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Event triggered when normalized images are available.
|
|
56
|
+
* This event is used for handling images that have been processed or normalized (e.g., corrected for skew or perspective),
|
|
57
|
+
* by Dynamsoft Document Normalizer.
|
|
58
|
+
*
|
|
59
|
+
* @see NormalizedImagesResult
|
|
60
|
+
* */
|
|
17
61
|
onNormalizedImagesReceived?: (result: NormalizedImagesResult) => void;
|
|
18
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Event triggered when recognized text lines are available.
|
|
65
|
+
* This event is used to handle the result of text recognition by Dynamsoft Label Recognizer.
|
|
66
|
+
*
|
|
67
|
+
* @see RecognizedTextLinesResult
|
|
68
|
+
* */
|
|
19
69
|
onRecognizedTextLinesReceived?: (result: RecognizedTextLinesResult) => void;
|
|
20
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Event triggered when parsed results are available.
|
|
73
|
+
* This event is used for handling results that have been parsed into a structured format by Dynamsoft Code Parser.
|
|
74
|
+
*
|
|
75
|
+
* @see ParsedResult
|
|
76
|
+
* */
|
|
21
77
|
onParsedResultsReceived?: (result: ParsedResult) => void;
|
|
22
78
|
}
|
|
@@ -1,16 +1,81 @@
|
|
|
1
1
|
export enum EnumPresetTemplate {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Versatile function for barcode reading, document detection, or text recognition.
|
|
4
|
+
*/
|
|
5
|
+
PT_DEFAULT = "Default",
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Scans a single barcode.
|
|
9
|
+
* */
|
|
3
10
|
PT_READ_BARCODES = "ReadBarcodes_Default",
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Identifies and reads any text present.
|
|
14
|
+
*/
|
|
4
15
|
PT_RECOGNIZE_TEXT_LINES = "RecognizeTextLines_Default",
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* RIdentifies the edges of a document.
|
|
19
|
+
*/
|
|
5
20
|
PT_DETECT_DOCUMENT_BOUNDARIES = "DetectDocumentBoundaries_Default",
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Detects document edges and standardizes its format.
|
|
24
|
+
*/
|
|
6
25
|
PT_DETECT_AND_NORMALIZE_DOCUMENT = "DetectAndNormalizeDocument_Default",
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Adjusts a document to a standard format using detected borders.
|
|
29
|
+
*/
|
|
7
30
|
PT_NORMALIZE_DOCUMENT = "NormalizeDocument_Default",
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Represents a barcode reading mode where speed is prioritized.
|
|
34
|
+
*
|
|
35
|
+
* In this mode, the barcode reader will optimize for faster barcode detection
|
|
36
|
+
* and decoding, sacrificing some level of accuracy and read rate. It is suitable
|
|
37
|
+
* for situations where a quick response time is more important than perfect
|
|
38
|
+
* barcode recognition.
|
|
39
|
+
*/
|
|
8
40
|
PT_READ_BARCODES_SPEED_FIRST = "ReadBarcodes_SpeedFirst",
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Represents a barcode reading mode where barcode read rate is prioritized.
|
|
44
|
+
*
|
|
45
|
+
* In this mode, the barcode reader will optimize for higher barcode read rates,
|
|
46
|
+
* even if it may sometimes result in reduced accuracy and speed. It is suitable for
|
|
47
|
+
* scenarios where maximizing the number of successfully read barcodes is critical.
|
|
48
|
+
*/
|
|
9
49
|
PT_READ_BARCODES_READ_RATE_FIRST = "ReadBarcodes_ReadRateFirst",
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Scans a single barcode.
|
|
53
|
+
* */
|
|
10
54
|
PT_READ_SINGLE_BARCODE = "ReadSingleBarcode",
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Represents a text recognition mode focused on recognizing numbers.
|
|
58
|
+
*/
|
|
11
59
|
PT_RECOGNIZE_NUMBERS = "RecognizeNumbers",
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Represents a text recognition mode focused on recognizing alphabetic characters (letters).
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
12
65
|
PT_RECOGNIZE_LETTERS = "RecognizeLetters",
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Represents a text recognition mode that combines numbers and alphabetic characters (letters) recognition.
|
|
69
|
+
*/
|
|
13
70
|
PT_RECOGNIZE_NUMBERS_AND_LETTERS = "RecognizeNumbersAndLetters",
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Represents a text recognition mode that combines numbers and uppercase letters recognition.
|
|
74
|
+
*/
|
|
14
75
|
PT_RECOGNIZE_NUMBERS_AND_UPPERCASE_LETTERS = "RecognizeNumbersAndUppercaseLetters",
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Represents a text recognition mode focused on recognizing uppercase letters.
|
|
79
|
+
*/
|
|
15
80
|
PT_RECOGNIZE_UPPERCASE_LETTERS = "RecognizeUppercaseLetters",
|
|
16
81
|
}
|
|
@@ -3,14 +3,59 @@ import type {SimplifiedBarcodeReaderSettings} from "../dbr";
|
|
|
3
3
|
import type {SimplifiedLabelRecognizerSettings} from "../dlr";
|
|
4
4
|
import type {SimplifiedDocumentNormalizerSettings} from "../ddn";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The SimplifiedCaptureVisionSettings interface provides a standardized way to adjust a select set of settings for a given CaptureVisionTemplate.
|
|
8
|
+
* @see CaptureVisionRouter.getSimplifiedSettings
|
|
9
|
+
* @see CaptureVisionRouter.updateSettings
|
|
10
|
+
* */
|
|
6
11
|
export interface SimplifiedCaptureVisionSettings {
|
|
12
|
+
/**
|
|
13
|
+
* Specifies the types of result items that are expected to be returned. It is of type {@link EnumCapturedResultItemType}.
|
|
14
|
+
* */
|
|
7
15
|
capturedResultItemTypes?: EnumCapturedResultItemType | number;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Designates the region of interest (ROI) within an image,
|
|
19
|
+
* limiting the image processing activities exclusively to this specified area.
|
|
20
|
+
* It is of type {@link Quadrilateral}.
|
|
21
|
+
* */
|
|
8
22
|
roi?: Quadrilateral;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Determines if the coordinates for the region of interest (ROI) are expressed
|
|
26
|
+
* in percentage terms (true) or as exact pixel measurements (false).
|
|
27
|
+
* */
|
|
9
28
|
roiMeasuredInPercentage?: boolean;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Specifies the maximum number of parallel tasks(in native) that can be used for image capture and recognition.
|
|
32
|
+
* */
|
|
10
33
|
maxParallelTasks?:number
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Specifies the maximum time (in milliseconds) allowed for image capture and recognition.
|
|
37
|
+
* */
|
|
11
38
|
timeout?: number;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Specifies the shortest time span, in milliseconds, that must elapse between two successive image captures.
|
|
42
|
+
* Opting for a higher interval decreases capture frequency, which can lower the system's processing load and conserve energy.
|
|
43
|
+
* On the other hand, a smaller interval value increases the frequency of image captures, enhancing the system's responsiveness.
|
|
44
|
+
* */
|
|
12
45
|
minImageCaptureInterval?: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Specifies the basic settings for the barcode reader module. It is of type {@link SimplifiedBarcodeReaderSettings}.
|
|
49
|
+
* */
|
|
13
50
|
barcodeSettings?: SimplifiedBarcodeReaderSettings;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Specifies the basic settings for the label recognizer module. It is of type {@link SimplifiedLabelRecognizerSettings}.
|
|
54
|
+
* */
|
|
14
55
|
labelSettings?: SimplifiedLabelRecognizerSettings;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Specifies the basic settings for the document normalizer module. It is of type {@link SimplifiedDocumentNormalizerSettings}.
|
|
59
|
+
* */
|
|
15
60
|
documentSettings?: SimplifiedDocumentNormalizerSettings;
|
|
16
61
|
}
|
|
@@ -2,15 +2,45 @@ import type {CapturedResultItem} from "../core/CapturedResultItem";
|
|
|
2
2
|
import type {Quadrilateral} from "../core/Quadrilateral";
|
|
3
3
|
import type {EnumBarcodeFormat} from "./EnumBarcodeFormat";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Interface BarcodeResultItem extends {@link CapturedResultItem}, represents a barcode result item decoded by barcode reader engine.
|
|
7
|
+
* @see DecodedBarcodesResult
|
|
8
|
+
* @see EnumCapturedResultItemType.CRIT_BARCODE
|
|
9
|
+
* */
|
|
5
10
|
export interface BarcodeResultItem extends CapturedResultItem{
|
|
11
|
+
/**
|
|
12
|
+
* The format of the barcode. It specifies the type of barcode that was recognized.
|
|
13
|
+
* @see EnumBarcodeFormat
|
|
14
|
+
* */
|
|
6
15
|
format: EnumBarcodeFormat | bigint;
|
|
16
|
+
|
|
17
|
+
/**@internal*/
|
|
7
18
|
_formatNumberString: string;
|
|
19
|
+
|
|
20
|
+
/**A string that describes the format of the barcode in human-readable form. It provides a textual representation of the barcode format.*/
|
|
8
21
|
formatString: string;
|
|
22
|
+
|
|
23
|
+
/**The textual data decoded from the barcode. It represents the content of the barcode.*/
|
|
9
24
|
text: string;
|
|
25
|
+
/**
|
|
26
|
+
* The location of the barcode in the form of a {@link Quadrilateral} (a set of coordinates defining the four corners of the detected barcode).
|
|
27
|
+
* It describes where the barcode was found within an image.
|
|
28
|
+
* @see Quadrilateral
|
|
29
|
+
* */
|
|
10
30
|
location: Quadrilateral;
|
|
31
|
+
|
|
32
|
+
/**The confidence score or reliability of the barcode detection.*/
|
|
11
33
|
confidence: number;
|
|
34
|
+
|
|
35
|
+
/**The angle or orientation of the barcode, indicating if the barcode was detected at an angle or rotated.*/
|
|
12
36
|
angle: number;
|
|
37
|
+
|
|
38
|
+
/**The size of the individual modules or elements within the barcode.*/
|
|
13
39
|
moduleSize: number;
|
|
40
|
+
|
|
41
|
+
/**Whether the barcode is mirrored or reversed from its normal orientation.*/
|
|
14
42
|
isMirrored: boolean;
|
|
43
|
+
|
|
44
|
+
/**Indicates whether the barcode is a Direct Part Marking (DPM) barcode.*/
|
|
15
45
|
isDPM: boolean;
|
|
16
|
-
}
|
|
46
|
+
}
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import type {BarcodeResultItem} from "./BarcodeResultItem";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Interface DecodedBarcodesResult represents information of decoded barcodes from an image.
|
|
5
|
+
* @see CapturedResultReceiver.onDecodedBarcodesReceived
|
|
6
|
+
* */
|
|
3
7
|
export interface DecodedBarcodesResult {
|
|
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
|
+
/**
|
|
15
|
+
* An array of {@link BarcodeResultItem} objects, representing the list of decoded barcodes found in the image.
|
|
16
|
+
* */
|
|
5
17
|
items?: Array<BarcodeResultItem>;
|
|
18
|
+
|
|
19
|
+
/**The error code of the barcode reading result, if an error occurred.*/
|
|
6
20
|
errorCode: number;
|
|
21
|
+
|
|
22
|
+
/**The error message of the barcode reading result, if an error occurred.*/
|
|
7
23
|
errorMessage?: string;
|
|
24
|
+
|
|
25
|
+
/**the rotation transformation matrix of the original image relative to the rotated image.*/
|
|
8
26
|
rotationTransformMatrix: Array<number>;
|
|
9
27
|
}
|