rxing-wasm 0.1.21 → 0.1.23
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/README.md +13 -1
- package/package.json +1 -1
- package/rxing_wasm.d.ts +20 -0
- package/rxing_wasm_bg.js +62 -0
- package/rxing_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -91,4 +91,16 @@ pub fn decode_barcode_with_hints(
|
|
|
91
91
|
height: u32,
|
|
92
92
|
hints: &mut decode_hints::DecodeHintDictionary,
|
|
93
93
|
) -> Result<BarcodeResult, String>;
|
|
94
|
-
```
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```rust
|
|
97
|
+
pub fn decode_multi(
|
|
98
|
+
data: Vec<u8>,
|
|
99
|
+
width: u32,
|
|
100
|
+
height: u32,
|
|
101
|
+
hints: &mut decode_hints::DecodeHintDictionary,
|
|
102
|
+
) -> Result<MultiDecodeResult, String>;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Beta Features
|
|
106
|
+
`decode_multi` is currently in beta. The output may be unexpected, or undefined. Please use with caution. The interface may be unstable, and change.
|
package/package.json
CHANGED
package/rxing_wasm.d.ts
CHANGED
|
@@ -49,6 +49,14 @@ export function decode_barcode_rgb(data: Uint32Array, width: number, height: num
|
|
|
49
49
|
*/
|
|
50
50
|
export function decode_barcode_with_hints(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary): BarcodeResult;
|
|
51
51
|
/**
|
|
52
|
+
* @param {Uint8Array} data
|
|
53
|
+
* @param {number} width
|
|
54
|
+
* @param {number} height
|
|
55
|
+
* @param {DecodeHintDictionary} hints
|
|
56
|
+
* @returns {MultiDecodeResult}
|
|
57
|
+
*/
|
|
58
|
+
export function decode_multi(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary): MultiDecodeResult;
|
|
59
|
+
/**
|
|
52
60
|
* Available barcode types
|
|
53
61
|
*/
|
|
54
62
|
export enum BarcodeFormat {
|
|
@@ -271,3 +279,15 @@ export class DecodeHintDictionary {
|
|
|
271
279
|
*/
|
|
272
280
|
remove_hint(hint: number): boolean;
|
|
273
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
*/
|
|
284
|
+
export class MultiDecodeResult {
|
|
285
|
+
free(): void;
|
|
286
|
+
/**
|
|
287
|
+
*/
|
|
288
|
+
constructor();
|
|
289
|
+
/**
|
|
290
|
+
* @returns {BarcodeResult | undefined}
|
|
291
|
+
*/
|
|
292
|
+
next(): BarcodeResult | undefined;
|
|
293
|
+
}
|
package/rxing_wasm_bg.js
CHANGED
|
@@ -302,6 +302,32 @@ export function decode_barcode_with_hints(data, width, height, hints) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
+
/**
|
|
306
|
+
* @param {Uint8Array} data
|
|
307
|
+
* @param {number} width
|
|
308
|
+
* @param {number} height
|
|
309
|
+
* @param {DecodeHintDictionary} hints
|
|
310
|
+
* @returns {MultiDecodeResult}
|
|
311
|
+
*/
|
|
312
|
+
export function decode_multi(data, width, height, hints) {
|
|
313
|
+
try {
|
|
314
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
315
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
_assertClass(hints, DecodeHintDictionary);
|
|
318
|
+
wasm.decode_multi(retptr, ptr0, len0, width, height, hints.ptr);
|
|
319
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
320
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
321
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
322
|
+
if (r2) {
|
|
323
|
+
throw takeObject(r1);
|
|
324
|
+
}
|
|
325
|
+
return MultiDecodeResult.__wrap(r0);
|
|
326
|
+
} finally {
|
|
327
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
305
331
|
/**
|
|
306
332
|
* Available barcode types
|
|
307
333
|
*/
|
|
@@ -626,6 +652,42 @@ export class DecodeHintDictionary {
|
|
|
626
652
|
return ret !== 0;
|
|
627
653
|
}
|
|
628
654
|
}
|
|
655
|
+
/**
|
|
656
|
+
*/
|
|
657
|
+
export class MultiDecodeResult {
|
|
658
|
+
|
|
659
|
+
static __wrap(ptr) {
|
|
660
|
+
const obj = Object.create(MultiDecodeResult.prototype);
|
|
661
|
+
obj.ptr = ptr;
|
|
662
|
+
|
|
663
|
+
return obj;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
__destroy_into_raw() {
|
|
667
|
+
const ptr = this.ptr;
|
|
668
|
+
this.ptr = 0;
|
|
669
|
+
|
|
670
|
+
return ptr;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
free() {
|
|
674
|
+
const ptr = this.__destroy_into_raw();
|
|
675
|
+
wasm.__wbg_multidecoderesult_free(ptr);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
*/
|
|
679
|
+
constructor() {
|
|
680
|
+
const ret = wasm.multidecoderesult_new();
|
|
681
|
+
return MultiDecodeResult.__wrap(ret);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* @returns {BarcodeResult | undefined}
|
|
685
|
+
*/
|
|
686
|
+
next() {
|
|
687
|
+
const ret = wasm.multidecoderesult_next(this.ptr);
|
|
688
|
+
return ret === 0 ? undefined : BarcodeResult.__wrap(ret);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
629
691
|
|
|
630
692
|
export function __wbindgen_string_new(arg0, arg1) {
|
|
631
693
|
const ret = getStringFromWasm0(arg0, arg1);
|
package/rxing_wasm_bg.wasm
CHANGED
|
Binary file
|