Skip to content

Commit d2546c0

Browse files
committed
update readme
1 parent 2192b62 commit d2546c0

File tree

2 files changed

+106
-10
lines changed

2 files changed

+106
-10
lines changed

README.md

Lines changed: 105 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,127 @@
1+
12
# vision-camera-dynamsoft-barcode-reader
23

3-
React Native Vision Camera Frame Processor Plugin of Dynamsoft Barcode Reader
4+
React Native Vision Camera Frame Processor Plugin of [Dynamsoft Barcode Reader](https://www.dynamsoft.com/barcode-reader/overview/).
5+
6+
## Versions
7+
8+
For vision-camera v2, use versions 0.x.
9+
10+
For vision-camera v3, use versions 1.x.
11+
12+
For vision-camera v4, use versions >= 2.0.0.
413

514
## Installation
615

716
```sh
8-
npm install vision-camera-dynamsoft-barcode-reader
17+
yarn add vision-camera-dynamsoft-barcode-reader
18+
cd ios && pod install
919
```
1020

21+
Add the plugin to your `babel.config.js`:
22+
23+
```js
24+
module.exports = {
25+
plugins: [['react-native-worklets-core/plugin']],
26+
// ...
27+
```
28+
29+
> Note: You have to restart metro-bundler for changes in the `babel.config.js` file to take effect.
30+
1131
## Usage
1232
33+
1. Scan barcodes with vision camera.
34+
35+
```js
36+
import { decode } from 'vision-camera-dynamsoft-barcode-reader';
37+
38+
// ...
39+
const frameProcessor = useFrameProcessor((frame) => {
40+
'worklet';
41+
const barcodes = decode(frame);
42+
}, []);
43+
```
44+
45+
2. Scan barcodes from a base64-encoded static image.
46+
47+
```ts
48+
let results = await decodeBase64(base64);
49+
```
50+
51+
3. License initialization ([apply for a trial license](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr)).
52+
53+
```ts
54+
await initLicense("your license");
55+
```
56+
57+
### Interfaces
58+
59+
TextResult:
60+
1361
```js
14-
import { multiply } from 'vision-camera-dynamsoft-barcode-reader';
62+
TextResult{
63+
barcodeText:string;
64+
barcodeFormat:string;
65+
barcodeBytesBase64:string;
66+
x1:number;
67+
x2:number;
68+
x3:number;
69+
x4:number;
70+
y1:number;
71+
y2:number;
72+
y3:number;
73+
y4:number;
74+
}
75+
```
1576
16-
// ...
77+
Configuration:
1778
18-
const result = await multiply(3, 7);
79+
```js
80+
DBRConfig{
81+
template?:string;
82+
license?:string;
83+
isFront?:boolean;
84+
rotateImage?:boolean;
85+
}
1986
```
2087
88+
`isFront` and `rotateImage` are Android-only. Since the natural camera sensor's orientation in Android is landscape, the camera image may be rotated for preview while the raw image we get is still not rotated. If we enable `rotateImage`, the plugin will rotate the image automatically to match the camera preview. If it is disabled, the plugin will rotate the returned coordinates instead of the image which may have a slight performance gain. `isFront` is needed for rotating the coordinates since the image of front camera is mirrored.
89+
90+
## Supported Platforms
91+
92+
* Android
93+
* iOS
94+
95+
## Supported Barcode Symbologies
96+
97+
* Code 11
98+
* Code 39
99+
* Code 93
100+
* Code 128
101+
* Codabar
102+
* EAN-8
103+
* EAN-13
104+
* UPC-A
105+
* UPC-E
106+
* Interleaved 2 of 5 (ITF)
107+
* Industrial 2 of 5 (Code 2 of 5 Industry, Standard 2 of 5, Code 2 of 5)
108+
* ITF-14
109+
* QRCode
110+
* DataMatrix
111+
* PDF417
112+
* GS1 DataBar
113+
* Maxicode
114+
* Micro PDF417
115+
* Micro QR
116+
* PatchCode
117+
* GS1 Composite
118+
* Postal Code
119+
* Dot Code
120+
21121
## Contributing
22122
23123
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
24124
25125
## License
26126
27127
MIT
28-
29-
---
30-
31-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vision-camera-dynamsoft-barcode-reader",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"description": "React Native Vision Camera Frame Processor Plugin of Dynamsoft Barcode Reader",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)