rxing-wasm 0.2.5 → 0.2.7
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 +1 -1
- package/rxing_wasm.d.ts +182 -180
- package/rxing_wasm_bg.js +310 -277
- package/rxing_wasm_bg.wasm +0 -0
package/rxing_wasm_bg.js
CHANGED
|
@@ -4,6 +4,26 @@ export function __wbg_set_wasm(val) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
const heap = new Array(128).fill(undefined);
|
|
8
|
+
|
|
9
|
+
heap.push(undefined, null, true, false);
|
|
10
|
+
|
|
11
|
+
function getObject(idx) { return heap[idx]; }
|
|
12
|
+
|
|
13
|
+
let heap_next = heap.length;
|
|
14
|
+
|
|
15
|
+
function dropObject(idx) {
|
|
16
|
+
if (idx < 132) return;
|
|
17
|
+
heap[idx] = heap_next;
|
|
18
|
+
heap_next = idx;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function takeObject(idx) {
|
|
22
|
+
const ret = getObject(idx);
|
|
23
|
+
dropObject(idx);
|
|
24
|
+
return ret;
|
|
25
|
+
}
|
|
26
|
+
|
|
7
27
|
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
8
28
|
|
|
9
29
|
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
@@ -20,15 +40,10 @@ function getUint8Memory0() {
|
|
|
20
40
|
}
|
|
21
41
|
|
|
22
42
|
function getStringFromWasm0(ptr, len) {
|
|
43
|
+
ptr = ptr >>> 0;
|
|
23
44
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
24
45
|
}
|
|
25
46
|
|
|
26
|
-
const heap = new Array(128).fill(undefined);
|
|
27
|
-
|
|
28
|
-
heap.push(undefined, null, true, false);
|
|
29
|
-
|
|
30
|
-
let heap_next = heap.length;
|
|
31
|
-
|
|
32
47
|
function addHeapObject(obj) {
|
|
33
48
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
34
49
|
const idx = heap_next;
|
|
@@ -38,20 +53,6 @@ function addHeapObject(obj) {
|
|
|
38
53
|
return idx;
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
function getObject(idx) { return heap[idx]; }
|
|
42
|
-
|
|
43
|
-
function dropObject(idx) {
|
|
44
|
-
if (idx < 132) return;
|
|
45
|
-
heap[idx] = heap_next;
|
|
46
|
-
heap_next = idx;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function takeObject(idx) {
|
|
50
|
-
const ret = getObject(idx);
|
|
51
|
-
dropObject(idx);
|
|
52
|
-
return ret;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
56
|
let cachedInt32Memory0 = null;
|
|
56
57
|
|
|
57
58
|
function getInt32Memory0() {
|
|
@@ -84,14 +85,14 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
84
85
|
|
|
85
86
|
if (realloc === undefined) {
|
|
86
87
|
const buf = cachedTextEncoder.encode(arg);
|
|
87
|
-
const ptr = malloc(buf.length);
|
|
88
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
88
89
|
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
89
90
|
WASM_VECTOR_LEN = buf.length;
|
|
90
91
|
return ptr;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
let len = arg.length;
|
|
94
|
-
let ptr = malloc(len);
|
|
95
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
95
96
|
|
|
96
97
|
const mem = getUint8Memory0();
|
|
97
98
|
|
|
@@ -107,11 +108,12 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
107
108
|
if (offset !== 0) {
|
|
108
109
|
arg = arg.slice(offset);
|
|
109
110
|
}
|
|
110
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
111
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
111
112
|
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
112
113
|
const ret = encodeString(arg, view);
|
|
113
114
|
|
|
114
115
|
offset += ret.written;
|
|
116
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
WASM_VECTOR_LEN = offset;
|
|
@@ -128,10 +130,12 @@ function getFloat32Memory0() {
|
|
|
128
130
|
}
|
|
129
131
|
|
|
130
132
|
function getArrayF32FromWasm0(ptr, len) {
|
|
133
|
+
ptr = ptr >>> 0;
|
|
131
134
|
return getFloat32Memory0().subarray(ptr / 4, ptr / 4 + len);
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
function getArrayU8FromWasm0(ptr, len) {
|
|
138
|
+
ptr = ptr >>> 0;
|
|
135
139
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
136
140
|
}
|
|
137
141
|
/**
|
|
@@ -139,10 +143,12 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
139
143
|
* @param {string} data
|
|
140
144
|
* @param {number} width
|
|
141
145
|
* @param {number} height
|
|
142
|
-
* @param {
|
|
146
|
+
* @param {BarcodeFormat} bc_type
|
|
143
147
|
* @returns {string}
|
|
144
148
|
*/
|
|
145
149
|
export function encode_barcode(data, width, height, bc_type) {
|
|
150
|
+
let deferred3_0;
|
|
151
|
+
let deferred3_1;
|
|
146
152
|
try {
|
|
147
153
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
148
154
|
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -152,16 +158,18 @@ export function encode_barcode(data, width, height, bc_type) {
|
|
|
152
158
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
153
159
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
154
160
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155
|
-
var
|
|
156
|
-
var
|
|
161
|
+
var ptr2 = r0;
|
|
162
|
+
var len2 = r1;
|
|
157
163
|
if (r3) {
|
|
158
|
-
|
|
164
|
+
ptr2 = 0; len2 = 0;
|
|
159
165
|
throw takeObject(r2);
|
|
160
166
|
}
|
|
161
|
-
|
|
167
|
+
deferred3_0 = ptr2;
|
|
168
|
+
deferred3_1 = len2;
|
|
169
|
+
return getStringFromWasm0(ptr2, len2);
|
|
162
170
|
} finally {
|
|
163
171
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
164
|
-
wasm.__wbindgen_free(
|
|
172
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
165
173
|
}
|
|
166
174
|
}
|
|
167
175
|
|
|
@@ -176,36 +184,40 @@ function _assertClass(instance, klass) {
|
|
|
176
184
|
* @param {string} data
|
|
177
185
|
* @param {number} width
|
|
178
186
|
* @param {number} height
|
|
179
|
-
* @param {
|
|
187
|
+
* @param {BarcodeFormat} bc_type
|
|
180
188
|
* @param {EncodeHintDictionary} hints
|
|
181
189
|
* @returns {string}
|
|
182
190
|
*/
|
|
183
191
|
export function encode_barcode_with_hints(data, width, height, bc_type, hints) {
|
|
192
|
+
let deferred3_0;
|
|
193
|
+
let deferred3_1;
|
|
184
194
|
try {
|
|
185
195
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
186
196
|
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
187
197
|
const len0 = WASM_VECTOR_LEN;
|
|
188
198
|
_assertClass(hints, EncodeHintDictionary);
|
|
189
|
-
wasm.encode_barcode_with_hints(retptr, ptr0, len0, width, height, bc_type, hints.
|
|
199
|
+
wasm.encode_barcode_with_hints(retptr, ptr0, len0, width, height, bc_type, hints.__wbg_ptr);
|
|
190
200
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
201
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
192
202
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
193
203
|
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
194
|
-
var
|
|
195
|
-
var
|
|
204
|
+
var ptr2 = r0;
|
|
205
|
+
var len2 = r1;
|
|
196
206
|
if (r3) {
|
|
197
|
-
|
|
207
|
+
ptr2 = 0; len2 = 0;
|
|
198
208
|
throw takeObject(r2);
|
|
199
209
|
}
|
|
200
|
-
|
|
210
|
+
deferred3_0 = ptr2;
|
|
211
|
+
deferred3_1 = len2;
|
|
212
|
+
return getStringFromWasm0(ptr2, len2);
|
|
201
213
|
} finally {
|
|
202
214
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
203
|
-
wasm.__wbindgen_free(
|
|
215
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
204
216
|
}
|
|
205
217
|
}
|
|
206
218
|
|
|
207
219
|
function passArray8ToWasm0(arg, malloc) {
|
|
208
|
-
const ptr = malloc(arg.length * 1);
|
|
220
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
209
221
|
getUint8Memory0().set(arg, ptr / 1);
|
|
210
222
|
WASM_VECTOR_LEN = arg.length;
|
|
211
223
|
return ptr;
|
|
@@ -219,15 +231,16 @@ function isLikeNone(x) {
|
|
|
219
231
|
* @param {Uint8Array} data
|
|
220
232
|
* @param {number} width
|
|
221
233
|
* @param {number} height
|
|
222
|
-
* @param {boolean | undefined} try_harder
|
|
234
|
+
* @param {boolean | undefined} [try_harder]
|
|
235
|
+
* @param {boolean | undefined} [filter_image]
|
|
223
236
|
* @returns {BarcodeResult}
|
|
224
237
|
*/
|
|
225
|
-
export function decode_barcode(data, width, height, try_harder) {
|
|
238
|
+
export function decode_barcode(data, width, height, try_harder, filter_image) {
|
|
226
239
|
try {
|
|
227
240
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
228
241
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
229
242
|
const len0 = WASM_VECTOR_LEN;
|
|
230
|
-
wasm.decode_barcode(retptr, ptr0, len0, width, height, isLikeNone(try_harder) ? 0xFFFFFF : try_harder ? 1 : 0);
|
|
243
|
+
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
244
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
232
245
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
233
246
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -258,9 +271,9 @@ export function convert_js_image_to_luma(data) {
|
|
|
258
271
|
wasm.convert_js_image_to_luma(retptr, ptr0, len0);
|
|
259
272
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
260
273
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
261
|
-
var
|
|
262
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
263
|
-
return
|
|
274
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
275
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
276
|
+
return v2;
|
|
264
277
|
} finally {
|
|
265
278
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
266
279
|
}
|
|
@@ -276,7 +289,7 @@ function getUint32Memory0() {
|
|
|
276
289
|
}
|
|
277
290
|
|
|
278
291
|
function passArray32ToWasm0(arg, malloc) {
|
|
279
|
-
const ptr = malloc(arg.length * 4);
|
|
292
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
280
293
|
getUint32Memory0().set(arg, ptr / 4);
|
|
281
294
|
WASM_VECTOR_LEN = arg.length;
|
|
282
295
|
return ptr;
|
|
@@ -288,7 +301,7 @@ function passArray32ToWasm0(arg, malloc) {
|
|
|
288
301
|
* @param {Uint32Array} data
|
|
289
302
|
* @param {number} width
|
|
290
303
|
* @param {number} height
|
|
291
|
-
* @param {boolean | undefined} try_harder
|
|
304
|
+
* @param {boolean | undefined} [try_harder]
|
|
292
305
|
* @returns {BarcodeResult}
|
|
293
306
|
*/
|
|
294
307
|
export function decode_barcode_rgb(data, width, height, try_harder) {
|
|
@@ -314,15 +327,16 @@ export function decode_barcode_rgb(data, width, height, try_harder) {
|
|
|
314
327
|
* @param {number} width
|
|
315
328
|
* @param {number} height
|
|
316
329
|
* @param {DecodeHintDictionary} hints
|
|
330
|
+
* @param {boolean | undefined} [filter_image]
|
|
317
331
|
* @returns {BarcodeResult}
|
|
318
332
|
*/
|
|
319
|
-
export function decode_barcode_with_hints(data, width, height, hints) {
|
|
333
|
+
export function decode_barcode_with_hints(data, width, height, hints, filter_image) {
|
|
320
334
|
try {
|
|
321
335
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
322
336
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
323
337
|
const len0 = WASM_VECTOR_LEN;
|
|
324
338
|
_assertClass(hints, DecodeHintDictionary);
|
|
325
|
-
wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.
|
|
339
|
+
wasm.decode_barcode_with_hints(retptr, ptr0, len0, width, height, hints.__wbg_ptr, isLikeNone(filter_image) ? 0xFFFFFF : filter_image ? 1 : 0);
|
|
326
340
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
327
341
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
328
342
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -348,7 +362,7 @@ export function decode_multi(data, width, height, hints) {
|
|
|
348
362
|
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
349
363
|
const len0 = WASM_VECTOR_LEN;
|
|
350
364
|
_assertClass(hints, DecodeHintDictionary);
|
|
351
|
-
wasm.decode_multi(retptr, ptr0, len0, width, height, hints.
|
|
365
|
+
wasm.decode_multi(retptr, ptr0, len0, width, height, hints.__wbg_ptr);
|
|
352
366
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
353
367
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
354
368
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -363,174 +377,99 @@ export function decode_multi(data, width, height, hints) {
|
|
|
363
377
|
|
|
364
378
|
/**
|
|
365
379
|
*/
|
|
366
|
-
export const
|
|
367
|
-
/**
|
|
368
|
-
*
|
|
369
|
-
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
370
|
-
* * Type depends on the encoder. For example for QR codes it's type
|
|
371
|
-
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
372
|
-
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
373
|
-
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
374
|
-
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
375
|
-
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
376
|
-
*
|
|
377
|
-
*/
|
|
378
|
-
ErrorCorrection:0,"0":"ErrorCorrection",
|
|
379
|
-
/**
|
|
380
|
-
*
|
|
381
|
-
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
382
|
-
*
|
|
383
|
-
*/
|
|
384
|
-
CharacterSet:1,"1":"CharacterSet",
|
|
385
|
-
/**
|
|
386
|
-
*
|
|
387
|
-
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
388
|
-
*
|
|
389
|
-
*/
|
|
390
|
-
DataMatrixShape:2,"2":"DataMatrixShape",
|
|
391
|
-
/**
|
|
392
|
-
*
|
|
393
|
-
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
394
|
-
* * {@link String } value).
|
|
395
|
-
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
396
|
-
* * character set via ECIs.
|
|
397
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
398
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
399
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
400
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
401
|
-
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
402
|
-
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
403
|
-
* * for the purpose of delimiting AIs.
|
|
404
|
-
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
405
|
-
*
|
|
406
|
-
*/
|
|
407
|
-
DataMatrixCompact:3,"3":"DataMatrixCompact",
|
|
408
|
-
/**
|
|
409
|
-
*
|
|
410
|
-
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
411
|
-
* *
|
|
412
|
-
* * @deprecated use width/height params in
|
|
413
|
-
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
414
|
-
*
|
|
415
|
-
*/
|
|
416
|
-
MinSize:4,"4":"MinSize",
|
|
417
|
-
/**
|
|
418
|
-
*
|
|
419
|
-
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
420
|
-
* *
|
|
421
|
-
* * @deprecated without replacement
|
|
422
|
-
*
|
|
423
|
-
*/
|
|
424
|
-
MaxSize:5,"5":"MaxSize",
|
|
380
|
+
export const DecodeHintTypes = Object.freeze({
|
|
425
381
|
/**
|
|
426
382
|
*
|
|
427
|
-
* *
|
|
428
|
-
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
429
|
-
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
383
|
+
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
430
384
|
*
|
|
431
385
|
*/
|
|
432
|
-
|
|
386
|
+
Other:0,"0":"Other",
|
|
433
387
|
/**
|
|
434
388
|
*
|
|
435
|
-
* *
|
|
436
|
-
* * {@link
|
|
389
|
+
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
390
|
+
* * use {@link Boolean#TRUE}.
|
|
437
391
|
*
|
|
438
392
|
*/
|
|
439
|
-
|
|
393
|
+
PureBarcode:1,"1":"PureBarcode",
|
|
440
394
|
/**
|
|
441
395
|
*
|
|
442
|
-
* *
|
|
443
|
-
* * {@link
|
|
444
|
-
* * enum values).
|
|
396
|
+
* * Image is known to be of one of a few possible formats.
|
|
397
|
+
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
445
398
|
*
|
|
446
399
|
*/
|
|
447
|
-
|
|
400
|
+
PossibleFormats:2,"2":"PossibleFormats",
|
|
448
401
|
/**
|
|
449
402
|
*
|
|
450
|
-
* *
|
|
451
|
-
* * {@link
|
|
403
|
+
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
404
|
+
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
452
405
|
*
|
|
453
406
|
*/
|
|
454
|
-
|
|
407
|
+
TryHarder:3,"3":"TryHarder",
|
|
455
408
|
/**
|
|
456
409
|
*
|
|
457
|
-
* * Specifies
|
|
458
|
-
* * {@link String} value).
|
|
459
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
460
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
461
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
462
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
410
|
+
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
463
411
|
*
|
|
464
412
|
*/
|
|
465
|
-
|
|
413
|
+
CharacterSet:4,"4":"CharacterSet",
|
|
466
414
|
/**
|
|
467
415
|
*
|
|
468
|
-
* *
|
|
469
|
-
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
470
|
-
* * 0 indicates to use the minimum number of layers (the default).
|
|
471
|
-
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
472
|
-
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
416
|
+
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
473
417
|
*
|
|
474
418
|
*/
|
|
475
|
-
|
|
419
|
+
AllowedLengths:5,"5":"AllowedLengths",
|
|
476
420
|
/**
|
|
477
421
|
*
|
|
478
|
-
* *
|
|
479
|
-
* *
|
|
422
|
+
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
423
|
+
* * use {@link Boolean#TRUE}.
|
|
480
424
|
*
|
|
481
425
|
*/
|
|
482
|
-
|
|
426
|
+
AssumeCode39CheckDigit:6,"6":"AssumeCode39CheckDigit",
|
|
483
427
|
/**
|
|
484
428
|
*
|
|
485
|
-
* *
|
|
486
|
-
* *
|
|
487
|
-
* *
|
|
488
|
-
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
429
|
+
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
430
|
+
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
431
|
+
* * use {@link Boolean#TRUE}.
|
|
489
432
|
*
|
|
490
433
|
*/
|
|
491
|
-
|
|
434
|
+
AssumeGs1:7,"7":"AssumeGs1",
|
|
492
435
|
/**
|
|
493
436
|
*
|
|
494
|
-
* *
|
|
495
|
-
* *
|
|
496
|
-
* *
|
|
497
|
-
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
498
|
-
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
499
|
-
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
437
|
+
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
438
|
+
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
439
|
+
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
500
440
|
*
|
|
501
441
|
*/
|
|
502
|
-
|
|
442
|
+
ReturnCodabarStartEnd:8,"8":"ReturnCodabarStartEnd",
|
|
503
443
|
/**
|
|
504
444
|
*
|
|
505
|
-
* *
|
|
506
|
-
* * {@link
|
|
445
|
+
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
446
|
+
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
507
447
|
*
|
|
508
448
|
*/
|
|
509
|
-
|
|
449
|
+
NeedResultPointCallback:9,"9":"NeedResultPointCallback",
|
|
510
450
|
/**
|
|
511
451
|
*
|
|
512
|
-
* *
|
|
513
|
-
* *
|
|
514
|
-
* *
|
|
452
|
+
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
453
|
+
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
454
|
+
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
455
|
+
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
456
|
+
* * at all.
|
|
515
457
|
*
|
|
516
458
|
*/
|
|
517
|
-
|
|
459
|
+
AllowedEanExtensions:10,"10":"AllowedEanExtensions",
|
|
518
460
|
/**
|
|
519
461
|
*
|
|
520
|
-
* *
|
|
521
|
-
* *
|
|
462
|
+
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
463
|
+
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
522
464
|
*
|
|
523
465
|
*/
|
|
524
|
-
|
|
466
|
+
AlsoInverted:11,"11":"AlsoInverted",
|
|
525
467
|
/**
|
|
526
468
|
*
|
|
527
|
-
* *
|
|
528
|
-
* * {@link String } value).
|
|
529
|
-
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
530
|
-
* * exclusive.
|
|
469
|
+
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
531
470
|
*
|
|
532
471
|
*/
|
|
533
|
-
|
|
472
|
+
TelepenAsNumeric:12,"12":"TelepenAsNumeric", });
|
|
534
473
|
/**
|
|
535
474
|
* Available barcode types
|
|
536
475
|
*/
|
|
@@ -605,114 +544,194 @@ UpcE:15,"15":"UpcE",
|
|
|
605
544
|
UpcEanExtension:16,"16":"UpcEanExtension",MicroQR:17,"17":"MicroQR",Telepen:18,"18":"Telepen",RectangularMicroQR:19,"19":"RectangularMicroQR",UnsuportedFormat:20,"20":"UnsuportedFormat", });
|
|
606
545
|
/**
|
|
607
546
|
*/
|
|
608
|
-
export const
|
|
547
|
+
export const EncodeHintTypes = Object.freeze({
|
|
609
548
|
/**
|
|
610
549
|
*
|
|
611
|
-
* *
|
|
550
|
+
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
551
|
+
* * Type depends on the encoder. For example for QR codes it's type
|
|
552
|
+
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
553
|
+
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
554
|
+
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
555
|
+
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
556
|
+
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
612
557
|
*
|
|
613
558
|
*/
|
|
614
|
-
|
|
559
|
+
ErrorCorrection:0,"0":"ErrorCorrection",
|
|
615
560
|
/**
|
|
616
561
|
*
|
|
617
|
-
* *
|
|
618
|
-
* * use {@link Boolean#TRUE}.
|
|
562
|
+
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
619
563
|
*
|
|
620
564
|
*/
|
|
621
|
-
|
|
565
|
+
CharacterSet:1,"1":"CharacterSet",
|
|
622
566
|
/**
|
|
623
567
|
*
|
|
624
|
-
* *
|
|
625
|
-
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
568
|
+
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
626
569
|
*
|
|
627
570
|
*/
|
|
628
|
-
|
|
571
|
+
DataMatrixShape:2,"2":"DataMatrixShape",
|
|
629
572
|
/**
|
|
630
573
|
*
|
|
631
|
-
* *
|
|
632
|
-
* *
|
|
574
|
+
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
575
|
+
* * {@link String } value).
|
|
576
|
+
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
577
|
+
* * character set via ECIs.
|
|
578
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
579
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
580
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
581
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
582
|
+
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
583
|
+
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
584
|
+
* * for the purpose of delimiting AIs.
|
|
585
|
+
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
633
586
|
*
|
|
634
587
|
*/
|
|
635
|
-
|
|
588
|
+
DataMatrixCompact:3,"3":"DataMatrixCompact",
|
|
636
589
|
/**
|
|
637
590
|
*
|
|
638
|
-
* * Specifies
|
|
591
|
+
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
592
|
+
* *
|
|
593
|
+
* * @deprecated use width/height params in
|
|
594
|
+
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
639
595
|
*
|
|
640
596
|
*/
|
|
641
|
-
|
|
597
|
+
MinSize:4,"4":"MinSize",
|
|
642
598
|
/**
|
|
643
599
|
*
|
|
644
|
-
* *
|
|
600
|
+
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
601
|
+
* *
|
|
602
|
+
* * @deprecated without replacement
|
|
645
603
|
*
|
|
646
604
|
*/
|
|
647
|
-
|
|
605
|
+
MaxSize:5,"5":"MaxSize",
|
|
648
606
|
/**
|
|
649
607
|
*
|
|
650
|
-
* *
|
|
651
|
-
* *
|
|
608
|
+
* * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
|
609
|
+
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
610
|
+
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
652
611
|
*
|
|
653
612
|
*/
|
|
654
|
-
|
|
613
|
+
MARGIN:6,"6":"MARGIN",
|
|
655
614
|
/**
|
|
656
615
|
*
|
|
657
|
-
* *
|
|
658
|
-
* *
|
|
659
|
-
* * use {@link Boolean#TRUE}.
|
|
616
|
+
* * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
|
|
617
|
+
* * {@link String} value).
|
|
660
618
|
*
|
|
661
619
|
*/
|
|
662
|
-
|
|
620
|
+
Pdf417Compact:7,"7":"Pdf417Compact",
|
|
663
621
|
/**
|
|
664
622
|
*
|
|
665
|
-
* *
|
|
666
|
-
* *
|
|
667
|
-
* *
|
|
623
|
+
* * Specifies what compaction mode to use for PDF417 (type
|
|
624
|
+
* * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
|
|
625
|
+
* * enum values).
|
|
668
626
|
*
|
|
669
627
|
*/
|
|
670
|
-
|
|
628
|
+
Pdf417Compaction:8,"8":"Pdf417Compaction",
|
|
671
629
|
/**
|
|
672
630
|
*
|
|
673
|
-
* *
|
|
674
|
-
* *
|
|
631
|
+
* * Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
|
632
|
+
* * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
|
675
633
|
*
|
|
676
634
|
*/
|
|
677
|
-
|
|
635
|
+
Pdf417Dimensions:9,"9":"Pdf417Dimensions",
|
|
678
636
|
/**
|
|
679
637
|
*
|
|
680
|
-
* *
|
|
681
|
-
* *
|
|
682
|
-
* *
|
|
683
|
-
* *
|
|
684
|
-
* *
|
|
638
|
+
* * Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false"
|
|
639
|
+
* * {@link String} value).
|
|
640
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
641
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
642
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
643
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
685
644
|
*
|
|
686
645
|
*/
|
|
687
|
-
|
|
646
|
+
Pdf417AutoEci:10,"10":"Pdf417AutoEci",
|
|
688
647
|
/**
|
|
689
648
|
*
|
|
690
|
-
* *
|
|
691
|
-
* *
|
|
649
|
+
* * Specifies the required number of layers for an Aztec code.
|
|
650
|
+
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
651
|
+
* * 0 indicates to use the minimum number of layers (the default).
|
|
652
|
+
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
653
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
692
654
|
*
|
|
693
655
|
*/
|
|
694
|
-
|
|
656
|
+
AztecLayers:11,"11":"AztecLayers",
|
|
695
657
|
/**
|
|
696
658
|
*
|
|
697
|
-
* *
|
|
659
|
+
* * Specifies the exact version of QR code to be encoded.
|
|
660
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
698
661
|
*
|
|
699
662
|
*/
|
|
700
|
-
|
|
663
|
+
QrVersion:12,"12":"QrVersion",
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* * Specifies the QR code mask pattern to be used. Allowed values are
|
|
667
|
+
* * 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select
|
|
668
|
+
* * the optimal mask pattern.
|
|
669
|
+
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
670
|
+
*
|
|
671
|
+
*/
|
|
672
|
+
QrMaskPattern:13,"13":"QrMaskPattern",
|
|
673
|
+
/**
|
|
674
|
+
*
|
|
675
|
+
* * Specifies whether to use compact mode for QR code (type {@link Boolean}, or "true" or "false"
|
|
676
|
+
* * {@link String } value).
|
|
677
|
+
* * Please note that when compaction is performed, the most compact character encoding is chosen
|
|
678
|
+
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
679
|
+
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
680
|
+
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
681
|
+
*
|
|
682
|
+
*/
|
|
683
|
+
QrCompact:14,"14":"QrCompact",
|
|
684
|
+
/**
|
|
685
|
+
*
|
|
686
|
+
* * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
|
|
687
|
+
* * {@link String } value).
|
|
688
|
+
*
|
|
689
|
+
*/
|
|
690
|
+
Gs1Format:15,"15":"Gs1Format",
|
|
691
|
+
/**
|
|
692
|
+
*
|
|
693
|
+
* * Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}).
|
|
694
|
+
* * Valid values are "A", "B", "C".
|
|
695
|
+
* * This option and {@link #CODE128_COMPACT} are mutually exclusive.
|
|
696
|
+
*
|
|
697
|
+
*/
|
|
698
|
+
ForceCodeSet:16,"16":"ForceCodeSet",
|
|
699
|
+
/**
|
|
700
|
+
*
|
|
701
|
+
* * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
|
|
702
|
+
* * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
|
|
703
|
+
*
|
|
704
|
+
*/
|
|
705
|
+
ForceC40:17,"17":"ForceC40",
|
|
706
|
+
/**
|
|
707
|
+
*
|
|
708
|
+
* * Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false"
|
|
709
|
+
* * {@link String } value).
|
|
710
|
+
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
711
|
+
* * exclusive.
|
|
712
|
+
*
|
|
713
|
+
*/
|
|
714
|
+
Code128Compact:18,"18":"Code128Compact",TelepenAsNumeric:19,"19":"TelepenAsNumeric", });
|
|
715
|
+
|
|
716
|
+
const BarcodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
717
|
+
? { register: () => {}, unregister: () => {} }
|
|
718
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_barcoderesult_free(ptr >>> 0));
|
|
701
719
|
/**
|
|
702
720
|
*/
|
|
703
721
|
export class BarcodeResult {
|
|
704
722
|
|
|
705
723
|
static __wrap(ptr) {
|
|
724
|
+
ptr = ptr >>> 0;
|
|
706
725
|
const obj = Object.create(BarcodeResult.prototype);
|
|
707
|
-
obj.
|
|
708
|
-
|
|
726
|
+
obj.__wbg_ptr = ptr;
|
|
727
|
+
BarcodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
709
728
|
return obj;
|
|
710
729
|
}
|
|
711
730
|
|
|
712
731
|
__destroy_into_raw() {
|
|
713
|
-
const ptr = this.
|
|
714
|
-
this.
|
|
715
|
-
|
|
732
|
+
const ptr = this.__wbg_ptr;
|
|
733
|
+
this.__wbg_ptr = 0;
|
|
734
|
+
BarcodeResultFinalization.unregister(this);
|
|
716
735
|
return ptr;
|
|
717
736
|
}
|
|
718
737
|
|
|
@@ -724,15 +743,15 @@ export class BarcodeResult {
|
|
|
724
743
|
* @returns {number}
|
|
725
744
|
*/
|
|
726
745
|
timestamp() {
|
|
727
|
-
const ret = wasm.barcoderesult_timestamp(this.
|
|
746
|
+
const ret = wasm.barcoderesult_timestamp(this.__wbg_ptr);
|
|
728
747
|
return ret;
|
|
729
748
|
}
|
|
730
749
|
/**
|
|
731
|
-
* @returns {
|
|
750
|
+
* @returns {BarcodeFormat}
|
|
732
751
|
*/
|
|
733
752
|
format() {
|
|
734
|
-
const ret = wasm.barcoderesult_format(this.
|
|
735
|
-
return ret
|
|
753
|
+
const ret = wasm.barcoderesult_format(this.__wbg_ptr);
|
|
754
|
+
return ret;
|
|
736
755
|
}
|
|
737
756
|
/**
|
|
738
757
|
* Each pair of f32 values is an (x,y) point
|
|
@@ -741,12 +760,12 @@ export class BarcodeResult {
|
|
|
741
760
|
result_points() {
|
|
742
761
|
try {
|
|
743
762
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
744
|
-
wasm.barcoderesult_result_points(retptr, this.
|
|
763
|
+
wasm.barcoderesult_result_points(retptr, this.__wbg_ptr);
|
|
745
764
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
746
765
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
747
|
-
var
|
|
748
|
-
wasm.__wbindgen_free(r0, r1 * 4);
|
|
749
|
-
return
|
|
766
|
+
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
767
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
|
768
|
+
return v1;
|
|
750
769
|
} finally {
|
|
751
770
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
752
771
|
}
|
|
@@ -755,7 +774,7 @@ export class BarcodeResult {
|
|
|
755
774
|
* @returns {number}
|
|
756
775
|
*/
|
|
757
776
|
num_bits() {
|
|
758
|
-
const ret = wasm.barcoderesult_num_bits(this.
|
|
777
|
+
const ret = wasm.barcoderesult_num_bits(this.__wbg_ptr);
|
|
759
778
|
return ret >>> 0;
|
|
760
779
|
}
|
|
761
780
|
/**
|
|
@@ -764,12 +783,12 @@ export class BarcodeResult {
|
|
|
764
783
|
raw_bytes() {
|
|
765
784
|
try {
|
|
766
785
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
767
|
-
wasm.barcoderesult_raw_bytes(retptr, this.
|
|
786
|
+
wasm.barcoderesult_raw_bytes(retptr, this.__wbg_ptr);
|
|
768
787
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
769
788
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
770
|
-
var
|
|
771
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
772
|
-
return
|
|
789
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
790
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
791
|
+
return v1;
|
|
773
792
|
} finally {
|
|
774
793
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
775
794
|
}
|
|
@@ -778,40 +797,41 @@ export class BarcodeResult {
|
|
|
778
797
|
* @returns {string}
|
|
779
798
|
*/
|
|
780
799
|
text() {
|
|
800
|
+
let deferred1_0;
|
|
801
|
+
let deferred1_1;
|
|
781
802
|
try {
|
|
782
803
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
783
|
-
wasm.barcoderesult_text(retptr, this.
|
|
804
|
+
wasm.barcoderesult_text(retptr, this.__wbg_ptr);
|
|
784
805
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
785
806
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
807
|
+
deferred1_0 = r0;
|
|
808
|
+
deferred1_1 = r1;
|
|
786
809
|
return getStringFromWasm0(r0, r1);
|
|
787
810
|
} finally {
|
|
788
811
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
789
|
-
wasm.__wbindgen_free(
|
|
812
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
790
813
|
}
|
|
791
814
|
}
|
|
792
815
|
/**
|
|
793
816
|
* @returns {Map<any, any>}
|
|
794
817
|
*/
|
|
795
818
|
get_meta_data() {
|
|
796
|
-
const ret = wasm.barcoderesult_get_meta_data(this.
|
|
819
|
+
const ret = wasm.barcoderesult_get_meta_data(this.__wbg_ptr);
|
|
797
820
|
return takeObject(ret);
|
|
798
821
|
}
|
|
799
822
|
}
|
|
823
|
+
|
|
824
|
+
const DecodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
825
|
+
? { register: () => {}, unregister: () => {} }
|
|
826
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decodehintdictionary_free(ptr >>> 0));
|
|
800
827
|
/**
|
|
801
828
|
*/
|
|
802
829
|
export class DecodeHintDictionary {
|
|
803
830
|
|
|
804
|
-
static __wrap(ptr) {
|
|
805
|
-
const obj = Object.create(DecodeHintDictionary.prototype);
|
|
806
|
-
obj.ptr = ptr;
|
|
807
|
-
|
|
808
|
-
return obj;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
831
|
__destroy_into_raw() {
|
|
812
|
-
const ptr = this.
|
|
813
|
-
this.
|
|
814
|
-
|
|
832
|
+
const ptr = this.__wbg_ptr;
|
|
833
|
+
this.__wbg_ptr = 0;
|
|
834
|
+
DecodeHintDictionaryFinalization.unregister(this);
|
|
815
835
|
return ptr;
|
|
816
836
|
}
|
|
817
837
|
|
|
@@ -823,59 +843,61 @@ export class DecodeHintDictionary {
|
|
|
823
843
|
*/
|
|
824
844
|
constructor() {
|
|
825
845
|
const ret = wasm.decodehintdictionary_new();
|
|
826
|
-
|
|
846
|
+
this.__wbg_ptr = ret >>> 0;
|
|
847
|
+
return this;
|
|
827
848
|
}
|
|
828
849
|
/**
|
|
829
|
-
* @param {
|
|
850
|
+
* @param {DecodeHintTypes} hint
|
|
830
851
|
* @returns {string}
|
|
831
852
|
*/
|
|
832
853
|
get_hint(hint) {
|
|
854
|
+
let deferred1_0;
|
|
855
|
+
let deferred1_1;
|
|
833
856
|
try {
|
|
834
857
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
835
|
-
wasm.decodehintdictionary_get_hint(retptr, this.
|
|
858
|
+
wasm.decodehintdictionary_get_hint(retptr, this.__wbg_ptr, hint);
|
|
836
859
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
837
860
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
861
|
+
deferred1_0 = r0;
|
|
862
|
+
deferred1_1 = r1;
|
|
838
863
|
return getStringFromWasm0(r0, r1);
|
|
839
864
|
} finally {
|
|
840
865
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
841
|
-
wasm.__wbindgen_free(
|
|
866
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
842
867
|
}
|
|
843
868
|
}
|
|
844
869
|
/**
|
|
845
|
-
* @param {
|
|
870
|
+
* @param {DecodeHintTypes} hint
|
|
846
871
|
* @param {string} value
|
|
847
872
|
* @returns {boolean}
|
|
848
873
|
*/
|
|
849
874
|
set_hint(hint, value) {
|
|
850
875
|
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
851
876
|
const len0 = WASM_VECTOR_LEN;
|
|
852
|
-
const ret = wasm.decodehintdictionary_set_hint(this.
|
|
877
|
+
const ret = wasm.decodehintdictionary_set_hint(this.__wbg_ptr, hint, ptr0, len0);
|
|
853
878
|
return ret !== 0;
|
|
854
879
|
}
|
|
855
880
|
/**
|
|
856
|
-
* @param {
|
|
881
|
+
* @param {DecodeHintTypes} hint
|
|
857
882
|
* @returns {boolean}
|
|
858
883
|
*/
|
|
859
884
|
remove_hint(hint) {
|
|
860
|
-
const ret = wasm.decodehintdictionary_remove_hint(this.
|
|
885
|
+
const ret = wasm.decodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
861
886
|
return ret !== 0;
|
|
862
887
|
}
|
|
863
888
|
}
|
|
889
|
+
|
|
890
|
+
const EncodeHintDictionaryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
891
|
+
? { register: () => {}, unregister: () => {} }
|
|
892
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_encodehintdictionary_free(ptr >>> 0));
|
|
864
893
|
/**
|
|
865
894
|
*/
|
|
866
895
|
export class EncodeHintDictionary {
|
|
867
896
|
|
|
868
|
-
static __wrap(ptr) {
|
|
869
|
-
const obj = Object.create(EncodeHintDictionary.prototype);
|
|
870
|
-
obj.ptr = ptr;
|
|
871
|
-
|
|
872
|
-
return obj;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
897
|
__destroy_into_raw() {
|
|
876
|
-
const ptr = this.
|
|
877
|
-
this.
|
|
878
|
-
|
|
898
|
+
const ptr = this.__wbg_ptr;
|
|
899
|
+
this.__wbg_ptr = 0;
|
|
900
|
+
EncodeHintDictionaryFinalization.unregister(this);
|
|
879
901
|
return ptr;
|
|
880
902
|
}
|
|
881
903
|
|
|
@@ -887,59 +909,69 @@ export class EncodeHintDictionary {
|
|
|
887
909
|
*/
|
|
888
910
|
constructor() {
|
|
889
911
|
const ret = wasm.encodehintdictionary_new();
|
|
890
|
-
|
|
912
|
+
this.__wbg_ptr = ret >>> 0;
|
|
913
|
+
return this;
|
|
891
914
|
}
|
|
892
915
|
/**
|
|
893
|
-
* @param {
|
|
916
|
+
* @param {EncodeHintTypes} hint
|
|
894
917
|
* @returns {string}
|
|
895
918
|
*/
|
|
896
919
|
get_hint(hint) {
|
|
920
|
+
let deferred1_0;
|
|
921
|
+
let deferred1_1;
|
|
897
922
|
try {
|
|
898
923
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
899
|
-
wasm.encodehintdictionary_get_hint(retptr, this.
|
|
924
|
+
wasm.encodehintdictionary_get_hint(retptr, this.__wbg_ptr, hint);
|
|
900
925
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
901
926
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
927
|
+
deferred1_0 = r0;
|
|
928
|
+
deferred1_1 = r1;
|
|
902
929
|
return getStringFromWasm0(r0, r1);
|
|
903
930
|
} finally {
|
|
904
931
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
905
|
-
wasm.__wbindgen_free(
|
|
932
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
906
933
|
}
|
|
907
934
|
}
|
|
908
935
|
/**
|
|
909
|
-
* @param {
|
|
936
|
+
* @param {EncodeHintTypes} hint
|
|
910
937
|
* @param {string} value
|
|
911
938
|
* @returns {boolean}
|
|
912
939
|
*/
|
|
913
940
|
set_hint(hint, value) {
|
|
914
941
|
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
915
942
|
const len0 = WASM_VECTOR_LEN;
|
|
916
|
-
const ret = wasm.encodehintdictionary_set_hint(this.
|
|
943
|
+
const ret = wasm.encodehintdictionary_set_hint(this.__wbg_ptr, hint, ptr0, len0);
|
|
917
944
|
return ret !== 0;
|
|
918
945
|
}
|
|
919
946
|
/**
|
|
920
|
-
* @param {
|
|
947
|
+
* @param {EncodeHintTypes} hint
|
|
921
948
|
* @returns {boolean}
|
|
922
949
|
*/
|
|
923
950
|
remove_hint(hint) {
|
|
924
|
-
const ret = wasm.encodehintdictionary_remove_hint(this.
|
|
951
|
+
const ret = wasm.encodehintdictionary_remove_hint(this.__wbg_ptr, hint);
|
|
925
952
|
return ret !== 0;
|
|
926
953
|
}
|
|
927
954
|
}
|
|
955
|
+
|
|
956
|
+
const MultiDecodeResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
957
|
+
? { register: () => {}, unregister: () => {} }
|
|
958
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_multidecoderesult_free(ptr >>> 0));
|
|
928
959
|
/**
|
|
929
960
|
*/
|
|
930
961
|
export class MultiDecodeResult {
|
|
931
962
|
|
|
932
963
|
static __wrap(ptr) {
|
|
964
|
+
ptr = ptr >>> 0;
|
|
933
965
|
const obj = Object.create(MultiDecodeResult.prototype);
|
|
934
|
-
obj.
|
|
935
|
-
|
|
966
|
+
obj.__wbg_ptr = ptr;
|
|
967
|
+
MultiDecodeResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
936
968
|
return obj;
|
|
937
969
|
}
|
|
938
970
|
|
|
939
971
|
__destroy_into_raw() {
|
|
940
|
-
const ptr = this.
|
|
941
|
-
this.
|
|
942
|
-
|
|
972
|
+
const ptr = this.__wbg_ptr;
|
|
973
|
+
this.__wbg_ptr = 0;
|
|
974
|
+
MultiDecodeResultFinalization.unregister(this);
|
|
943
975
|
return ptr;
|
|
944
976
|
}
|
|
945
977
|
|
|
@@ -951,42 +983,43 @@ export class MultiDecodeResult {
|
|
|
951
983
|
*/
|
|
952
984
|
constructor() {
|
|
953
985
|
const ret = wasm.multidecoderesult_new();
|
|
954
|
-
|
|
986
|
+
this.__wbg_ptr = ret >>> 0;
|
|
987
|
+
return this;
|
|
955
988
|
}
|
|
956
989
|
/**
|
|
957
990
|
* @returns {BarcodeResult | undefined}
|
|
958
991
|
*/
|
|
959
992
|
next() {
|
|
960
|
-
const ret = wasm.multidecoderesult_next(this.
|
|
993
|
+
const ret = wasm.multidecoderesult_next(this.__wbg_ptr);
|
|
961
994
|
return ret === 0 ? undefined : BarcodeResult.__wrap(ret);
|
|
962
995
|
}
|
|
963
996
|
}
|
|
964
997
|
|
|
998
|
+
export function __wbindgen_object_drop_ref(arg0) {
|
|
999
|
+
takeObject(arg0);
|
|
1000
|
+
};
|
|
1001
|
+
|
|
965
1002
|
export function __wbindgen_string_new(arg0, arg1) {
|
|
966
1003
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
967
1004
|
return addHeapObject(ret);
|
|
968
1005
|
};
|
|
969
1006
|
|
|
970
|
-
export function
|
|
971
|
-
takeObject(arg0);
|
|
972
|
-
};
|
|
973
|
-
|
|
974
|
-
export function __wbg_new_f841cc6f2098f4b5() {
|
|
1007
|
+
export function __wbg_new_d9bc3a0147634640() {
|
|
975
1008
|
const ret = new Map();
|
|
976
1009
|
return addHeapObject(ret);
|
|
977
1010
|
};
|
|
978
1011
|
|
|
979
|
-
export function
|
|
1012
|
+
export function __wbg_set_8417257aaedc936b(arg0, arg1, arg2) {
|
|
980
1013
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
981
1014
|
return addHeapObject(ret);
|
|
982
1015
|
};
|
|
983
1016
|
|
|
984
|
-
export function
|
|
1017
|
+
export function __wbg_getTime_2bc4375165f02d15(arg0) {
|
|
985
1018
|
const ret = getObject(arg0).getTime();
|
|
986
1019
|
return ret;
|
|
987
1020
|
};
|
|
988
1021
|
|
|
989
|
-
export function
|
|
1022
|
+
export function __wbg_new0_7d84e5b2cd9fdc73() {
|
|
990
1023
|
const ret = new Date();
|
|
991
1024
|
return addHeapObject(ret);
|
|
992
1025
|
};
|