rxing-wasm 0.2.4 → 0.2.6

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": "rxing-wasm",
3
3
  "description": "wasm bindings for rxing to provide commong barcode operations (decode/encode)",
4
- "version": "0.2.4",
4
+ "version": "0.2.6",
5
5
  "license": "Apache 2.0",
6
6
  "repository": {
7
7
  "type": "git",
package/rxing_wasm.d.ts CHANGED
@@ -25,9 +25,10 @@ export function encode_barcode_with_hints(data: string, width: number, height: n
25
25
  * @param {number} width
26
26
  * @param {number} height
27
27
  * @param {boolean | undefined} try_harder
28
+ * @param {boolean | undefined} filter_image
28
29
  * @returns {BarcodeResult}
29
30
  */
30
- export function decode_barcode(data: Uint8Array, width: number, height: number, try_harder?: boolean): BarcodeResult;
31
+ export function decode_barcode(data: Uint8Array, width: number, height: number, try_harder?: boolean, filter_image?: boolean): BarcodeResult;
31
32
  /**
32
33
  * Convert a javascript image context's data into luma 8.
33
34
  *
@@ -55,9 +56,10 @@ export function decode_barcode_rgb(data: Uint32Array, width: number, height: num
55
56
  * @param {number} width
56
57
  * @param {number} height
57
58
  * @param {DecodeHintDictionary} hints
59
+ * @param {boolean | undefined} filter_image
58
60
  * @returns {BarcodeResult}
59
61
  */
60
- export function decode_barcode_with_hints(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary): BarcodeResult;
62
+ export function decode_barcode_with_hints(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary, filter_image?: boolean): BarcodeResult;
61
63
  /**
62
64
  * @param {Uint8Array} data
63
65
  * @param {number} width
package/rxing_wasm_bg.js CHANGED
@@ -220,14 +220,15 @@ function isLikeNone(x) {
220
220
  * @param {number} width
221
221
  * @param {number} height
222
222
  * @param {boolean | undefined} try_harder
223
+ * @param {boolean | undefined} filter_image
223
224
  * @returns {BarcodeResult}
224
225
  */
225
- export function decode_barcode(data, width, height, try_harder) {
226
+ export function decode_barcode(data, width, height, try_harder, filter_image) {
226
227
  try {
227
228
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
228
229
  const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
229
230
  const len0 = WASM_VECTOR_LEN;
230
- wasm.decode_barcode(retptr, ptr0, len0, width, height, isLikeNone(try_harder) ? 0xFFFFFF : try_harder ? 1 : 0);
231
+ wasm.decode_barcode(retptr, ptr0, len0, width, height, isLikeNone(try_harder) ? 0xFFFFFF : try_harder ? 1 : 0, isLikeNone(filter_image) ? 0xFFFFFF : filter_image ? 1 : 0);
231
232
  var r0 = getInt32Memory0()[retptr / 4 + 0];
232
233
  var r1 = getInt32Memory0()[retptr / 4 + 1];
233
234
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -314,15 +315,16 @@ export function decode_barcode_rgb(data, width, height, try_harder) {
314
315
  * @param {number} width
315
316
  * @param {number} height
316
317
  * @param {DecodeHintDictionary} hints
318
+ * @param {boolean | undefined} filter_image
317
319
  * @returns {BarcodeResult}
318
320
  */
319
- export function decode_barcode_with_hints(data, width, height, hints) {
321
+ export function decode_barcode_with_hints(data, width, height, hints, filter_image) {
320
322
  try {
321
323
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
322
324
  const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
323
325
  const len0 = WASM_VECTOR_LEN;
324
326
  _assertClass(hints, DecodeHintDictionary);
325
- wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.ptr);
327
+ wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.ptr, isLikeNone(filter_image) ? 0xFFFFFF : filter_image ? 1 : 0);
326
328
  var r0 = getInt32Memory0()[retptr / 4 + 0];
327
329
  var r1 = getInt32Memory0()[retptr / 4 + 1];
328
330
  var r2 = getInt32Memory0()[retptr / 4 + 2];
Binary file