dynamsoft-capture-vision-react-native 3.0.5200 → 3.2.3000
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/README.md +5 -2
- package/android/build.gradle +20 -10
- package/android/gradle.properties +3 -3
- package/android/src/main/cpp/JsiCore.cpp +1 -1
- package/android/src/main/cpp/JsiDbr.cpp +208 -23
- package/android/src/main/cpp/JsiDcp.cpp +1 -1
- package/android/src/main/cpp/JsiDlr.cpp +10 -1
- package/android/src/main/cpp/JsiUtility.cpp +470 -62
- package/android/src/main/cpp/JsiUtility.h +13 -3
- package/android/src/main/dysJniLibs/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibs/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor81/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/debug/x86_64/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/arm64-v8a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/armeabi-v7a/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/x86/librn_dys.so +0 -0
- package/android/src/main/dysJniLibsFor82/release/x86_64/librn_dys.so +0 -0
- package/android/src/main/java/com/dynamsoft/reactnativelib/CVRModule.kt +17 -2
- package/android/src/main/java/com/dynamsoft/reactnativelib/CameraViewManager.kt +13 -1
- package/android/src/main/java/com/dynamsoft/reactnativelib/ImageEditorViewManager.kt +1 -1
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/Basic.kt +1 -1
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForCore.kt +1 -2
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForCvr.kt +1 -5
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForDBR.kt +74 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForDCE.kt +33 -13
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForDCP.kt +1 -1
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForDDN.kt +1 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ForDLR.kt +6 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/{utils → basicutils}/ImageUtil.kt +2 -2
- package/android/src/main/java/com/dynamsoft/reactnativelib/cvr/CaptureVisionRouterModuleImpl.kt +25 -5
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraEnhancerModuleImpl.kt +6 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/CameraViewManagerImpl.kt +15 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewManagerImpl.kt +1 -5
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/ImageEditorViewModuleImpl.kt +2 -4
- package/android/src/main/java/com/dynamsoft/reactnativelib/dce/RNCameraView.kt +1 -2
- package/android/src/main/java/com/dynamsoft/reactnativelib/utility/ImageManagerModuleImpl.kt +75 -3
- package/android/src/main/java/com/dynamsoft/reactnativelib/utility/MultiCrossFilterModuleImpl.kt +2 -2
- package/dynamsoft-capture-vision-react-native.podspec +1 -1
- package/ios/CPP/ImageDataHostObject.cpp +1 -1
- package/ios/CPP/ImageDataHostObject.hpp +1 -1
- package/ios/CPP/RNDynamsoft+JSI.h +3 -0
- package/ios/CPP/RNDynamsoft+JSI.mm +119 -2
- package/ios/CPP/RNDynamsoft+Json.m +114 -14
- package/ios/CPP/YeetJSIUtils.h +2 -0
- package/ios/CPP/YeetJSIUtils.mm +15 -0
- package/ios/RNDynamsoftCameraView.h +4 -0
- package/ios/RNDynamsoftCameraView.m +25 -0
- package/ios/RNDynamsoftCameraViewManager.m +8 -2
- package/ios/RNDynamsoftCaptureVisionRouter.mm +149 -92
- package/ios/RNDynamsoftImageEditorViewManager.mm +71 -40
- package/ios/RNDynamsoftImageManager.mm +295 -81
- package/ios/RNDynamsoftImageSourceAdapter.mm +100 -65
- package/package.json +1 -1
- package/src/core/EnumGrayscaleEnhancementMode.tsx +1 -0
- package/src/core/EnumGrayscaleTransformationMode.tsx +1 -0
- package/src/core/EnumImageFileFormat.tsx +6 -0
- package/src/core/index.tsx +1 -0
- package/src/cvr/CaptureVisionRouter.tsx +33 -5
- package/src/dbr/BarcodeDetails.tsx +51 -0
- package/src/dbr/BarcodeResultItem.tsx +11 -0
- package/src/dbr/EnumBarcodeFormat.tsx +2 -0
- package/src/dbr/EnumDeblurMode.tsx +1 -0
- package/src/dbr/EnumLocalizationMode.tsx +1 -0
- package/src/dbr/EnumQRCodeErrorCorrectionLevel.tsx +6 -0
- package/src/dbr/index.tsx +2 -0
- package/src/dce/CameraEnhancer.tsx +14 -6
- package/src/dce/CameraView.tsx +10 -2
- package/src/dce/DynamsoftCameraViewNativeComponent.ts +25 -0
- package/src/dce/EnumCameraPosition.tsx +13 -1
- package/src/dce/EnumEnhancedFeatures.tsx +3 -4
- package/src/dce/ImageEditorView.tsx +1 -1
- package/src/dlr/CharacterResult.tsx +4 -1
- package/src/dlr/SimplifiedLabelRecognizerSettings.tsx +2 -0
- package/src/dlr/TextLineResultItem.tsx +5 -0
- package/src/utility/EnumFilterType.tsx +5 -0
- package/src/utility/ImageManager.tsx +227 -9
- package/src/utility/index.tsx +1 -0
|
@@ -59,6 +59,24 @@ export class CaptureVisionRouter {
|
|
|
59
59
|
return cvr = new CaptureVisionRouter();
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Sets the global number of threads used internally for model execution.
|
|
65
|
+
*
|
|
66
|
+
* @param intraOpNumThreads - Number of threads used internally for model execution. Valid range: [0, 256].
|
|
67
|
+
* If the value is outside the range [0, 256], it will be treated as 0 (default).
|
|
68
|
+
*/
|
|
69
|
+
static setGlobalIntraOpNumThreads(intraOpNumThreads: number) {
|
|
70
|
+
CvrModule.setGlobalIntraOpNumThreads(intraOpNumThreads);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Clears all deep learning models from buffer to free up memory.
|
|
75
|
+
*/
|
|
76
|
+
static clearDLModelBuffers() {
|
|
77
|
+
CvrModule.clearDLModelBuffers();
|
|
78
|
+
}
|
|
79
|
+
|
|
62
80
|
/**
|
|
63
81
|
* Initiates a capturing process based on a specified template. This process is repeated for each image fetched from the source.
|
|
64
82
|
* <p>Code Snippet:</p>
|
|
@@ -101,6 +119,16 @@ export class CaptureVisionRouter {
|
|
|
101
119
|
return CvrModule.stopCapturing()
|
|
102
120
|
}
|
|
103
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Switch the capturing template during the image processing workflow.
|
|
124
|
+
*
|
|
125
|
+
* @param templateName -The name of the new capturing template to apply.
|
|
126
|
+
*
|
|
127
|
+
* @return Promise<void> - A promise that resolves when the template switch is successful. If the template switch fails, the promise will be rejected with an error.
|
|
128
|
+
*/
|
|
129
|
+
switchCapturingTemplate(templateName: string): Promise<void> {
|
|
130
|
+
return CvrModule.switchCapturingTemplate(templateName)
|
|
131
|
+
}
|
|
104
132
|
/**
|
|
105
133
|
* Sets up an image source to provide images for continuous processing.
|
|
106
134
|
* <p>Code Snippet:</p>
|
|
@@ -164,7 +192,7 @@ export class CaptureVisionRouter {
|
|
|
164
192
|
processingDocumentResult.deskewedImageResultItems[i]!!.imageData = imageArr[i]!!;
|
|
165
193
|
}
|
|
166
194
|
}
|
|
167
|
-
if(processingDocumentResult && processingDocumentResult.enhancedImageResultItems && processingDocumentResult.enhancedImageResultItems.length > 0) {
|
|
195
|
+
if (processingDocumentResult && processingDocumentResult.enhancedImageResultItems && processingDocumentResult.enhancedImageResultItems.length > 0) {
|
|
168
196
|
installMethods();
|
|
169
197
|
let imageArr: ImageData[] = global.getCurrentEnhancedImages();
|
|
170
198
|
for (let i = 0; i < processingDocumentResult.enhancedImageResultItems.length; i++) {
|
|
@@ -421,7 +449,7 @@ export class CaptureVisionRouter {
|
|
|
421
449
|
try {
|
|
422
450
|
if (barcodeFormatIds != undefined) {
|
|
423
451
|
settings!!.barcodeSettings!!.barcodeFormatIds = undefined
|
|
424
|
-
let settingsTemp: SimplifiedCaptureVisionSettings = JSON.parse(JSON.stringify(settings));
|
|
452
|
+
let settingsTemp: SimplifiedCaptureVisionSettings = JSON.parse(JSON.stringify(settings)) as SimplifiedCaptureVisionSettings;
|
|
425
453
|
settingsTemp!!.barcodeSettings!!._barcodeFormatIdsNumberString = barcodeFormatIds.toString()
|
|
426
454
|
settings!!.barcodeSettings!!.barcodeFormatIds = barcodeFormatIds
|
|
427
455
|
await CvrModule.updateSettings(settingsTemp, templateName)
|
|
@@ -460,7 +488,7 @@ export class CaptureVisionRouter {
|
|
|
460
488
|
* @param includeDefaultValues - Whether to include default values in the output.
|
|
461
489
|
* @return {Promise<string>} - A promise that resolves a JSON string that contains settings for the specified templateName.
|
|
462
490
|
* */
|
|
463
|
-
outputSettings(templateName: string, includeDefaultValues:boolean): Promise<string> {
|
|
491
|
+
outputSettings(templateName: string, includeDefaultValues: boolean): Promise<string> {
|
|
464
492
|
return CvrModule.outputSettings(templateName, includeDefaultValues)
|
|
465
493
|
}
|
|
466
494
|
|
|
@@ -471,7 +499,7 @@ export class CaptureVisionRouter {
|
|
|
471
499
|
* @param includeDefaultValues - Whether to include default values in the output.
|
|
472
500
|
* @return {Promise<void>} - A promise that resolves or rejected with an error when the operation has completed.
|
|
473
501
|
* */
|
|
474
|
-
outputSettingsToFile(templateName: string, file: string, includeDefaultValues:boolean): Promise<void> {
|
|
502
|
+
outputSettingsToFile(templateName: string, file: string, includeDefaultValues: boolean): Promise<void> {
|
|
475
503
|
return CvrModule.outputSettingsToFile(templateName, file, includeDefaultValues)
|
|
476
504
|
}
|
|
477
505
|
|
|
@@ -610,7 +638,7 @@ export class IntermediateResultManager {
|
|
|
610
638
|
* @param imageHashId - The image hash ID. Get from {@link CapturedResult.originalImageHashId}, {@link DecodedBarcodesResult.originalImageHashId},
|
|
611
639
|
* {@link ProcessedDocumentResult.originalImageHashId}, {@link RecognizedTextLinesResult.originalImageHashId}.
|
|
612
640
|
*
|
|
613
|
-
* @remarks `Do not call this method outside the CapturedResultReceiver callback where you get the hashId, otherwise you will not get any valid ImageData.`
|
|
641
|
+
* @remarks `Do not call this method after calling stopCapturing() or outside the CapturedResultReceiver callback where you get the hashId, otherwise you will not get any valid ImageData.`
|
|
614
642
|
* @see {@link CaptureVisionRouter.addResultReceiver}
|
|
615
643
|
* @see {@link CapturedResultReceiver}
|
|
616
644
|
* */
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {EnumQRCodeErrorCorrectionLevel} from "./EnumQRCodeErrorCorrectionLevel";
|
|
2
|
+
|
|
3
|
+
export interface QRCodeDetails {
|
|
4
|
+
rows: number;
|
|
5
|
+
columns: number;
|
|
6
|
+
errorCorrectionLevel: number;
|
|
7
|
+
version: number;
|
|
8
|
+
model: number;
|
|
9
|
+
mode: number;
|
|
10
|
+
page: number;
|
|
11
|
+
totalPage: number;
|
|
12
|
+
parityData: number;
|
|
13
|
+
dataMaskPattern: number;
|
|
14
|
+
codewords: number[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export interface DataMatrixDetails {
|
|
19
|
+
rows: number;
|
|
20
|
+
columns: number;
|
|
21
|
+
dataRegionRows: number;
|
|
22
|
+
dataRegionColumns: number;
|
|
23
|
+
dataRegionNumber: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface PDF417Details {
|
|
27
|
+
rows: number;
|
|
28
|
+
columns: number;
|
|
29
|
+
errorCorrectionLevel: EnumQRCodeErrorCorrectionLevel;
|
|
30
|
+
hasLeftRowIndicator: boolean;
|
|
31
|
+
hasRightRowIndicator: boolean;
|
|
32
|
+
codewords: number[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AztecDetails {
|
|
36
|
+
rows: number;
|
|
37
|
+
columns: number;
|
|
38
|
+
layerNumber: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface OneDCodeDetails {
|
|
42
|
+
startCharsBytes: number[];
|
|
43
|
+
stopCharsBytes: number[];
|
|
44
|
+
checkDigitBytes: number[];
|
|
45
|
+
startPatternRange_lower: number;
|
|
46
|
+
startPatternRange_upper: number;
|
|
47
|
+
middlePatternRange_lower: number;
|
|
48
|
+
middlePatternRange_upper: number;
|
|
49
|
+
endPatternRange_lower: number;
|
|
50
|
+
endPatternRange_upper: number;
|
|
51
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {CapturedResultItem, Quadrilateral, EnumCapturedResultItemType} from "../core";
|
|
2
2
|
import type {EnumBarcodeFormat} from "./EnumBarcodeFormat";
|
|
3
|
+
import type {AztecDetails, DataMatrixDetails, OneDCodeDetails, PDF417Details, QRCodeDetails} from "./BarcodeDetails";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Interface BarcodeResultItem extends {@link CapturedResultItem}, represents a barcode result item decoded by barcode reader engine.
|
|
@@ -42,4 +43,14 @@ export interface BarcodeResultItem extends CapturedResultItem{
|
|
|
42
43
|
|
|
43
44
|
/**Indicates whether the barcode is a Direct Part Marking (DPM) barcode.*/
|
|
44
45
|
isDPM: boolean;
|
|
46
|
+
|
|
47
|
+
qrCodeDetails?: QRCodeDetails;
|
|
48
|
+
|
|
49
|
+
oneDCodeDetails?: OneDCodeDetails;
|
|
50
|
+
|
|
51
|
+
dataMatrixDetails?: DataMatrixDetails;
|
|
52
|
+
|
|
53
|
+
pdf417Details?: PDF417Details;
|
|
54
|
+
|
|
55
|
+
aztecDetails?: AztecDetails;
|
|
45
56
|
}
|
|
@@ -81,6 +81,8 @@ const EnumBarcodeFormat = {
|
|
|
81
81
|
BF_TWO_DIGIT_ADD_ON:BigInt(0x400000),
|
|
82
82
|
BF_FIVE_DIGIT_ADD_ON:BigInt(0x800000),
|
|
83
83
|
BF_MATRIX_25:BigInt(0x1000000000),
|
|
84
|
+
BF_TELEPEN:BigInt(0x2000000000),
|
|
85
|
+
BF_TELEPEN_NUMERIC:BigInt(0x4000000000),
|
|
84
86
|
|
|
85
87
|
/**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC.*/
|
|
86
88
|
BF_POSTALCODE:BigInt(0x3F0000000000000),
|
package/src/dbr/index.tsx
CHANGED
|
@@ -4,4 +4,6 @@ export * from "./DecodedBarcodesResult"
|
|
|
4
4
|
export * from "./EnumBarcodeFormat"
|
|
5
5
|
export * from "./EnumDeblurMode"
|
|
6
6
|
export * from "./EnumLocalizationMode"
|
|
7
|
+
export * from "./BarcodeDetails"
|
|
8
|
+
export * from "./EnumQRCodeErrorCorrectionLevel"
|
|
7
9
|
export type {SimplifiedBarcodeReaderSettings} from "./SimplifiedBarcodeReaderSettings"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ImageSourceAdapter, type DSRect} from "../core";
|
|
2
2
|
import {NativeModules, Platform} from "react-native";
|
|
3
3
|
import {CameraView} from "./CameraView"
|
|
4
|
-
import
|
|
4
|
+
import {EnumCameraPosition} from "./EnumCameraPosition";
|
|
5
5
|
import type {EnumFocusMode} from "./EnumFocusMode";
|
|
6
6
|
import type {EnumEnhancedFeatures} from "./EnumEnhancedFeatures";
|
|
7
7
|
import type {EnumResolution} from "./EnumResolution";
|
|
@@ -86,17 +86,25 @@ export class CameraEnhancer extends ImageSourceAdapter {
|
|
|
86
86
|
*
|
|
87
87
|
* @param view - the CameraView element
|
|
88
88
|
* */
|
|
89
|
-
setCameraView(view: CameraView) {
|
|
89
|
+
setCameraView(view: CameraView | null) {
|
|
90
90
|
if (view) {
|
|
91
91
|
DynamsoftCameraEnhancerModule.setCameraView(view.nativeCameraViewHandle);
|
|
92
|
+
} else {
|
|
93
|
+
DynamsoftCameraEnhancerModule.setCameraView(0);
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
|
|
95
97
|
/**
|
|
96
98
|
* Select a camera with a camera position.
|
|
97
99
|
* @param position - One of the {@link EnumCameraPosition}
|
|
100
|
+
* @note {@link EnumCameraPosition.CP_BACK_DUAL_WIDE_AUTO} and {@link EnumCameraPosition.CP_BACK_ULTRA_WIDE} are only supported on iOS.
|
|
98
101
|
* */
|
|
99
102
|
selectCamera(position: EnumCameraPosition | number) {
|
|
103
|
+
if(Platform.OS !== "ios") {
|
|
104
|
+
if (position === EnumCameraPosition.CP_BACK_DUAL_WIDE_AUTO || position === EnumCameraPosition.CP_BACK_ULTRA_WIDE) {
|
|
105
|
+
position = EnumCameraPosition.CP_BACK;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
100
108
|
DynamsoftCameraEnhancerModule.selectCamera(position);
|
|
101
109
|
}
|
|
102
110
|
|
|
@@ -179,10 +187,10 @@ export class CameraEnhancer extends ImageSourceAdapter {
|
|
|
179
187
|
*
|
|
180
188
|
*```
|
|
181
189
|
* let scanRegion = {
|
|
182
|
-
* top: 25,
|
|
183
|
-
* bottom: 75,
|
|
184
|
-
* left: 25,
|
|
185
|
-
* right: 75,
|
|
190
|
+
* top: 0.25,
|
|
191
|
+
* bottom: 0.75,
|
|
192
|
+
* left: 0.25,
|
|
193
|
+
* right: 0.75,
|
|
186
194
|
* measuredInPercentage: true,
|
|
187
195
|
* }
|
|
188
196
|
* cameraEnhancer.setScanRegion(scanRegion);
|
package/src/dce/CameraView.tsx
CHANGED
|
@@ -25,8 +25,10 @@ const transformToNativeCameraViewProps = (props: CameraViewNativeProps | undefin
|
|
|
25
25
|
scanLaserVisible: props?.scanLaserVisible,
|
|
26
26
|
torchButton: props?.torchButton,
|
|
27
27
|
torchButtonVisible: props?.torchButtonVisible,
|
|
28
|
+
cameraToggleButton: props?.cameraToggleButton,
|
|
29
|
+
cameraToggleButtonVisible: props?.cameraToggleButtonVisible,
|
|
28
30
|
}
|
|
29
|
-
))
|
|
31
|
+
)) as CameraViewNativeProps
|
|
30
32
|
}
|
|
31
33
|
type RefType = React.Component<CameraViewNativeProps> & Readonly<NativeMethods>;
|
|
32
34
|
|
|
@@ -48,7 +50,7 @@ const NativeCameraView: HostComponent<CameraViewNativeProps> = isTurboModuleEnab
|
|
|
48
50
|
* @see {@link CameraEnhancer.setCameraView}
|
|
49
51
|
*/
|
|
50
52
|
export class CameraView extends Component<CameraViewNativeProps, any> {
|
|
51
|
-
private readonly nativeCameraViewRef: React.RefObject<RefType> = React.createRef<RefType>();
|
|
53
|
+
private readonly nativeCameraViewRef: React.RefObject<RefType | null> = React.createRef<RefType>();
|
|
52
54
|
private readonly nativeProps = transformToNativeCameraViewProps(this.props)
|
|
53
55
|
|
|
54
56
|
/** @internal */
|
|
@@ -56,6 +58,12 @@ export class CameraView extends Component<CameraViewNativeProps, any> {
|
|
|
56
58
|
return findNodeHandle(this.nativeCameraViewRef.current);
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
componentDidMount() {
|
|
62
|
+
if(this.nativeProps.torchButton?.visible !== undefined) {
|
|
63
|
+
console.warn("The `torchButton.visible` property of CameraView has been deprecated, please use the `torchButtonVisible` property of CameraView")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
59
67
|
componentDidUpdate(prevProps: CameraViewNativeProps) {
|
|
60
68
|
let nativePreProps = transformToNativeCameraViewProps(prevProps)
|
|
61
69
|
let nativeProps = transformToNativeCameraViewProps(this.props)
|
|
@@ -64,6 +64,31 @@ export interface CameraViewNativeProps extends ViewProps {
|
|
|
64
64
|
* Set the visibility of the torch button. Default is false.
|
|
65
65
|
* */
|
|
66
66
|
torchButtonVisible?: boolean
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Add a camera toggle button that can switch camera position on your view.
|
|
70
|
+
* */
|
|
71
|
+
cameraToggleButton?: {
|
|
72
|
+
/**
|
|
73
|
+
* Set the top-left point and width and height of the camera toggle button.(All by px)
|
|
74
|
+
* */
|
|
75
|
+
location?: {
|
|
76
|
+
x?: Int32;
|
|
77
|
+
y?: Int32;
|
|
78
|
+
width?: Int32;
|
|
79
|
+
height?: Int32;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The camera toggle button image.
|
|
84
|
+
* */
|
|
85
|
+
cameraToggleImageBase64?: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Set the visibility of the camera toggle button. Default is false.
|
|
90
|
+
* */
|
|
91
|
+
cameraToggleButtonVisible?: boolean
|
|
67
92
|
}
|
|
68
93
|
|
|
69
94
|
export default codegenNativeComponent<CameraViewNativeProps>(
|
|
@@ -9,5 +9,17 @@ export enum EnumCameraPosition {
|
|
|
9
9
|
/**
|
|
10
10
|
* Use the front-facing camera.
|
|
11
11
|
*/
|
|
12
|
-
CP_FRONT
|
|
12
|
+
CP_FRONT,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Use the ultra-wide back-facing camera.
|
|
16
|
+
* @note iOS only. This option is not available on other platforms.
|
|
17
|
+
*/
|
|
18
|
+
CP_BACK_ULTRA_WIDE,
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Use the ultra-wide back-facing camera.
|
|
22
|
+
* @note iOS only. This option is not available on other platforms.
|
|
23
|
+
*/
|
|
24
|
+
CP_BACK_DUAL_WIDE_AUTO,
|
|
13
25
|
}
|
|
@@ -12,14 +12,13 @@ export enum EnumEnhancedFeatures {
|
|
|
12
12
|
|
|
13
13
|
/**`Enhanced Focus`: The enhanced focus feature. DCE will support the camera in triggering auto-focus.*/
|
|
14
14
|
EF_ENHANCED_FOCUS = 4,
|
|
15
|
-
EF_FAST_MODE = 8,
|
|
16
15
|
|
|
17
16
|
/**`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 =
|
|
17
|
+
EF_AUTO_ZOOM = 8,
|
|
19
18
|
|
|
20
19
|
/**`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 =
|
|
20
|
+
EF_SMART_TORCH = 16,
|
|
22
21
|
|
|
23
22
|
/**Enable all.*/
|
|
24
|
-
EF_ALL =
|
|
23
|
+
EF_ALL = 31
|
|
25
24
|
}
|
|
@@ -52,7 +52,7 @@ type RefType = React.Component<ImageEditorViewNativeProps> & Readonly<NativeMeth
|
|
|
52
52
|
*/
|
|
53
53
|
export class ImageEditorView extends Component<ImageEditorViewNativeProps, any> {
|
|
54
54
|
// A Ref object pointing to the native ImageEditorView
|
|
55
|
-
private readonly nativeImageEditorViewRef: React.RefObject<RefType> = React.createRef<RefType>();
|
|
55
|
+
private readonly nativeImageEditorViewRef: React.RefObject<RefType | null> = React.createRef<RefType>();
|
|
56
56
|
private drawingQuads: Array<Quadrilateral> | null | undefined;
|
|
57
57
|
|
|
58
58
|
/** @internal */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import {Quadrilateral} from "../core";
|
|
2
2
|
/**
|
|
3
3
|
* The CharacterResult interface represents the result of a character recognition process.
|
|
4
4
|
* It contains the characters recognized (high, medium, and low confidence),
|
|
@@ -22,4 +22,7 @@ export interface CharacterResult {
|
|
|
22
22
|
|
|
23
23
|
/**The confidence of the character with low confidence.*/
|
|
24
24
|
characterLConfidence: number;
|
|
25
|
+
|
|
26
|
+
/**The location of the character in a quadrilateral shape.*/
|
|
27
|
+
location: Quadrilateral;
|
|
25
28
|
}
|
|
@@ -27,5 +27,7 @@ export interface SimplifiedLabelRecognizerSettings {
|
|
|
27
27
|
|
|
28
28
|
/**Sets the threshold value that determines when the original image is scaled down.*/
|
|
29
29
|
scaleDownThreshold?: number
|
|
30
|
+
|
|
31
|
+
/**Sets the maximum number of threads to be used in one task.*/
|
|
30
32
|
maxThreadsInOneTask?: number
|
|
31
33
|
}
|