zedbar 0.2.3 → 0.2.4

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