rxing-wasm 0.5.4 → 0.5.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 +3 -3
- package/rxing_wasm.d.ts +360 -360
- package/rxing_wasm.js +7 -2
- package/rxing_wasm_bg.js +289 -307
- package/rxing_wasm_bg.wasm +0 -0
package/rxing_wasm.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
/* @ts-self-types="./rxing_wasm.d.ts" */
|
|
1
2
|
import * as wasm from "./rxing_wasm_bg.wasm";
|
|
2
|
-
export * from "./rxing_wasm_bg.js";
|
|
3
3
|
import { __wbg_set_wasm } from "./rxing_wasm_bg.js";
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
__wbg_set_wasm(wasm);
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
BarcodeFormat, BarcodeResult, DecodeHintDictionary, DecodeHintTypes, EncodeHintDictionary, EncodeHintTypes, convert_canvas_to_luma, convert_imagedata_to_luma, convert_js_image_to_luma, decode_barcode, decode_barcode_rgb, decode_barcode_with_hints, decode_multi, encode_barcode, encode_barcode_with_hints
|
|
9
|
+
} from "./rxing_wasm_bg.js";
|
package/rxing_wasm_bg.js
CHANGED
|
@@ -1,211 +1,3 @@
|
|
|
1
|
-
let wasm;
|
|
2
|
-
export function __wbg_set_wasm(val) {
|
|
3
|
-
wasm = val;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
function addHeapObject(obj) {
|
|
7
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
8
|
-
const idx = heap_next;
|
|
9
|
-
heap_next = heap[idx];
|
|
10
|
-
|
|
11
|
-
heap[idx] = obj;
|
|
12
|
-
return idx;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function _assertClass(instance, klass) {
|
|
16
|
-
if (!(instance instanceof klass)) {
|
|
17
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function addBorrowedObject(obj) {
|
|
22
|
-
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
23
|
-
heap[--stack_pointer] = obj;
|
|
24
|
-
return stack_pointer;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function dropObject(idx) {
|
|
28
|
-
if (idx < 132) return;
|
|
29
|
-
heap[idx] = heap_next;
|
|
30
|
-
heap_next = idx;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function getArrayF32FromWasm0(ptr, len) {
|
|
34
|
-
ptr = ptr >>> 0;
|
|
35
|
-
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
39
|
-
ptr = ptr >>> 0;
|
|
40
|
-
const mem = getDataViewMemory0();
|
|
41
|
-
const result = [];
|
|
42
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
43
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
49
|
-
ptr = ptr >>> 0;
|
|
50
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
let cachedDataViewMemory0 = null;
|
|
54
|
-
function getDataViewMemory0() {
|
|
55
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
56
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
57
|
-
}
|
|
58
|
-
return cachedDataViewMemory0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let cachedFloat32ArrayMemory0 = null;
|
|
62
|
-
function getFloat32ArrayMemory0() {
|
|
63
|
-
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
64
|
-
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
65
|
-
}
|
|
66
|
-
return cachedFloat32ArrayMemory0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function getStringFromWasm0(ptr, len) {
|
|
70
|
-
ptr = ptr >>> 0;
|
|
71
|
-
return decodeText(ptr, len);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
let cachedUint32ArrayMemory0 = null;
|
|
75
|
-
function getUint32ArrayMemory0() {
|
|
76
|
-
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
77
|
-
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
78
|
-
}
|
|
79
|
-
return cachedUint32ArrayMemory0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
let cachedUint8ArrayMemory0 = null;
|
|
83
|
-
function getUint8ArrayMemory0() {
|
|
84
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
85
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
86
|
-
}
|
|
87
|
-
return cachedUint8ArrayMemory0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getObject(idx) { return heap[idx]; }
|
|
91
|
-
|
|
92
|
-
function handleError(f, args) {
|
|
93
|
-
try {
|
|
94
|
-
return f.apply(this, args);
|
|
95
|
-
} catch (e) {
|
|
96
|
-
wasm.__wbindgen_export2(addHeapObject(e));
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
let heap = new Array(128).fill(undefined);
|
|
101
|
-
heap.push(undefined, null, true, false);
|
|
102
|
-
|
|
103
|
-
let heap_next = heap.length;
|
|
104
|
-
|
|
105
|
-
function isLikeNone(x) {
|
|
106
|
-
return x === undefined || x === null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function passArray32ToWasm0(arg, malloc) {
|
|
110
|
-
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
111
|
-
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
112
|
-
WASM_VECTOR_LEN = arg.length;
|
|
113
|
-
return ptr;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
117
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
118
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
119
|
-
WASM_VECTOR_LEN = arg.length;
|
|
120
|
-
return ptr;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
124
|
-
if (realloc === undefined) {
|
|
125
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
126
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
127
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
128
|
-
WASM_VECTOR_LEN = buf.length;
|
|
129
|
-
return ptr;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
let len = arg.length;
|
|
133
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
134
|
-
|
|
135
|
-
const mem = getUint8ArrayMemory0();
|
|
136
|
-
|
|
137
|
-
let offset = 0;
|
|
138
|
-
|
|
139
|
-
for (; offset < len; offset++) {
|
|
140
|
-
const code = arg.charCodeAt(offset);
|
|
141
|
-
if (code > 0x7F) break;
|
|
142
|
-
mem[ptr + offset] = code;
|
|
143
|
-
}
|
|
144
|
-
if (offset !== len) {
|
|
145
|
-
if (offset !== 0) {
|
|
146
|
-
arg = arg.slice(offset);
|
|
147
|
-
}
|
|
148
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
149
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
150
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
151
|
-
|
|
152
|
-
offset += ret.written;
|
|
153
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
WASM_VECTOR_LEN = offset;
|
|
157
|
-
return ptr;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
let stack_pointer = 128;
|
|
161
|
-
|
|
162
|
-
function takeObject(idx) {
|
|
163
|
-
const ret = getObject(idx);
|
|
164
|
-
dropObject(idx);
|
|
165
|
-
return ret;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
169
|
-
cachedTextDecoder.decode();
|
|
170
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
171
|
-
let numBytesDecoded = 0;
|
|
172
|
-
function decodeText(ptr, len) {
|
|
173
|
-
numBytesDecoded += len;
|
|
174
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
175
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
176
|
-
cachedTextDecoder.decode();
|
|
177
|
-
numBytesDecoded = len;
|
|
178
|
-
}
|
|
179
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const cachedTextEncoder = new TextEncoder();
|
|
183
|
-
|
|
184
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
185
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
186
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
187
|
-
view.set(buf);
|
|
188
|
-
return {
|
|
189
|
-
read: arg.length,
|
|
190
|
-
written: buf.length
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
let WASM_VECTOR_LEN = 0;
|
|
196
|
-
|
|
197
|
-
const BarcodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
198
|
-
? { register: () => {}, unregister: () => {} }
|
|
199
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_barcoderesult_free(ptr >>> 0, 1));
|
|
200
|
-
|
|
201
|
-
const DecodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
202
|
-
? { register: () => {}, unregister: () => {} }
|
|
203
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_decodehintdictionary_free(ptr >>> 0, 1));
|
|
204
|
-
|
|
205
|
-
const EncodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
206
|
-
? { register: () => {}, unregister: () => {} }
|
|
207
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_encodehintdictionary_free(ptr >>> 0, 1));
|
|
208
|
-
|
|
209
1
|
/**
|
|
210
2
|
* Available barcode types
|
|
211
3
|
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20}
|
|
@@ -290,7 +82,6 @@ export const BarcodeFormat = Object.freeze({
|
|
|
290
82
|
|
|
291
83
|
export class BarcodeResult {
|
|
292
84
|
static __wrap(ptr) {
|
|
293
|
-
ptr = ptr >>> 0;
|
|
294
85
|
const obj = Object.create(BarcodeResult.prototype);
|
|
295
86
|
obj.__wbg_ptr = ptr;
|
|
296
87
|
BarcodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -306,6 +97,13 @@ export class BarcodeResult {
|
|
|
306
97
|
const ptr = this.__destroy_into_raw();
|
|
307
98
|
wasm.__wbg_barcoderesult_free(ptr, 0);
|
|
308
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* @returns {BarcodeFormat}
|
|
102
|
+
*/
|
|
103
|
+
format() {
|
|
104
|
+
const ret = wasm.barcoderesult_format(this.__wbg_ptr);
|
|
105
|
+
return ret;
|
|
106
|
+
}
|
|
309
107
|
/**
|
|
310
108
|
* @returns {Map<any, any>}
|
|
311
109
|
*/
|
|
@@ -313,6 +111,29 @@ export class BarcodeResult {
|
|
|
313
111
|
const ret = wasm.barcoderesult_get_meta_data(this.__wbg_ptr);
|
|
314
112
|
return takeObject(ret);
|
|
315
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* @returns {number}
|
|
116
|
+
*/
|
|
117
|
+
num_bits() {
|
|
118
|
+
const ret = wasm.barcoderesult_num_bits(this.__wbg_ptr);
|
|
119
|
+
return ret >>> 0;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @returns {Uint8Array}
|
|
123
|
+
*/
|
|
124
|
+
raw_bytes() {
|
|
125
|
+
try {
|
|
126
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
127
|
+
wasm.barcoderesult_raw_bytes(retptr, this.__wbg_ptr);
|
|
128
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
129
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
130
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
131
|
+
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
132
|
+
return v1;
|
|
133
|
+
} finally {
|
|
134
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
316
137
|
/**
|
|
317
138
|
* Each pair of f32 values is an (x,y) point
|
|
318
139
|
* @returns {Float32Array}
|
|
@@ -349,36 +170,6 @@ export class BarcodeResult {
|
|
|
349
170
|
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
350
171
|
}
|
|
351
172
|
}
|
|
352
|
-
/**
|
|
353
|
-
* @returns {BarcodeFormat}
|
|
354
|
-
*/
|
|
355
|
-
format() {
|
|
356
|
-
const ret = wasm.barcoderesult_format(this.__wbg_ptr);
|
|
357
|
-
return ret;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* @returns {number}
|
|
361
|
-
*/
|
|
362
|
-
num_bits() {
|
|
363
|
-
const ret = wasm.barcoderesult_num_bits(this.__wbg_ptr);
|
|
364
|
-
return ret >>> 0;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* @returns {Uint8Array}
|
|
368
|
-
*/
|
|
369
|
-
raw_bytes() {
|
|
370
|
-
try {
|
|
371
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
372
|
-
wasm.barcoderesult_raw_bytes(retptr, this.__wbg_ptr);
|
|
373
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
374
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
375
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
376
|
-
wasm.__wbindgen_export3(r0, r1 * 1, 1);
|
|
377
|
-
return v1;
|
|
378
|
-
} finally {
|
|
379
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
173
|
/**
|
|
383
174
|
* @returns {number}
|
|
384
175
|
*/
|
|
@@ -400,20 +191,6 @@ export class DecodeHintDictionary {
|
|
|
400
191
|
const ptr = this.__destroy_into_raw();
|
|
401
192
|
wasm.__wbg_decodehintdictionary_free(ptr, 0);
|
|
402
193
|
}
|
|
403
|
-
/**
|
|
404
|
-
* @param {DecodeHintTypes} hint
|
|
405
|
-
* @returns {boolean}
|
|
406
|
-
*/
|
|
407
|
-
remove_hint(hint) {
|
|
408
|
-
const ret = wasm.decodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
409
|
-
return ret !== 0;
|
|
410
|
-
}
|
|
411
|
-
constructor() {
|
|
412
|
-
const ret = wasm.decodehintdictionary_new();
|
|
413
|
-
this.__wbg_ptr = ret >>> 0;
|
|
414
|
-
DecodeHintDictionaryFinalization.register(this, this.__wbg_ptr, this);
|
|
415
|
-
return this;
|
|
416
|
-
}
|
|
417
194
|
/**
|
|
418
195
|
* @param {DecodeHintTypes} hint
|
|
419
196
|
* @returns {string}
|
|
@@ -434,6 +211,20 @@ export class DecodeHintDictionary {
|
|
|
434
211
|
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
435
212
|
}
|
|
436
213
|
}
|
|
214
|
+
constructor() {
|
|
215
|
+
const ret = wasm.decodehintdictionary_new();
|
|
216
|
+
this.__wbg_ptr = ret;
|
|
217
|
+
DecodeHintDictionaryFinalization.register(this, this.__wbg_ptr, this);
|
|
218
|
+
return this;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* @param {DecodeHintTypes} hint
|
|
222
|
+
* @returns {boolean}
|
|
223
|
+
*/
|
|
224
|
+
remove_hint(hint) {
|
|
225
|
+
const ret = wasm.decodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
226
|
+
return ret !== 0;
|
|
227
|
+
}
|
|
437
228
|
/**
|
|
438
229
|
* @param {DecodeHintTypes} hint
|
|
439
230
|
* @param {string} value
|
|
@@ -557,20 +348,6 @@ export class EncodeHintDictionary {
|
|
|
557
348
|
const ptr = this.__destroy_into_raw();
|
|
558
349
|
wasm.__wbg_encodehintdictionary_free(ptr, 0);
|
|
559
350
|
}
|
|
560
|
-
/**
|
|
561
|
-
* @param {EncodeHintTypes} hint
|
|
562
|
-
* @returns {boolean}
|
|
563
|
-
*/
|
|
564
|
-
remove_hint(hint) {
|
|
565
|
-
const ret = wasm.encodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
566
|
-
return ret !== 0;
|
|
567
|
-
}
|
|
568
|
-
constructor() {
|
|
569
|
-
const ret = wasm.encodehintdictionary_new();
|
|
570
|
-
this.__wbg_ptr = ret >>> 0;
|
|
571
|
-
EncodeHintDictionaryFinalization.register(this, this.__wbg_ptr, this);
|
|
572
|
-
return this;
|
|
573
|
-
}
|
|
574
351
|
/**
|
|
575
352
|
* @param {EncodeHintTypes} hint
|
|
576
353
|
* @returns {string}
|
|
@@ -591,6 +368,20 @@ export class EncodeHintDictionary {
|
|
|
591
368
|
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
592
369
|
}
|
|
593
370
|
}
|
|
371
|
+
constructor() {
|
|
372
|
+
const ret = wasm.encodehintdictionary_new();
|
|
373
|
+
this.__wbg_ptr = ret;
|
|
374
|
+
EncodeHintDictionaryFinalization.register(this, this.__wbg_ptr, this);
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @param {EncodeHintTypes} hint
|
|
379
|
+
* @returns {boolean}
|
|
380
|
+
*/
|
|
381
|
+
remove_hint(hint) {
|
|
382
|
+
const ret = wasm.encodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
383
|
+
return ret !== 0;
|
|
384
|
+
}
|
|
594
385
|
/**
|
|
595
386
|
* @param {EncodeHintTypes} hint
|
|
596
387
|
* @param {string} value
|
|
@@ -1031,45 +822,37 @@ export function encode_barcode_with_hints(data, width, height, bc_type, hints) {
|
|
|
1031
822
|
wasm.__wbindgen_export3(deferred3_0, deferred3_1, 1);
|
|
1032
823
|
}
|
|
1033
824
|
}
|
|
1034
|
-
|
|
1035
|
-
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
825
|
+
export function __wbg___wbindgen_throw_bbadd78c1bac3a77(arg0, arg1) {
|
|
1036
826
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1037
|
-
}
|
|
1038
|
-
|
|
827
|
+
}
|
|
1039
828
|
export function __wbg_barcoderesult_new(arg0) {
|
|
1040
829
|
const ret = BarcodeResult.__wrap(arg0);
|
|
1041
830
|
return addHeapObject(ret);
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
export function __wbg_data_83b2a9a09dd4ab39(arg0, arg1) {
|
|
831
|
+
}
|
|
832
|
+
export function __wbg_data_b0613a0806797919(arg0, arg1) {
|
|
1045
833
|
const ret = getObject(arg1).data;
|
|
1046
834
|
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_export);
|
|
1047
835
|
const len1 = WASM_VECTOR_LEN;
|
|
1048
836
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1049
837
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
export function __wbg_getContext_01f42b234e833f0a() { return handleError(function (arg0, arg1, arg2) {
|
|
838
|
+
}
|
|
839
|
+
export function __wbg_getContext_db5f8ccb275883ba() { return handleError(function (arg0, arg1, arg2) {
|
|
1053
840
|
const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2));
|
|
1054
841
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
1055
|
-
}, arguments) }
|
|
1056
|
-
|
|
1057
|
-
export function __wbg_getImageData_fbd5fac79d0f455a() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
842
|
+
}, arguments); }
|
|
843
|
+
export function __wbg_getImageData_2a147e83657d5a95() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1058
844
|
const ret = getObject(arg0).getImageData(arg1, arg2, arg3, arg4);
|
|
1059
845
|
return addHeapObject(ret);
|
|
1060
|
-
}, arguments) }
|
|
1061
|
-
|
|
1062
|
-
export function __wbg_getTime_ad1e9878a735af08(arg0) {
|
|
846
|
+
}, arguments); }
|
|
847
|
+
export function __wbg_getTime_ef2e115ede346a26(arg0) {
|
|
1063
848
|
const ret = getObject(arg0).getTime();
|
|
1064
849
|
return ret;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
|
-
export function __wbg_height_a07787f693c253d2(arg0) {
|
|
850
|
+
}
|
|
851
|
+
export function __wbg_height_16941927eccda208(arg0) {
|
|
1068
852
|
const ret = getObject(arg0).height;
|
|
1069
853
|
return ret;
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
export function __wbg_instanceof_CanvasRenderingContext2d_d070139aaac1459f(arg0) {
|
|
854
|
+
}
|
|
855
|
+
export function __wbg_instanceof_CanvasRenderingContext2d_f9f8e0bbab67ac49(arg0) {
|
|
1073
856
|
let result;
|
|
1074
857
|
try {
|
|
1075
858
|
result = getObject(arg0) instanceof CanvasRenderingContext2D;
|
|
@@ -1078,34 +861,233 @@ export function __wbg_instanceof_CanvasRenderingContext2d_d070139aaac1459f(arg0)
|
|
|
1078
861
|
}
|
|
1079
862
|
const ret = result;
|
|
1080
863
|
return ret;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
export function __wbg_new_0_23cedd11d9b40c9d() {
|
|
864
|
+
}
|
|
865
|
+
export function __wbg_new_0_878c6ec3a1c600f3() {
|
|
1084
866
|
const ret = new Date();
|
|
1085
867
|
return addHeapObject(ret);
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
export function __wbg_new_b546ae120718850e() {
|
|
868
|
+
}
|
|
869
|
+
export function __wbg_new_883c0db065f06efd() {
|
|
1089
870
|
const ret = new Map();
|
|
1090
871
|
return addHeapObject(ret);
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
|
|
872
|
+
}
|
|
873
|
+
export function __wbg_set_5f806304fb633ab3(arg0, arg1, arg2) {
|
|
1094
874
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
1095
875
|
return addHeapObject(ret);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
export function __wbg_width_dd0cfe94d42f5143(arg0) {
|
|
876
|
+
}
|
|
877
|
+
export function __wbg_width_ba63b77e481cffae(arg0) {
|
|
1099
878
|
const ret = getObject(arg0).width;
|
|
1100
879
|
return ret;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
880
|
+
}
|
|
881
|
+
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
1104
882
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
1105
883
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1106
884
|
return addHeapObject(ret);
|
|
1107
|
-
}
|
|
1108
|
-
|
|
885
|
+
}
|
|
1109
886
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
1110
887
|
takeObject(arg0);
|
|
1111
|
-
}
|
|
888
|
+
}
|
|
889
|
+
const BarcodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
890
|
+
? { register: () => {}, unregister: () => {} }
|
|
891
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_barcoderesult_free(ptr, 1));
|
|
892
|
+
const DecodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
893
|
+
? { register: () => {}, unregister: () => {} }
|
|
894
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodehintdictionary_free(ptr, 1));
|
|
895
|
+
const EncodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
896
|
+
? { register: () => {}, unregister: () => {} }
|
|
897
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_encodehintdictionary_free(ptr, 1));
|
|
898
|
+
|
|
899
|
+
function addHeapObject(obj) {
|
|
900
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
901
|
+
const idx = heap_next;
|
|
902
|
+
heap_next = heap[idx];
|
|
903
|
+
|
|
904
|
+
heap[idx] = obj;
|
|
905
|
+
return idx;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
function _assertClass(instance, klass) {
|
|
909
|
+
if (!(instance instanceof klass)) {
|
|
910
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
function addBorrowedObject(obj) {
|
|
915
|
+
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
916
|
+
heap[--stack_pointer] = obj;
|
|
917
|
+
return stack_pointer;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function dropObject(idx) {
|
|
921
|
+
if (idx < 1028) return;
|
|
922
|
+
heap[idx] = heap_next;
|
|
923
|
+
heap_next = idx;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
927
|
+
ptr = ptr >>> 0;
|
|
928
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
932
|
+
ptr = ptr >>> 0;
|
|
933
|
+
const mem = getDataViewMemory0();
|
|
934
|
+
const result = [];
|
|
935
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
936
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
937
|
+
}
|
|
938
|
+
return result;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
942
|
+
ptr = ptr >>> 0;
|
|
943
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
let cachedDataViewMemory0 = null;
|
|
947
|
+
function getDataViewMemory0() {
|
|
948
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
949
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
950
|
+
}
|
|
951
|
+
return cachedDataViewMemory0;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
955
|
+
function getFloat32ArrayMemory0() {
|
|
956
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
957
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
958
|
+
}
|
|
959
|
+
return cachedFloat32ArrayMemory0;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
function getStringFromWasm0(ptr, len) {
|
|
963
|
+
return decodeText(ptr >>> 0, len);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
let cachedUint32ArrayMemory0 = null;
|
|
967
|
+
function getUint32ArrayMemory0() {
|
|
968
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
969
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
970
|
+
}
|
|
971
|
+
return cachedUint32ArrayMemory0;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
let cachedUint8ArrayMemory0 = null;
|
|
975
|
+
function getUint8ArrayMemory0() {
|
|
976
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
977
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
978
|
+
}
|
|
979
|
+
return cachedUint8ArrayMemory0;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
function getObject(idx) { return heap[idx]; }
|
|
983
|
+
|
|
984
|
+
function handleError(f, args) {
|
|
985
|
+
try {
|
|
986
|
+
return f.apply(this, args);
|
|
987
|
+
} catch (e) {
|
|
988
|
+
wasm.__wbindgen_export2(addHeapObject(e));
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
let heap = new Array(1024).fill(undefined);
|
|
993
|
+
heap.push(undefined, null, true, false);
|
|
994
|
+
|
|
995
|
+
let heap_next = heap.length;
|
|
996
|
+
|
|
997
|
+
function isLikeNone(x) {
|
|
998
|
+
return x === undefined || x === null;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
1002
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
1003
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
1004
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1005
|
+
return ptr;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
1009
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
1010
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
1011
|
+
WASM_VECTOR_LEN = arg.length;
|
|
1012
|
+
return ptr;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
1016
|
+
if (realloc === undefined) {
|
|
1017
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1018
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
1019
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
1020
|
+
WASM_VECTOR_LEN = buf.length;
|
|
1021
|
+
return ptr;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
let len = arg.length;
|
|
1025
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
1026
|
+
|
|
1027
|
+
const mem = getUint8ArrayMemory0();
|
|
1028
|
+
|
|
1029
|
+
let offset = 0;
|
|
1030
|
+
|
|
1031
|
+
for (; offset < len; offset++) {
|
|
1032
|
+
const code = arg.charCodeAt(offset);
|
|
1033
|
+
if (code > 0x7F) break;
|
|
1034
|
+
mem[ptr + offset] = code;
|
|
1035
|
+
}
|
|
1036
|
+
if (offset !== len) {
|
|
1037
|
+
if (offset !== 0) {
|
|
1038
|
+
arg = arg.slice(offset);
|
|
1039
|
+
}
|
|
1040
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
1041
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
1042
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
1043
|
+
|
|
1044
|
+
offset += ret.written;
|
|
1045
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
WASM_VECTOR_LEN = offset;
|
|
1049
|
+
return ptr;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
let stack_pointer = 1024;
|
|
1053
|
+
|
|
1054
|
+
function takeObject(idx) {
|
|
1055
|
+
const ret = getObject(idx);
|
|
1056
|
+
dropObject(idx);
|
|
1057
|
+
return ret;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1061
|
+
cachedTextDecoder.decode();
|
|
1062
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
1063
|
+
let numBytesDecoded = 0;
|
|
1064
|
+
function decodeText(ptr, len) {
|
|
1065
|
+
numBytesDecoded += len;
|
|
1066
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
1067
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
1068
|
+
cachedTextDecoder.decode();
|
|
1069
|
+
numBytesDecoded = len;
|
|
1070
|
+
}
|
|
1071
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
const cachedTextEncoder = new TextEncoder();
|
|
1075
|
+
|
|
1076
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
1077
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
1078
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
1079
|
+
view.set(buf);
|
|
1080
|
+
return {
|
|
1081
|
+
read: arg.length,
|
|
1082
|
+
written: buf.length
|
|
1083
|
+
};
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
let WASM_VECTOR_LEN = 0;
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
let wasm;
|
|
1091
|
+
export function __wbg_set_wasm(val) {
|
|
1092
|
+
wasm = val;
|
|
1093
|
+
}
|
package/rxing_wasm_bg.wasm
CHANGED
|
Binary file
|