dynamsoft-capture-vision-react-native 3.4.1300 → 3.4.3010

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.
Files changed (198) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +62 -62
  3. package/android/README.md +14 -14
  4. package/android/build.gradle +167 -163
  5. package/android/gradle.properties +20 -20
  6. package/android/settings.gradle +5 -5
  7. package/android/src/main/AndroidManifest.xml +6 -6
  8. package/android/src/main/AndroidManifest_noPackage.xml +5 -5
  9. package/android/src/main/cpp/CMakeLists.txt +21 -21
  10. package/android/src/main/cpp/ImgHO.cpp +94 -94
  11. package/android/src/main/cpp/ImgHO.h +34 -34
  12. package/android/src/main/cpp/JsiCore.cpp +296 -296
  13. package/android/src/main/cpp/JsiCore.h +51 -51
  14. package/android/src/main/cpp/JsiCvr.cpp +332 -332
  15. package/android/src/main/cpp/JsiCvr.h +54 -54
  16. package/android/src/main/cpp/JsiDbr.cpp +283 -283
  17. package/android/src/main/cpp/JsiDbr.h +26 -26
  18. package/android/src/main/cpp/JsiDce.cpp +59 -59
  19. package/android/src/main/cpp/JsiDce.h +17 -17
  20. package/android/src/main/cpp/JsiDcp.cpp +51 -51
  21. package/android/src/main/cpp/JsiDcp.h +31 -31
  22. package/android/src/main/cpp/JsiDdn.cpp +50 -50
  23. package/android/src/main/cpp/JsiDdn.h +28 -28
  24. package/android/src/main/cpp/JsiDlr.cpp +60 -60
  25. package/android/src/main/cpp/JsiDlr.h +26 -26
  26. package/android/src/main/cpp/JsiUtility.cpp +604 -604
  27. package/android/src/main/cpp/JsiUtility.h +26 -26
  28. package/android/src/main/cpp/RawBuffer.cpp +23 -23
  29. package/android/src/main/cpp/RawBuffer.h +24 -24
  30. package/android/src/main/cpp/android_log.h +14 -14
  31. package/android/src/main/dysJniLibsFor86/debug/arm64-v8a/librn_dys.so +0 -0
  32. package/android/src/main/dysJniLibsFor86/debug/armeabi-v7a/librn_dys.so +0 -0
  33. package/android/src/main/dysJniLibsFor86/debug/x86/librn_dys.so +0 -0
  34. package/android/src/main/dysJniLibsFor86/debug/x86_64/librn_dys.so +0 -0
  35. package/android/src/main/dysJniLibsFor86/release/arm64-v8a/librn_dys.so +0 -0
  36. package/android/src/main/dysJniLibsFor86/release/armeabi-v7a/librn_dys.so +0 -0
  37. package/android/src/main/dysJniLibsFor86/release/x86/librn_dys.so +0 -0
  38. package/android/src/main/dysJniLibsFor86/release/x86_64/librn_dys.so +0 -0
  39. package/android/src/main/java/com/dynamsoft/reactnativelib/CVRModule.kt +137 -137
  40. package/android/src/main/java/com/dynamsoft/reactnativelib/CameraViewManager.kt +62 -62
  41. package/android/src/main/java/com/dynamsoft/reactnativelib/DCEModule.kt +125 -125
  42. package/android/src/main/java/com/dynamsoft/reactnativelib/DynamsoftBaseModule.kt +8 -8
  43. package/android/src/main/java/com/dynamsoft/reactnativelib/ISAModule.kt +73 -73
  44. package/android/src/main/java/com/dynamsoft/reactnativelib/ImageEditorViewManager.kt +14 -14
  45. package/android/src/main/java/com/dynamsoft/reactnativelib/ImageEditorViewModule.kt +35 -35
  46. package/android/src/main/java/com/dynamsoft/reactnativelib/ImageManagerModule.kt +15 -15
  47. package/android/src/main/java/com/dynamsoft/reactnativelib/LicenseModule.kt +29 -29
  48. package/android/src/main/java/com/dynamsoft/reactnativelib/MultiCrossFilterModule.kt +83 -83
  49. package/android/src/main/java/com/dynamsoft/reactnativelib/ReactNativeDcvPackage.kt +32 -32
  50. package/android/src/main/java/com/dynamsoft/reactnativelib/VersionsModule.kt +41 -41
  51. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/Basic.kt +44 -44
  52. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForCore.kt +50 -50
  53. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForCvr.kt +129 -129
  54. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDBR.kt +157 -157
  55. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDCE.kt +110 -110
  56. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDCP.kt +49 -49
  57. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDDN.kt +85 -85
  58. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ForDLR.kt +72 -72
  59. package/android/src/main/java/com/dynamsoft/reactnativelib/basicutils/ImageUtil.kt +58 -58
  60. package/android/src/main/java/com/dynamsoft/reactnativelib/core/ImageSourceAdapterModuleImpl.kt +120 -120
  61. package/android/src/main/java/com/dynamsoft/reactnativelib/cvr/CaptureVisionRouterModuleImpl.kt +306 -306
  62. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraEnhancerModuleImpl.kt +247 -247
  63. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraLifeCycleOwner.java +14 -14
  64. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraViewManagerImpl.kt +77 -77
  65. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewManagerImpl.kt +15 -15
  66. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewModuleImpl.kt +110 -110
  67. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNCameraView.kt +20 -20
  68. package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNImageEditorView.kt +19 -19
  69. package/android/src/main/java/com/dynamsoft/reactnativelib/license/LicenseModuleImpl.kt +39 -39
  70. package/android/src/main/java/com/dynamsoft/reactnativelib/utility/ImageManagerModuleImpl.kt +120 -120
  71. package/android/src/main/java/com/dynamsoft/reactnativelib/utility/MultiCrossFilterModuleImpl.kt +111 -111
  72. package/app.plugin.js +21 -21
  73. package/dynamsoft-capture-vision-react-native.podspec +24 -24
  74. package/ios/CPP/DSImageData+HostObject.h +18 -18
  75. package/ios/CPP/DSImageData+HostObject.mm +38 -38
  76. package/ios/CPP/ImageDataHostObject.cpp +87 -87
  77. package/ios/CPP/ImageDataHostObject.hpp +35 -35
  78. package/ios/CPP/MutableRawBuffer.cpp +23 -23
  79. package/ios/CPP/MutableRawBuffer.hpp +23 -23
  80. package/ios/CPP/RNDynamsoft+JSI.h +22 -22
  81. package/ios/CPP/RNDynamsoft+JSI.mm +303 -303
  82. package/ios/CPP/RNDynamsoft+Json.h +93 -93
  83. package/ios/CPP/RNDynamsoft+Json.m +733 -733
  84. package/ios/CPP/YeetJSIUtils.h +56 -56
  85. package/ios/CPP/YeetJSIUtils.mm +208 -208
  86. package/ios/RNDynamsoftCameraView.h +31 -31
  87. package/ios/RNDynamsoftCameraView.m +108 -108
  88. package/ios/RNDynamsoftCameraViewManager.h +14 -14
  89. package/ios/RNDynamsoftCameraViewManager.m +195 -195
  90. package/ios/RNDynamsoftCaptureVisionRouter.h +18 -18
  91. package/ios/RNDynamsoftCaptureVisionRouter.mm +532 -532
  92. package/ios/RNDynamsoftImageEditorView.h +17 -17
  93. package/ios/RNDynamsoftImageEditorView.m +25 -25
  94. package/ios/RNDynamsoftImageEditorViewManager.h +14 -14
  95. package/ios/RNDynamsoftImageEditorViewManager.mm +183 -183
  96. package/ios/RNDynamsoftImageManager.h +14 -14
  97. package/ios/RNDynamsoftImageManager.mm +369 -369
  98. package/ios/RNDynamsoftImageSourceAdapter.h +19 -19
  99. package/ios/RNDynamsoftImageSourceAdapter.mm +255 -255
  100. package/ios/RNDynamsoftLicense.h +14 -14
  101. package/ios/RNDynamsoftLicense.m +62 -62
  102. package/ios/RNDynamsoftMultiCrossFilter.h +14 -14
  103. package/ios/RNDynamsoftMultiCrossFilter.m +145 -145
  104. package/ios/RNDynamsoftVersions.h +13 -13
  105. package/ios/RNDynamsoftVersions.m +27 -27
  106. package/package.json +48 -48
  107. package/src/NativeDynamsoftVersionsModule.tsx +20 -20
  108. package/src/VersionsModule.tsx +7 -7
  109. package/src/core/CapturedResultBase.tsx +18 -18
  110. package/src/core/CapturedResultItem.tsx +23 -23
  111. package/src/core/CoreModule.tsx +9 -9
  112. package/src/core/DSRect.tsx +29 -29
  113. package/src/core/EnumCaptureResultItemType.tsx +52 -52
  114. package/src/core/EnumColourChannelUsageType.tsx +26 -26
  115. package/src/core/EnumCrossVerificationStatus.tsx +46 -46
  116. package/src/core/EnumGrayscaleEnhancementMode.tsx +46 -46
  117. package/src/core/EnumGrayscaleTransformationMode.tsx +35 -35
  118. package/src/core/EnumImageFileFormat.tsx +6 -6
  119. package/src/core/EnumPixelFormat.tsx +53 -53
  120. package/src/core/ImageData.tsx +87 -87
  121. package/src/core/ImageSourceAdapter.tsx +160 -160
  122. package/src/core/NativeDynamsoftImageSourceAdapterModule.tsx +29 -29
  123. package/src/core/Point.tsx +13 -13
  124. package/src/core/Quadrilateral.tsx +12 -12
  125. package/src/core/index.tsx +18 -18
  126. package/src/cvr/CaptureVisionRouter.tsx +683 -683
  127. package/src/cvr/CaptureVisionRouterModule.tsx +9 -9
  128. package/src/cvr/CapturedResult.tsx +123 -123
  129. package/src/cvr/CapturedResultFilter.tsx +13 -13
  130. package/src/cvr/CapturedResultReceiver.tsx +71 -71
  131. package/src/cvr/EnumPresetTemplate.tsx +81 -81
  132. package/src/cvr/NativeDynamsoftCaptureVisionRouterModule.tsx +25 -25
  133. package/src/cvr/SimplifiedCaptureVisionSettings.tsx +61 -61
  134. package/src/cvr/index.tsx +11 -11
  135. package/src/dbr/BarcodeDetails.tsx +51 -51
  136. package/src/dbr/BarcodeReaderModule.tsx +9 -9
  137. package/src/dbr/BarcodeResultItem.tsx +65 -65
  138. package/src/dbr/DecodedBarcodesResult.tsx +14 -14
  139. package/src/dbr/ECISegment.tsx +23 -23
  140. package/src/dbr/EnumBarcodeFormat.tsx +112 -112
  141. package/src/dbr/EnumDeblurMode.tsx +29 -29
  142. package/src/dbr/EnumLocalizationMode.tsx +27 -27
  143. package/src/dbr/EnumQRCodeErrorCorrectionLevel.tsx +6 -6
  144. package/src/dbr/SimplifiedBarcodeReaderSettings.tsx +80 -80
  145. package/src/dbr/index.tsx +9 -9
  146. package/src/dce/CameraEnhancer.tsx +254 -254
  147. package/src/dce/CameraEnhancerModule.tsx +9 -9
  148. package/src/dce/CameraView.tsx +100 -100
  149. package/src/dce/DynamsoftCameraViewNativeComponent.ts +96 -96
  150. package/src/dce/DynamsoftImageEditorViewNativeComponent.ts +9 -9
  151. package/src/dce/EnumCameraPosition.tsx +25 -25
  152. package/src/dce/EnumDrawingLayerId.tsx +17 -17
  153. package/src/dce/EnumEnhancedFeatures.tsx +24 -24
  154. package/src/dce/EnumFocusMode.tsx +6 -6
  155. package/src/dce/EnumResolution.tsx +8 -8
  156. package/src/dce/EnumTorchState.tsx +10 -10
  157. package/src/dce/FeedBack.tsx +28 -28
  158. package/src/dce/ImageEditorView.tsx +131 -131
  159. package/src/dce/NativeDynamsoftCameraViewModule.tsx +47 -47
  160. package/src/dce/NativeDynamsoftImageEditorViewModule.ts +9 -9
  161. package/src/dce/index.tsx +13 -13
  162. package/src/dcp/CodeParserDedicatorModule.tsx +9 -9
  163. package/src/dcp/CodeParserModule.tsx +9 -9
  164. package/src/dcp/EnumMappingStatus.tsx +14 -14
  165. package/src/dcp/EnumValidationStatus.tsx +14 -14
  166. package/src/dcp/ParsedResult.tsx +14 -14
  167. package/src/dcp/ParsedResultItem.tsx +50 -50
  168. package/src/dcp/index.tsx +8 -8
  169. package/src/ddn/DeskewedImageResultItem.tsx +40 -40
  170. package/src/ddn/DetectedQuadResultItem.tsx +31 -31
  171. package/src/ddn/DocumentNormalizerModule.tsx +9 -9
  172. package/src/ddn/EnhancedImageResultItem.tsx +20 -20
  173. package/src/ddn/EnumImageColourMode.tsx +14 -14
  174. package/src/ddn/ProcessedDocumentResult.tsx +27 -27
  175. package/src/ddn/SimplifiedDocumentNormalizerSettings.tsx +65 -65
  176. package/src/ddn/index.tsx +11 -11
  177. package/src/dip/ImageProcessingModule.tsx +9 -9
  178. package/src/dip/index.tsx +1 -1
  179. package/src/dlr/CharacterResult.tsx +28 -28
  180. package/src/dlr/LabelRecognizerModule.tsx +9 -9
  181. package/src/dlr/RecognizedTextLinesResult.tsx +19 -19
  182. package/src/dlr/SimplifiedLabelRecognizerSettings.tsx +33 -33
  183. package/src/dlr/TextLineResultItem.tsx +41 -41
  184. package/src/dlr/index.tsx +8 -8
  185. package/src/index.tsx +13 -13
  186. package/src/license/LicenseManager.tsx +49 -49
  187. package/src/license/LicenseModule.tsx +9 -9
  188. package/src/license/NativeDynamsoftLicenseModule.tsx +7 -7
  189. package/src/license/index.tsx +7 -7
  190. package/src/utility/CrossVerificationCriteria.tsx +11 -11
  191. package/src/utility/EnumFilterType.tsx +5 -5
  192. package/src/utility/ImageManager.tsx +348 -348
  193. package/src/utility/MultiFrameResultCrossFilter.tsx +183 -183
  194. package/src/utility/NativeDynamsoftImageManagerModule.tsx +7 -7
  195. package/src/utility/NativeDynamsoftMultiCrossFilterModule.tsx +18 -18
  196. package/src/utility/UtilityModule.tsx +9 -9
  197. package/src/utility/index.tsx +4 -4
  198. package/android/.gitignore +0 -4
@@ -1,183 +1,183 @@
1
- import {NativeModules} from 'react-native';
2
- import type {CapturedResultFilter, CaptureVisionRouter} from '../cvr'
3
- import {EnumCapturedResultItemType} from '../core'
4
- import type { CrossVerificationCriteria } from './CrossVerificationCriteria';
5
-
6
- // @ts-ignore Check whether __turboModuleProxy exists, it may not
7
- const isTurboModuleEnabled = global.__turboModuleProxy != null;
8
-
9
- const DynamsoftMultiCrossFilterModule = isTurboModuleEnabled ?
10
- require("./NativeDynamsoftMultiCrossFilterModule").default :
11
- NativeModules.DynamsoftMultiCrossFilterModule;
12
-
13
- /**
14
- * The MultiFrameResultCrossFilter class offers a set of API functions designed for managing and filtering results from multiple image frames,
15
- * typically used in consecutive frames of a streaming video.
16
- *
17
- * @see {@link CapturedResultFilter}
18
- * @see {@link CaptureVisionRouter.addFilter}
19
- * */
20
- export class MultiFrameResultCrossFilter implements CapturedResultFilter {
21
- filterId = "";
22
-
23
- constructor() {
24
- this.filterId = DynamsoftMultiCrossFilterModule.createInstance()
25
- }
26
-
27
- /**@internal*/
28
- _getFilterId(): string {
29
- return this.filterId;
30
- }
31
-
32
- destroy() {
33
- DynamsoftMultiCrossFilterModule.destroy(this.filterId)
34
- }
35
-
36
- /**
37
- * Enables or disables the verification of specific result item types.
38
- * <p>Code Snippet:</p>
39
- *
40
- * ```
41
- * let filter = new MultiFrameResultCrossFilter();
42
- * filter.enableResultCrossVerification(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
43
- * //...
44
- * filter.enableResultCrossVerification(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
45
- * ```
46
- *
47
- * @param resultItemTypes - Specifies one or multiple specific result item types.
48
- * @param enable - Boolean to toggle verification on or off.
49
- * @see {@link EnumCapturedResultItemType}
50
- * */
51
- enableResultCrossVerification(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
52
- DynamsoftMultiCrossFilterModule.enableResultCrossVerification(this.filterId, resultItemTypes, enable)
53
- }
54
-
55
- /**
56
- * Checks if verification is active for a given result item type.
57
- * @param type - Specifies one specific result item type.
58
- * @return Promise<void> - A promise that resolves a boolean indicating the status of verification for the specified type.
59
- * */
60
- isResultCrossVerificationEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
61
- return DynamsoftMultiCrossFilterModule.isResultCrossVerificationEnabled(this.filterId, type);
62
- }
63
-
64
- /**
65
- * Enables or disables the deduplication process for one or multiple specific result item types.
66
- * <p>Code Snippet:</p>
67
- *
68
- * ```
69
- * let filter = new MultiFrameResultCrossFilter();
70
- * filter.enableResultDeduplication(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
71
- * //...
72
- * filter.enableResultDeduplication(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
73
- * ```
74
- *
75
- * @param resultItemTypes - Specifies one or multiple specific result item types.
76
- * @param enable - Boolean to toggle deduplication on or off.
77
- * @see {@link EnumCapturedResultItemType}
78
- * */
79
- enableResultDeduplication(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
80
- DynamsoftMultiCrossFilterModule.enableResultDeduplication(this.filterId, resultItemTypes, enable);
81
- }
82
-
83
- /**
84
- * Checks if deduplication is active for a given result item type.
85
- * @param type - Specifies one specific result item type.
86
- * @return Promise<boolean> - A promise that resolves a boolean indicating the deduplication status for the specified type.
87
- * */
88
- isResultDeduplicationEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
89
- return DynamsoftMultiCrossFilterModule.isResultDeduplicationEnabled(this.filterId, type);
90
- }
91
-
92
- /**
93
- * Sets the interval during which duplicates are disregarded for one or multiple specific result item types.
94
- *
95
- * @param types Specifies one or multiple specific result item types.
96
- * @param time Time in milliseconds during which duplicates are disregarded.
97
- * */
98
- setDuplicateForgetTime(types: EnumCapturedResultItemType | number, time: number) {
99
- DynamsoftMultiCrossFilterModule.setDuplicateForgetTime(this.filterId, types, time);
100
- }
101
-
102
- /**
103
- * Gets the interval during which duplicates are disregarded for a given result item type.
104
- * @param type Specifies one specific result item type.
105
- * @return Promise<boolean> - A promise that resolves the maximum overlapping frames count for a given result item type.
106
- * */
107
- getDuplicateForgetTime(type: EnumCapturedResultItemType | number): Promise<number> {
108
- return DynamsoftMultiCrossFilterModule.getDuplicateForgetTime(this.filterId, type);
109
- }
110
-
111
- /**
112
- * Enables or disables the to-the-latest overlapping feature of one or multiple specific result item types.
113
- * <p>Code Snippet:</p>
114
- *
115
- * ```
116
- * let filter = new MultiFrameResultCrossFilter();
117
- * filter.enableLatestOverlapping(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
118
- * //...
119
- * filter.enableLatestOverlapping(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
120
- * ```
121
- *
122
- * @param resultItemTypes - Specifies one or multiple specific result item types.
123
- * @param enable - Boolean to toggle to-the-latest overlapping on or off.
124
- * @see {@link EnumCapturedResultItemType}
125
- * */
126
- enableLatestOverlapping(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
127
- return DynamsoftMultiCrossFilterModule.enableLatestOverlapping(this.filterId, resultItemTypes, enable);
128
- }
129
-
130
- /**
131
- * Checks if to-the-latest overlapping is active for a given result item type.
132
- * @param type - Specifies one specific result item type.
133
- * @return Promise<void> - A promise that resolves a boolean indicating the to-the-latest overlapping status for the specified type.
134
- * */
135
- isLatestOverlappingEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
136
- return DynamsoftMultiCrossFilterModule.isLatestOverlappingEnabled(this.filterId, type)
137
- }
138
-
139
- /**
140
- * Set the maximum overlapping frames count for one or multiple specific result item types.
141
- * You can set it higher if:
142
- * - You capture device is stationary or moving stably.
143
- * - You want to further improve the read-rate.
144
- *
145
- * @param types Specifies one or multiple specific result item types.
146
- * @param maxOverlappingFrames The maximum overlapping frame count for the overlapping.
147
- * */
148
- setMaxOverlappingFrames(types: EnumCapturedResultItemType | number, maxOverlappingFrames: number) {
149
- DynamsoftMultiCrossFilterModule.setMaxOverlappingFrames(this.filterId, types, maxOverlappingFrames);
150
- }
151
-
152
- /**
153
- * Get the maximum overlapping frames count for a given result item type.
154
- *
155
- * @param type Specifies a result item type.
156
- * @return {Promise<number>} A promise that resolves the maximum overlapping frame count for the overlapping..
157
- * */
158
- getMaxOverlappingFrames(type: EnumCapturedResultItemType | number): Promise<number> {
159
- return DynamsoftMultiCrossFilterModule.getMaxOverlappingFrames(this.filterId, type);
160
- }
161
-
162
- /**
163
- * Set the criteria for cross-verification of one or multiple specific result item types.
164
- *
165
- * @param types Specifies one or multiple specific result item types.
166
- * @param criteria The criteria for cross-verification, including parameters such as frameWindow and minConsistentFrames.
167
- * @see {@link CrossVerificationCriteria}
168
- * */
169
- setResultCrossVerificationCriteria(types: EnumCapturedResultItemType | number, criteria: CrossVerificationCriteria) {
170
- DynamsoftMultiCrossFilterModule.setResultCrossVerificationCriteria(this.filterId, types, criteria);
171
- }
172
-
173
- /**
174
- * Get the criteria for cross-verification of a given result item type.
175
- *
176
- * @param type Specifies a result item type.
177
- * @return {Promise<CrossVerificationCriteria>} A promise that resolves the criteria for cross-verification, including parameters such as frameWindow and minConsistentFrames.
178
- * @see {@link CrossVerificationCriteria}
179
- * */
180
- getResultCrossVerificationCriteria(type: EnumCapturedResultItemType | number): Promise<CrossVerificationCriteria> {
181
- return DynamsoftMultiCrossFilterModule.getResultCrossVerificationCriteria(this.filterId, type);
182
- }
183
- }
1
+ import {NativeModules} from 'react-native';
2
+ import type {CapturedResultFilter, CaptureVisionRouter} from '../cvr'
3
+ import {EnumCapturedResultItemType} from '../core'
4
+ import type { CrossVerificationCriteria } from './CrossVerificationCriteria';
5
+
6
+ // @ts-ignore Check whether __turboModuleProxy exists, it may not
7
+ const isTurboModuleEnabled = global.__turboModuleProxy != null;
8
+
9
+ const DynamsoftMultiCrossFilterModule = isTurboModuleEnabled ?
10
+ require("./NativeDynamsoftMultiCrossFilterModule").default :
11
+ NativeModules.DynamsoftMultiCrossFilterModule;
12
+
13
+ /**
14
+ * The MultiFrameResultCrossFilter class offers a set of API functions designed for managing and filtering results from multiple image frames,
15
+ * typically used in consecutive frames of a streaming video.
16
+ *
17
+ * @see {@link CapturedResultFilter}
18
+ * @see {@link CaptureVisionRouter.addFilter}
19
+ * */
20
+ export class MultiFrameResultCrossFilter implements CapturedResultFilter {
21
+ filterId = "";
22
+
23
+ constructor() {
24
+ this.filterId = DynamsoftMultiCrossFilterModule.createInstance()
25
+ }
26
+
27
+ /**@internal*/
28
+ _getFilterId(): string {
29
+ return this.filterId;
30
+ }
31
+
32
+ destroy() {
33
+ DynamsoftMultiCrossFilterModule.destroy(this.filterId)
34
+ }
35
+
36
+ /**
37
+ * Enables or disables the verification of specific result item types.
38
+ * <p>Code Snippet:</p>
39
+ *
40
+ * ```
41
+ * let filter = new MultiFrameResultCrossFilter();
42
+ * filter.enableResultCrossVerification(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
43
+ * //...
44
+ * filter.enableResultCrossVerification(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
45
+ * ```
46
+ *
47
+ * @param resultItemTypes - Specifies one or multiple specific result item types.
48
+ * @param enable - Boolean to toggle verification on or off.
49
+ * @see {@link EnumCapturedResultItemType}
50
+ * */
51
+ enableResultCrossVerification(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
52
+ DynamsoftMultiCrossFilterModule.enableResultCrossVerification(this.filterId, resultItemTypes, enable)
53
+ }
54
+
55
+ /**
56
+ * Checks if verification is active for a given result item type.
57
+ * @param type - Specifies one specific result item type.
58
+ * @return Promise<void> - A promise that resolves a boolean indicating the status of verification for the specified type.
59
+ * */
60
+ isResultCrossVerificationEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
61
+ return DynamsoftMultiCrossFilterModule.isResultCrossVerificationEnabled(this.filterId, type);
62
+ }
63
+
64
+ /**
65
+ * Enables or disables the deduplication process for one or multiple specific result item types.
66
+ * <p>Code Snippet:</p>
67
+ *
68
+ * ```
69
+ * let filter = new MultiFrameResultCrossFilter();
70
+ * filter.enableResultDeduplication(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
71
+ * //...
72
+ * filter.enableResultDeduplication(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
73
+ * ```
74
+ *
75
+ * @param resultItemTypes - Specifies one or multiple specific result item types.
76
+ * @param enable - Boolean to toggle deduplication on or off.
77
+ * @see {@link EnumCapturedResultItemType}
78
+ * */
79
+ enableResultDeduplication(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
80
+ DynamsoftMultiCrossFilterModule.enableResultDeduplication(this.filterId, resultItemTypes, enable);
81
+ }
82
+
83
+ /**
84
+ * Checks if deduplication is active for a given result item type.
85
+ * @param type - Specifies one specific result item type.
86
+ * @return Promise<boolean> - A promise that resolves a boolean indicating the deduplication status for the specified type.
87
+ * */
88
+ isResultDeduplicationEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
89
+ return DynamsoftMultiCrossFilterModule.isResultDeduplicationEnabled(this.filterId, type);
90
+ }
91
+
92
+ /**
93
+ * Sets the interval during which duplicates are disregarded for one or multiple specific result item types.
94
+ *
95
+ * @param types Specifies one or multiple specific result item types.
96
+ * @param time Time in milliseconds during which duplicates are disregarded.
97
+ * */
98
+ setDuplicateForgetTime(types: EnumCapturedResultItemType | number, time: number) {
99
+ DynamsoftMultiCrossFilterModule.setDuplicateForgetTime(this.filterId, types, time);
100
+ }
101
+
102
+ /**
103
+ * Gets the interval during which duplicates are disregarded for a given result item type.
104
+ * @param type Specifies one specific result item type.
105
+ * @return Promise<boolean> - A promise that resolves the maximum overlapping frames count for a given result item type.
106
+ * */
107
+ getDuplicateForgetTime(type: EnumCapturedResultItemType | number): Promise<number> {
108
+ return DynamsoftMultiCrossFilterModule.getDuplicateForgetTime(this.filterId, type);
109
+ }
110
+
111
+ /**
112
+ * Enables or disables the to-the-latest overlapping feature of one or multiple specific result item types.
113
+ * <p>Code Snippet:</p>
114
+ *
115
+ * ```
116
+ * let filter = new MultiFrameResultCrossFilter();
117
+ * filter.enableLatestOverlapping(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, true); //enable
118
+ * //...
119
+ * filter.enableLatestOverlapping(EnumCapturedResultItemType.CRIT_BARCODE | EnumCapturedResultItemType.CRIT_TEXT_LINE, false); //disable
120
+ * ```
121
+ *
122
+ * @param resultItemTypes - Specifies one or multiple specific result item types.
123
+ * @param enable - Boolean to toggle to-the-latest overlapping on or off.
124
+ * @see {@link EnumCapturedResultItemType}
125
+ * */
126
+ enableLatestOverlapping(resultItemTypes: EnumCapturedResultItemType | number, enable: boolean) {
127
+ return DynamsoftMultiCrossFilterModule.enableLatestOverlapping(this.filterId, resultItemTypes, enable);
128
+ }
129
+
130
+ /**
131
+ * Checks if to-the-latest overlapping is active for a given result item type.
132
+ * @param type - Specifies one specific result item type.
133
+ * @return Promise<void> - A promise that resolves a boolean indicating the to-the-latest overlapping status for the specified type.
134
+ * */
135
+ isLatestOverlappingEnabled(type: EnumCapturedResultItemType | number): Promise<boolean> {
136
+ return DynamsoftMultiCrossFilterModule.isLatestOverlappingEnabled(this.filterId, type)
137
+ }
138
+
139
+ /**
140
+ * Set the maximum overlapping frames count for one or multiple specific result item types.
141
+ * You can set it higher if:
142
+ * - You capture device is stationary or moving stably.
143
+ * - You want to further improve the read-rate.
144
+ *
145
+ * @param types Specifies one or multiple specific result item types.
146
+ * @param maxOverlappingFrames The maximum overlapping frame count for the overlapping.
147
+ * */
148
+ setMaxOverlappingFrames(types: EnumCapturedResultItemType | number, maxOverlappingFrames: number) {
149
+ DynamsoftMultiCrossFilterModule.setMaxOverlappingFrames(this.filterId, types, maxOverlappingFrames);
150
+ }
151
+
152
+ /**
153
+ * Get the maximum overlapping frames count for a given result item type.
154
+ *
155
+ * @param type Specifies a result item type.
156
+ * @return {Promise<number>} A promise that resolves the maximum overlapping frame count for the overlapping..
157
+ * */
158
+ getMaxOverlappingFrames(type: EnumCapturedResultItemType | number): Promise<number> {
159
+ return DynamsoftMultiCrossFilterModule.getMaxOverlappingFrames(this.filterId, type);
160
+ }
161
+
162
+ /**
163
+ * Set the criteria for cross-verification of one or multiple specific result item types.
164
+ *
165
+ * @param types Specifies one or multiple specific result item types.
166
+ * @param criteria The criteria for cross-verification, including parameters such as frameWindow and minConsistentFrames.
167
+ * @see {@link CrossVerificationCriteria}
168
+ * */
169
+ setResultCrossVerificationCriteria(types: EnumCapturedResultItemType | number, criteria: CrossVerificationCriteria) {
170
+ DynamsoftMultiCrossFilterModule.setResultCrossVerificationCriteria(this.filterId, types, criteria);
171
+ }
172
+
173
+ /**
174
+ * Get the criteria for cross-verification of a given result item type.
175
+ *
176
+ * @param type Specifies a result item type.
177
+ * @return {Promise<CrossVerificationCriteria>} A promise that resolves the criteria for cross-verification, including parameters such as frameWindow and minConsistentFrames.
178
+ * @see {@link CrossVerificationCriteria}
179
+ * */
180
+ getResultCrossVerificationCriteria(type: EnumCapturedResultItemType | number): Promise<CrossVerificationCriteria> {
181
+ return DynamsoftMultiCrossFilterModule.getResultCrossVerificationCriteria(this.filterId, type);
182
+ }
183
+ }
@@ -1,7 +1,7 @@
1
- import {type TurboModule, TurboModuleRegistry} from "react-native";
2
-
3
- export interface Spec extends TurboModule {
4
- install(): boolean;
5
- }
6
-
7
- export default TurboModuleRegistry.get<Spec>("DynamsoftImageManagerModule") as Spec | null;
1
+ import {type TurboModule, TurboModuleRegistry} from "react-native";
2
+
3
+ export interface Spec extends TurboModule {
4
+ install(): boolean;
5
+ }
6
+
7
+ export default TurboModuleRegistry.get<Spec>("DynamsoftImageManagerModule") as Spec | null;
@@ -1,18 +1,18 @@
1
- import {type TurboModule, TurboModuleRegistry} from "react-native";
2
-
3
- export interface Spec extends TurboModule {
4
- createInstance(): string;
5
- destroy(filterId: string): void;
6
- enableResultCrossVerification(filterId: string, resultItemTypes: number, enable: boolean): void;
7
- isResultCrossVerificationEnabled(filterId: string, type: number): Promise<boolean>;
8
- enableResultDeduplication(filterId: string, resultItemTypes: number, enable: boolean): void;
9
- isResultDeduplicationEnabled(filterId: string, type: number): Promise<boolean>;
10
- setDuplicateForgetTime(filterId: string, resultItemTypes: number, time: number): void;
11
- getDuplicateForgetTime(filterId: string, type: number): Promise<number>;
12
- enableLatestOverlapping(filterId: string, resultItemTypes: number, enable: boolean): void;
13
- isLatestOverlappingEnabled(filterId: string, type: number): Promise<boolean>;
14
- setMaxOverlappingFrames(filterId: string, resultItemTypes: number, maxFrameToCheck: number): void;
15
- getMaxOverlappingFrames(filterId: string, type: number): Promise<number>;
16
- }
17
-
18
- export default TurboModuleRegistry.get<Spec>("DynamsoftMultiCrossFilterModule") as Spec | null;
1
+ import {type TurboModule, TurboModuleRegistry} from "react-native";
2
+
3
+ export interface Spec extends TurboModule {
4
+ createInstance(): string;
5
+ destroy(filterId: string): void;
6
+ enableResultCrossVerification(filterId: string, resultItemTypes: number, enable: boolean): void;
7
+ isResultCrossVerificationEnabled(filterId: string, type: number): Promise<boolean>;
8
+ enableResultDeduplication(filterId: string, resultItemTypes: number, enable: boolean): void;
9
+ isResultDeduplicationEnabled(filterId: string, type: number): Promise<boolean>;
10
+ setDuplicateForgetTime(filterId: string, resultItemTypes: number, time: number): void;
11
+ getDuplicateForgetTime(filterId: string, type: number): Promise<number>;
12
+ enableLatestOverlapping(filterId: string, resultItemTypes: number, enable: boolean): void;
13
+ isLatestOverlappingEnabled(filterId: string, type: number): Promise<boolean>;
14
+ setMaxOverlappingFrames(filterId: string, resultItemTypes: number, maxFrameToCheck: number): void;
15
+ getMaxOverlappingFrames(filterId: string, type: number): Promise<number>;
16
+ }
17
+
18
+ export default TurboModuleRegistry.get<Spec>("DynamsoftMultiCrossFilterModule") as Spec | null;
@@ -1,9 +1,9 @@
1
- import {DynamsoftVersions} from '../VersionsModule'
2
- import {Platform} from "react-native";
3
-
4
- /** @hideconstructor */
5
- export class UtilityModule {
6
- static getVersion(): string {
7
- return '['+Platform.OS+']: ' + DynamsoftVersions.utility
8
- }
9
- }
1
+ import {DynamsoftVersions} from '../VersionsModule'
2
+ import {Platform} from "react-native";
3
+
4
+ /** @hideconstructor */
5
+ export class UtilityModule {
6
+ static getVersion(): string {
7
+ return '['+Platform.OS+']: ' + DynamsoftVersions.utility
8
+ }
9
+ }
@@ -1,5 +1,5 @@
1
- export * from "./UtilityModule"
2
- export * from "./MultiFrameResultCrossFilter"
3
- export * from "./ImageManager"
4
- export * from "./EnumFilterType"
1
+ export * from "./UtilityModule"
2
+ export * from "./MultiFrameResultCrossFilter"
3
+ export * from "./ImageManager"
4
+ export * from "./EnumFilterType"
5
5
  export * from "./CrossVerificationCriteria"
@@ -1,4 +0,0 @@
1
- build
2
- .cxx
3
- .idea
4
- .gradle