zedbar 0.4.0 → 0.4.1

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.4.0",
4
+ "version": "0.4.1",
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
  * Axis-aligned bounding rectangle of a decoded symbol in image
26
26
  * coordinates. `width` and `height` are reported as `max - min` of the
package/zedbar.js CHANGED
@@ -142,28 +142,27 @@ function takeFromExternrefTable0(idx) {
142
142
  return value;
143
143
  }
144
144
  /**
145
- * Scan an encoded image (PNG, JPEG, BMP, WebP) for barcodes and QR codes.
146
- *
147
- * `bytes` should contain the raw bytes of an image file in one of the
148
- * supported formats: PNG, JPEG, BMP, or WebP.
145
+ * Scan grayscale image data for barcodes and QR codes.
149
146
  *
150
- * The image will be automatically decoded and converted to grayscale
151
- * before scanning.
147
+ * `data` must be an array of 8-bit grayscale pixel values,
148
+ * row-major, with dimensions `width` x `height`.
152
149
  *
153
150
  * Returns an array of `DecodeResult` objects.
154
- * @param {Uint8Array} bytes
151
+ * @param {Uint8Array} data
152
+ * @param {number} width
153
+ * @param {number} height
155
154
  * @param {ScanOptions | null} [options]
156
155
  * @returns {DecodeResult[]}
157
156
  */
158
- exports.scanImageBytes = function(bytes, options) {
159
- const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
157
+ exports.scanGrayscale = function(data, width, height, options) {
158
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
160
159
  const len0 = WASM_VECTOR_LEN;
161
160
  let ptr1 = 0;
162
161
  if (!isLikeNone(options)) {
163
162
  _assertClass(options, ScanOptions);
164
163
  ptr1 = options.__destroy_into_raw();
165
164
  }
166
- const ret = wasm.scanImageBytes(ptr0, len0, ptr1);
165
+ const ret = wasm.scanGrayscale(ptr0, len0, width, height, ptr1);
167
166
  if (ret[3]) {
168
167
  throw takeFromExternrefTable0(ret[2]);
169
168
  }
@@ -173,27 +172,28 @@ exports.scanImageBytes = function(bytes, options) {
173
172
  };
174
173
 
175
174
  /**
176
- * Scan grayscale image data for barcodes and QR codes.
175
+ * Scan an encoded image (PNG, JPEG, BMP, WebP) for barcodes and QR codes.
177
176
  *
178
- * `data` must be an array of 8-bit grayscale pixel values,
179
- * row-major, with dimensions `width` x `height`.
177
+ * `bytes` should contain the raw bytes of an image file in one of the
178
+ * supported formats: PNG, JPEG, BMP, or WebP.
179
+ *
180
+ * The image will be automatically decoded and converted to grayscale
181
+ * before scanning.
180
182
  *
181
183
  * Returns an array of `DecodeResult` objects.
182
- * @param {Uint8Array} data
183
- * @param {number} width
184
- * @param {number} height
184
+ * @param {Uint8Array} bytes
185
185
  * @param {ScanOptions | null} [options]
186
186
  * @returns {DecodeResult[]}
187
187
  */
188
- exports.scanGrayscale = function(data, width, height, options) {
189
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
188
+ exports.scanImageBytes = function(bytes, options) {
189
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
190
190
  const len0 = WASM_VECTOR_LEN;
191
191
  let ptr1 = 0;
192
192
  if (!isLikeNone(options)) {
193
193
  _assertClass(options, ScanOptions);
194
194
  ptr1 = options.__destroy_into_raw();
195
195
  }
196
- const ret = wasm.scanGrayscale(ptr0, len0, width, height, ptr1);
196
+ const ret = wasm.scanImageBytes(ptr0, len0, ptr1);
197
197
  if (ret[3]) {
198
198
  throw takeFromExternrefTable0(ret[2]);
199
199
  }
package/zedbar_bg.wasm CHANGED
Binary file