zedbar 0.2.4 → 0.2.5
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/package.json +1 -1
- package/zedbar.d.ts +9 -9
- package/zedbar.js +19 -19
- package/zedbar_bg.wasm +0 -0
package/package.json
CHANGED
package/zedbar.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* Scan grayscale image data for barcodes and QR codes.
|
|
5
|
-
*
|
|
6
|
-
* `data` must be an array of 8-bit grayscale pixel values,
|
|
7
|
-
* row-major, with dimensions `width` x `height`.
|
|
8
|
-
*
|
|
9
|
-
* Returns an array of `DecodeResult` objects.
|
|
10
|
-
*/
|
|
11
|
-
export function scanGrayscale(data: Uint8Array, width: number, height: number, options?: ScanOptions | null): DecodeResult[];
|
|
12
3
|
/**
|
|
13
4
|
* Scan an encoded image (PNG, JPEG, BMP, WebP) for barcodes and QR codes.
|
|
14
5
|
*
|
|
@@ -21,6 +12,15 @@ export function scanGrayscale(data: Uint8Array, width: number, height: number, o
|
|
|
21
12
|
* Returns an array of `DecodeResult` objects.
|
|
22
13
|
*/
|
|
23
14
|
export function scanImageBytes(bytes: Uint8Array, options?: ScanOptions | null): DecodeResult[];
|
|
15
|
+
/**
|
|
16
|
+
* Scan grayscale image data for barcodes and QR codes.
|
|
17
|
+
*
|
|
18
|
+
* `data` must be an array of 8-bit grayscale pixel values,
|
|
19
|
+
* row-major, with dimensions `width` x `height`.
|
|
20
|
+
*
|
|
21
|
+
* Returns an array of `DecodeResult` objects.
|
|
22
|
+
*/
|
|
23
|
+
export function scanGrayscale(data: Uint8Array, width: number, height: number, options?: ScanOptions | null): DecodeResult[];
|
|
24
24
|
/**
|
|
25
25
|
* A decoded barcode/QR code result.
|
|
26
26
|
*/
|
package/zedbar.js
CHANGED
|
@@ -74,27 +74,28 @@ function getArrayJsValueFromWasm0(ptr, len) {
|
|
|
74
74
|
return result;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Scan
|
|
77
|
+
* Scan an encoded image (PNG, JPEG, BMP, WebP) for barcodes and QR codes.
|
|
78
78
|
*
|
|
79
|
-
* `
|
|
80
|
-
*
|
|
79
|
+
* `bytes` should contain the raw bytes of an image file in one of the
|
|
80
|
+
* supported formats: PNG, JPEG, BMP, or WebP.
|
|
81
|
+
*
|
|
82
|
+
* The image will be automatically decoded and converted to grayscale
|
|
83
|
+
* before scanning.
|
|
81
84
|
*
|
|
82
85
|
* Returns an array of `DecodeResult` objects.
|
|
83
|
-
* @param {Uint8Array}
|
|
84
|
-
* @param {number} width
|
|
85
|
-
* @param {number} height
|
|
86
|
+
* @param {Uint8Array} bytes
|
|
86
87
|
* @param {ScanOptions | null} [options]
|
|
87
88
|
* @returns {DecodeResult[]}
|
|
88
89
|
*/
|
|
89
|
-
exports.
|
|
90
|
-
const ptr0 = passArray8ToWasm0(
|
|
90
|
+
exports.scanImageBytes = function(bytes, options) {
|
|
91
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
91
92
|
const len0 = WASM_VECTOR_LEN;
|
|
92
93
|
let ptr1 = 0;
|
|
93
94
|
if (!isLikeNone(options)) {
|
|
94
95
|
_assertClass(options, ScanOptions);
|
|
95
96
|
ptr1 = options.__destroy_into_raw();
|
|
96
97
|
}
|
|
97
|
-
const ret = wasm.
|
|
98
|
+
const ret = wasm.scanImageBytes(ptr0, len0, ptr1);
|
|
98
99
|
if (ret[3]) {
|
|
99
100
|
throw takeFromExternrefTable0(ret[2]);
|
|
100
101
|
}
|
|
@@ -104,28 +105,27 @@ exports.scanGrayscale = function(data, width, height, options) {
|
|
|
104
105
|
};
|
|
105
106
|
|
|
106
107
|
/**
|
|
107
|
-
* Scan
|
|
108
|
-
*
|
|
109
|
-
* `bytes` should contain the raw bytes of an image file in one of the
|
|
110
|
-
* supported formats: PNG, JPEG, BMP, or WebP.
|
|
108
|
+
* Scan grayscale image data for barcodes and QR codes.
|
|
111
109
|
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
110
|
+
* `data` must be an array of 8-bit grayscale pixel values,
|
|
111
|
+
* row-major, with dimensions `width` x `height`.
|
|
114
112
|
*
|
|
115
113
|
* Returns an array of `DecodeResult` objects.
|
|
116
|
-
* @param {Uint8Array}
|
|
114
|
+
* @param {Uint8Array} data
|
|
115
|
+
* @param {number} width
|
|
116
|
+
* @param {number} height
|
|
117
117
|
* @param {ScanOptions | null} [options]
|
|
118
118
|
* @returns {DecodeResult[]}
|
|
119
119
|
*/
|
|
120
|
-
exports.
|
|
121
|
-
const ptr0 = passArray8ToWasm0(
|
|
120
|
+
exports.scanGrayscale = function(data, width, height, options) {
|
|
121
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
122
122
|
const len0 = WASM_VECTOR_LEN;
|
|
123
123
|
let ptr1 = 0;
|
|
124
124
|
if (!isLikeNone(options)) {
|
|
125
125
|
_assertClass(options, ScanOptions);
|
|
126
126
|
ptr1 = options.__destroy_into_raw();
|
|
127
127
|
}
|
|
128
|
-
const ret = wasm.
|
|
128
|
+
const ret = wasm.scanGrayscale(ptr0, len0, width, height, ptr1);
|
|
129
129
|
if (ret[3]) {
|
|
130
130
|
throw takeFromExternrefTable0(ret[2]);
|
|
131
131
|
}
|
package/zedbar_bg.wasm
CHANGED
|
Binary file
|