rxing-wasm 0.3.1 → 0.3.2
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 +338 -444
- package/rxing_wasm.js +2 -1
- package/rxing_wasm_bg.js +643 -748
- package/rxing_wasm_bg.wasm +0 -0
package/rxing_wasm.d.ts
CHANGED
|
@@ -1,508 +1,402 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Encode a barcode with the given data, dimensions, and type
|
|
5
|
-
|
|
6
|
-
* @param {number} width
|
|
7
|
-
* @param {number} height
|
|
8
|
-
* @param {BarcodeFormat} bc_type
|
|
9
|
-
* @returns {string}
|
|
10
|
-
*/
|
|
4
|
+
* Encode a barcode with the given data, dimensions, and type
|
|
5
|
+
*/
|
|
11
6
|
export function encode_barcode(data: string, width: number, height: number, bc_type: BarcodeFormat): string;
|
|
12
7
|
/**
|
|
13
|
-
* Encode a barcode with the given data, dimensions, and type, use the given encoding hints
|
|
14
|
-
|
|
15
|
-
* @param {number} width
|
|
16
|
-
* @param {number} height
|
|
17
|
-
* @param {BarcodeFormat} bc_type
|
|
18
|
-
* @param {EncodeHintDictionary} hints
|
|
19
|
-
* @returns {string}
|
|
20
|
-
*/
|
|
8
|
+
* Encode a barcode with the given data, dimensions, and type, use the given encoding hints
|
|
9
|
+
*/
|
|
21
10
|
export function encode_barcode_with_hints(data: string, width: number, height: number, bc_type: BarcodeFormat, hints: EncodeHintDictionary): string;
|
|
22
11
|
/**
|
|
23
|
-
* Decode a barcode from an array of 8bit luma data
|
|
24
|
-
|
|
25
|
-
* @param {number} width
|
|
26
|
-
* @param {number} height
|
|
27
|
-
* @param {boolean | undefined} [try_harder]
|
|
28
|
-
* @param {boolean | undefined} [filter_image]
|
|
29
|
-
* @returns {BarcodeResult}
|
|
30
|
-
*/
|
|
12
|
+
* Decode a barcode from an array of 8bit luma data
|
|
13
|
+
*/
|
|
31
14
|
export function decode_barcode(data: Uint8Array, width: number, height: number, try_harder?: boolean, filter_image?: boolean): BarcodeResult;
|
|
32
15
|
/**
|
|
33
|
-
* Convert a javascript image context's data into luma 8.
|
|
34
|
-
*
|
|
35
|
-
* Data for this function can be found from any canvas object
|
|
36
|
-
* using the `data` property of an `ImageData` object.
|
|
37
|
-
* Such an object could be obtained using the `getImageData`
|
|
38
|
-
* method of a `CanvasRenderingContext2D` object.
|
|
39
|
-
|
|
40
|
-
* @returns {Uint8Array}
|
|
41
|
-
*/
|
|
16
|
+
* Convert a javascript image context's data into luma 8.
|
|
17
|
+
*
|
|
18
|
+
* Data for this function can be found from any canvas object
|
|
19
|
+
* using the `data` property of an `ImageData` object.
|
|
20
|
+
* Such an object could be obtained using the `getImageData`
|
|
21
|
+
* method of a `CanvasRenderingContext2D` object.
|
|
22
|
+
*/
|
|
42
23
|
export function convert_js_image_to_luma(data: Uint8Array): Uint8Array;
|
|
43
|
-
/**
|
|
44
|
-
* @param {HTMLCanvasElement} canvas
|
|
45
|
-
* @returns {Uint8Array}
|
|
46
|
-
*/
|
|
47
24
|
export function convert_canvas_to_luma(canvas: HTMLCanvasElement): Uint8Array;
|
|
48
|
-
/**
|
|
49
|
-
* @param {ImageData} image_data
|
|
50
|
-
* @returns {Uint8Array}
|
|
51
|
-
*/
|
|
52
25
|
export function convert_imagedata_to_luma(image_data: ImageData): Uint8Array;
|
|
53
26
|
/**
|
|
54
|
-
* Decode a barcode from an array of rgba data.
|
|
55
|
-
* Pixel data is in the form of:
|
|
56
|
-
* Each pixel is one u32, [r,g,b].
|
|
57
|
-
|
|
58
|
-
* @param {number} width
|
|
59
|
-
* @param {number} height
|
|
60
|
-
* @param {boolean | undefined} [try_harder]
|
|
61
|
-
* @returns {BarcodeResult}
|
|
62
|
-
*/
|
|
27
|
+
* Decode a barcode from an array of rgba data.
|
|
28
|
+
* Pixel data is in the form of:
|
|
29
|
+
* Each pixel is one u32, [r,g,b].
|
|
30
|
+
*/
|
|
63
31
|
export function decode_barcode_rgb(data: Uint32Array, width: number, height: number, try_harder?: boolean): BarcodeResult;
|
|
64
|
-
/**
|
|
65
|
-
* @param {Uint8Array} data
|
|
66
|
-
* @param {number} width
|
|
67
|
-
* @param {number} height
|
|
68
|
-
* @param {DecodeHintDictionary} hints
|
|
69
|
-
* @param {boolean | undefined} [filter_image]
|
|
70
|
-
* @returns {BarcodeResult}
|
|
71
|
-
*/
|
|
72
32
|
export function decode_barcode_with_hints(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary, filter_image?: boolean): BarcodeResult;
|
|
73
|
-
/**
|
|
74
|
-
* @param {Uint8Array} data
|
|
75
|
-
* @param {number} width
|
|
76
|
-
* @param {number} height
|
|
77
|
-
* @param {DecodeHintDictionary} hints
|
|
78
|
-
* @param {boolean | undefined} [filter_image]
|
|
79
|
-
* @returns {(BarcodeResult)[]}
|
|
80
|
-
*/
|
|
81
33
|
export function decode_multi(data: Uint8Array, width: number, height: number, hints: DecodeHintDictionary, filter_image?: boolean): (BarcodeResult)[];
|
|
82
34
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
*
|
|
87
|
-
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
88
|
-
* * Type depends on the encoder. For example for QR codes it's type
|
|
89
|
-
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
90
|
-
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
91
|
-
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
92
|
-
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
93
|
-
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
94
|
-
*
|
|
95
|
-
*/
|
|
96
|
-
ErrorCorrection = 0,
|
|
97
|
-
/**
|
|
98
|
-
*
|
|
99
|
-
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
100
|
-
*
|
|
101
|
-
*/
|
|
102
|
-
CharacterSet = 1,
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
106
|
-
*
|
|
107
|
-
*/
|
|
108
|
-
DataMatrixShape = 2,
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
112
|
-
* * {@link String } value).
|
|
113
|
-
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
114
|
-
* * character set via ECIs.
|
|
115
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
116
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
117
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
118
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
119
|
-
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
120
|
-
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
121
|
-
* * for the purpose of delimiting AIs.
|
|
122
|
-
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
DataMatrixCompact = 3,
|
|
126
|
-
/**
|
|
127
|
-
*
|
|
128
|
-
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
129
|
-
* *
|
|
130
|
-
* * @deprecated use width/height params in
|
|
131
|
-
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
MinSize = 4,
|
|
135
|
-
/**
|
|
136
|
-
*
|
|
137
|
-
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
138
|
-
* *
|
|
139
|
-
* * @deprecated without replacement
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
MaxSize = 5,
|
|
143
|
-
/**
|
|
144
|
-
*
|
|
145
|
-
* * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
|
146
|
-
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
147
|
-
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
MARGIN = 6,
|
|
151
|
-
/**
|
|
152
|
-
*
|
|
153
|
-
* * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
|
|
154
|
-
* * {@link String} value).
|
|
155
|
-
*
|
|
156
|
-
*/
|
|
157
|
-
Pdf417Compact = 7,
|
|
158
|
-
/**
|
|
159
|
-
*
|
|
160
|
-
* * Specifies what compaction mode to use for PDF417 (type
|
|
161
|
-
* * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
|
|
162
|
-
* * enum values).
|
|
163
|
-
*
|
|
164
|
-
*/
|
|
165
|
-
Pdf417Compaction = 8,
|
|
166
|
-
/**
|
|
167
|
-
*
|
|
168
|
-
* * Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
|
169
|
-
* * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
|
170
|
-
*
|
|
171
|
-
*/
|
|
172
|
-
Pdf417Dimensions = 9,
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
175
|
-
* * Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false"
|
|
176
|
-
* * {@link String} value).
|
|
177
|
-
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
178
|
-
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
179
|
-
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
180
|
-
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
181
|
-
*
|
|
182
|
-
*/
|
|
183
|
-
Pdf417AutoEci = 10,
|
|
184
|
-
/**
|
|
185
|
-
*
|
|
186
|
-
* * Specifies the required number of layers for an Aztec code.
|
|
187
|
-
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
188
|
-
* * 0 indicates to use the minimum number of layers (the default).
|
|
189
|
-
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
190
|
-
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
191
|
-
*
|
|
192
|
-
*/
|
|
193
|
-
AztecLayers = 11,
|
|
194
|
-
/**
|
|
195
|
-
*
|
|
196
|
-
* * Specifies the exact version of QR code to be encoded.
|
|
197
|
-
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
198
|
-
*
|
|
199
|
-
*/
|
|
200
|
-
QrVersion = 12,
|
|
201
|
-
/**
|
|
202
|
-
*
|
|
203
|
-
* * Specifies the QR code mask pattern to be used. Allowed values are
|
|
204
|
-
* * 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select
|
|
205
|
-
* * the optimal mask pattern.
|
|
206
|
-
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
207
|
-
*
|
|
208
|
-
*/
|
|
209
|
-
QrMaskPattern = 13,
|
|
210
|
-
/**
|
|
211
|
-
*
|
|
212
|
-
* * Specifies whether to use compact mode for QR code (type {@link Boolean}, or "true" or "false"
|
|
213
|
-
* * {@link String } value).
|
|
214
|
-
* * Please note that when compaction is performed, the most compact character encoding is chosen
|
|
215
|
-
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
216
|
-
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
217
|
-
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
218
|
-
*
|
|
219
|
-
*/
|
|
220
|
-
QrCompact = 14,
|
|
221
|
-
/**
|
|
222
|
-
*
|
|
223
|
-
* * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
|
|
224
|
-
* * {@link String } value).
|
|
225
|
-
*
|
|
226
|
-
*/
|
|
227
|
-
Gs1Format = 15,
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
* * Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}).
|
|
231
|
-
* * Valid values are "A", "B", "C".
|
|
232
|
-
* * This option and {@link #CODE128_COMPACT} are mutually exclusive.
|
|
233
|
-
*
|
|
234
|
-
*/
|
|
235
|
-
ForceCodeSet = 16,
|
|
236
|
-
/**
|
|
237
|
-
*
|
|
238
|
-
* * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
|
|
239
|
-
* * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
|
|
240
|
-
*
|
|
241
|
-
*/
|
|
242
|
-
ForceC40 = 17,
|
|
243
|
-
/**
|
|
244
|
-
*
|
|
245
|
-
* * Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false"
|
|
246
|
-
* * {@link String } value).
|
|
247
|
-
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
248
|
-
* * exclusive.
|
|
249
|
-
*
|
|
250
|
-
*/
|
|
251
|
-
Code128Compact = 18,
|
|
252
|
-
TelepenAsNumeric = 19,
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
*/
|
|
256
|
-
export enum DecodeHintTypes {
|
|
257
|
-
/**
|
|
258
|
-
*
|
|
259
|
-
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
260
|
-
*
|
|
261
|
-
*/
|
|
262
|
-
Other = 0,
|
|
263
|
-
/**
|
|
264
|
-
*
|
|
265
|
-
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
266
|
-
* * use {@link Boolean#TRUE}.
|
|
267
|
-
*
|
|
268
|
-
*/
|
|
269
|
-
PureBarcode = 1,
|
|
270
|
-
/**
|
|
271
|
-
*
|
|
272
|
-
* * Image is known to be of one of a few possible formats.
|
|
273
|
-
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
274
|
-
*
|
|
275
|
-
*/
|
|
276
|
-
PossibleFormats = 2,
|
|
277
|
-
/**
|
|
278
|
-
*
|
|
279
|
-
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
280
|
-
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
281
|
-
*
|
|
282
|
-
*/
|
|
283
|
-
TryHarder = 3,
|
|
284
|
-
/**
|
|
285
|
-
*
|
|
286
|
-
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
287
|
-
*
|
|
288
|
-
*/
|
|
289
|
-
CharacterSet = 4,
|
|
290
|
-
/**
|
|
291
|
-
*
|
|
292
|
-
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
293
|
-
*
|
|
294
|
-
*/
|
|
295
|
-
AllowedLengths = 5,
|
|
296
|
-
/**
|
|
297
|
-
*
|
|
298
|
-
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
299
|
-
* * use {@link Boolean#TRUE}.
|
|
300
|
-
*
|
|
301
|
-
*/
|
|
302
|
-
AssumeCode39CheckDigit = 6,
|
|
303
|
-
/**
|
|
304
|
-
*
|
|
305
|
-
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
306
|
-
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
307
|
-
* * use {@link Boolean#TRUE}.
|
|
308
|
-
*
|
|
309
|
-
*/
|
|
310
|
-
AssumeGs1 = 7,
|
|
311
|
-
/**
|
|
312
|
-
*
|
|
313
|
-
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
314
|
-
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
315
|
-
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
316
|
-
*
|
|
317
|
-
*/
|
|
318
|
-
ReturnCodabarStartEnd = 8,
|
|
319
|
-
/**
|
|
320
|
-
*
|
|
321
|
-
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
322
|
-
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
323
|
-
*
|
|
324
|
-
*/
|
|
325
|
-
NeedResultPointCallback = 9,
|
|
326
|
-
/**
|
|
327
|
-
*
|
|
328
|
-
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
329
|
-
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
330
|
-
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
331
|
-
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
332
|
-
* * at all.
|
|
333
|
-
*
|
|
334
|
-
*/
|
|
335
|
-
AllowedEanExtensions = 10,
|
|
336
|
-
/**
|
|
337
|
-
*
|
|
338
|
-
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
339
|
-
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
340
|
-
*
|
|
341
|
-
*/
|
|
342
|
-
AlsoInverted = 11,
|
|
343
|
-
/**
|
|
344
|
-
*
|
|
345
|
-
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
346
|
-
*
|
|
347
|
-
*/
|
|
348
|
-
TelepenAsNumeric = 12,
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Available barcode types
|
|
352
|
-
*/
|
|
35
|
+
* Available barcode types
|
|
36
|
+
*/
|
|
353
37
|
export enum BarcodeFormat {
|
|
354
|
-
/**
|
|
355
|
-
* Aztec 2D barcode format.
|
|
356
|
-
*/
|
|
38
|
+
/**
|
|
39
|
+
* Aztec 2D barcode format.
|
|
40
|
+
*/
|
|
357
41
|
AZTEC = 0,
|
|
358
|
-
/**
|
|
359
|
-
* CODABAR 1D format.
|
|
360
|
-
*/
|
|
42
|
+
/**
|
|
43
|
+
* CODABAR 1D format.
|
|
44
|
+
*/
|
|
361
45
|
CODABAR = 1,
|
|
362
|
-
/**
|
|
363
|
-
* Code 39 1D format.
|
|
364
|
-
*/
|
|
46
|
+
/**
|
|
47
|
+
* Code 39 1D format.
|
|
48
|
+
*/
|
|
365
49
|
Code39 = 2,
|
|
366
|
-
/**
|
|
367
|
-
* Code 93 1D format.
|
|
368
|
-
*/
|
|
50
|
+
/**
|
|
51
|
+
* Code 93 1D format.
|
|
52
|
+
*/
|
|
369
53
|
Code93 = 3,
|
|
370
|
-
/**
|
|
371
|
-
* Code 128 1D format.
|
|
372
|
-
*/
|
|
54
|
+
/**
|
|
55
|
+
* Code 128 1D format.
|
|
56
|
+
*/
|
|
373
57
|
Code128 = 4,
|
|
374
|
-
/**
|
|
375
|
-
* Data Matrix 2D barcode format.
|
|
376
|
-
*/
|
|
58
|
+
/**
|
|
59
|
+
* Data Matrix 2D barcode format.
|
|
60
|
+
*/
|
|
377
61
|
DataMatrix = 5,
|
|
378
|
-
/**
|
|
379
|
-
* EAN-8 1D format.
|
|
380
|
-
*/
|
|
62
|
+
/**
|
|
63
|
+
* EAN-8 1D format.
|
|
64
|
+
*/
|
|
381
65
|
Ean8 = 6,
|
|
382
|
-
/**
|
|
383
|
-
* EAN-13 1D format.
|
|
384
|
-
*/
|
|
66
|
+
/**
|
|
67
|
+
* EAN-13 1D format.
|
|
68
|
+
*/
|
|
385
69
|
Ean13 = 7,
|
|
386
|
-
/**
|
|
387
|
-
* ITF (Interleaved Two of Five) 1D format.
|
|
388
|
-
*/
|
|
70
|
+
/**
|
|
71
|
+
* ITF (Interleaved Two of Five) 1D format.
|
|
72
|
+
*/
|
|
389
73
|
ITF = 8,
|
|
390
|
-
/**
|
|
391
|
-
* MaxiCode 2D barcode format.
|
|
392
|
-
*/
|
|
74
|
+
/**
|
|
75
|
+
* MaxiCode 2D barcode format.
|
|
76
|
+
*/
|
|
393
77
|
MAXICODE = 9,
|
|
394
|
-
/**
|
|
395
|
-
* PDF417 format.
|
|
396
|
-
*/
|
|
78
|
+
/**
|
|
79
|
+
* PDF417 format.
|
|
80
|
+
*/
|
|
397
81
|
Pdf417 = 10,
|
|
398
|
-
/**
|
|
399
|
-
* QR Code 2D barcode format.
|
|
400
|
-
*/
|
|
82
|
+
/**
|
|
83
|
+
* QR Code 2D barcode format.
|
|
84
|
+
*/
|
|
401
85
|
QrCode = 11,
|
|
402
|
-
/**
|
|
403
|
-
* RSS 14
|
|
404
|
-
*/
|
|
86
|
+
/**
|
|
87
|
+
* RSS 14
|
|
88
|
+
*/
|
|
405
89
|
Rss14 = 12,
|
|
406
|
-
/**
|
|
407
|
-
* RSS EXPANDED
|
|
408
|
-
*/
|
|
90
|
+
/**
|
|
91
|
+
* RSS EXPANDED
|
|
92
|
+
*/
|
|
409
93
|
RssExpanded = 13,
|
|
410
|
-
/**
|
|
411
|
-
* UPC-A 1D format.
|
|
412
|
-
*/
|
|
94
|
+
/**
|
|
95
|
+
* UPC-A 1D format.
|
|
96
|
+
*/
|
|
413
97
|
UpcA = 14,
|
|
414
|
-
/**
|
|
415
|
-
* UPC-E 1D format.
|
|
416
|
-
*/
|
|
98
|
+
/**
|
|
99
|
+
* UPC-E 1D format.
|
|
100
|
+
*/
|
|
417
101
|
UpcE = 15,
|
|
418
|
-
/**
|
|
419
|
-
* UPC/EAN extension format. Not a stand-alone format.
|
|
420
|
-
*/
|
|
102
|
+
/**
|
|
103
|
+
* UPC/EAN extension format. Not a stand-alone format.
|
|
104
|
+
*/
|
|
421
105
|
UpcEanExtension = 16,
|
|
422
106
|
MicroQR = 17,
|
|
423
107
|
Telepen = 18,
|
|
424
108
|
RectangularMicroQR = 19,
|
|
425
109
|
UnsuportedFormat = 20,
|
|
426
110
|
}
|
|
427
|
-
|
|
428
|
-
|
|
111
|
+
export enum DecodeHintTypes {
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* * Unspecified, application-specific hint. Maps to an unspecified {@link Object}.
|
|
115
|
+
*
|
|
116
|
+
*/
|
|
117
|
+
Other = 0,
|
|
118
|
+
/**
|
|
119
|
+
*
|
|
120
|
+
* * Image is a pure monochrome image of a barcode. Doesn't matter what it maps to;
|
|
121
|
+
* * use {@link Boolean#TRUE}.
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
PureBarcode = 1,
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* * Image is known to be of one of a few possible formats.
|
|
128
|
+
* * Maps to a {@link List} of {@link BarcodeFormat}s.
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
PossibleFormats = 2,
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* * Spend more time to try to find a barcode; optimize for accuracy, not speed.
|
|
135
|
+
* * Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
136
|
+
*
|
|
137
|
+
*/
|
|
138
|
+
TryHarder = 3,
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
* * Specifies what character encoding to use when decoding, where applicable (type String)
|
|
142
|
+
*
|
|
143
|
+
*/
|
|
144
|
+
CharacterSet = 4,
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* * Allowed lengths of encoded data -- reject anything else. Maps to an {@code int[]}.
|
|
148
|
+
*
|
|
149
|
+
*/
|
|
150
|
+
AllowedLengths = 5,
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* * Assume Code 39 codes employ a check digit. Doesn't matter what it maps to;
|
|
154
|
+
* * use {@link Boolean#TRUE}.
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
AssumeCode39CheckDigit = 6,
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
* * Assume the barcode is being processed as a GS1 barcode, and modify behavior as needed.
|
|
161
|
+
* * For example this affects FNC1 handling for Code 128 (aka GS1-128). Doesn't matter what it maps to;
|
|
162
|
+
* * use {@link Boolean#TRUE}.
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
AssumeGs1 = 7,
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* * If true, return the start and end digits in a Codabar barcode instead of stripping them. They
|
|
169
|
+
* * are alpha, whereas the rest are numeric. By default, they are stripped, but this causes them
|
|
170
|
+
* * to not be. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
ReturnCodabarStartEnd = 8,
|
|
174
|
+
/**
|
|
175
|
+
*
|
|
176
|
+
* * The caller needs to be notified via callback when a possible {@link RXingResultPoint}
|
|
177
|
+
* * is found. Maps to a {@link RXingResultPointCallback}.
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
NeedResultPointCallback = 9,
|
|
181
|
+
/**
|
|
182
|
+
*
|
|
183
|
+
* * Allowed extension lengths for EAN or UPC barcodes. Other formats will ignore this.
|
|
184
|
+
* * Maps to an {@code int[]} of the allowed extension lengths, for example [2], [5], or [2, 5].
|
|
185
|
+
* * If it is optional to have an extension, do not set this hint. If this is set,
|
|
186
|
+
* * and a UPC or EAN barcode is found but an extension is not, then no result will be returned
|
|
187
|
+
* * at all.
|
|
188
|
+
*
|
|
189
|
+
*/
|
|
190
|
+
AllowedEanExtensions = 10,
|
|
191
|
+
/**
|
|
192
|
+
*
|
|
193
|
+
* * If true, also tries to decode as inverted image. All configured decoders are simply called a
|
|
194
|
+
* * second time with an inverted image. Doesn't matter what it maps to; use {@link Boolean#TRUE}.
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
197
|
+
AlsoInverted = 11,
|
|
198
|
+
/**
|
|
199
|
+
*
|
|
200
|
+
* * Translate the ASCII values parsed by the Telepen reader into the Telepen Numeric form; use {@link Boolean#TRUE}.
|
|
201
|
+
*
|
|
202
|
+
*/
|
|
203
|
+
TelepenAsNumeric = 12,
|
|
204
|
+
}
|
|
205
|
+
export enum EncodeHintTypes {
|
|
206
|
+
/**
|
|
207
|
+
*
|
|
208
|
+
* * Specifies what degree of error correction to use, for example in QR Codes.
|
|
209
|
+
* * Type depends on the encoder. For example for QR codes it's type
|
|
210
|
+
* * {@link com.google.zxing.qrcode.decoder.ErrorCorrectionLevel ErrorCorrectionLevel}.
|
|
211
|
+
* * For Aztec it is of type {@link Integer}, representing the minimal percentage of error correction words.
|
|
212
|
+
* * For PDF417 it is of type {@link Integer}, valid values being 0 to 8.
|
|
213
|
+
* * In all cases, it can also be a {@link String} representation of the desired value as well.
|
|
214
|
+
* * Note: an Aztec symbol should have a minimum of 25% EC words.
|
|
215
|
+
*
|
|
216
|
+
*/
|
|
217
|
+
ErrorCorrection = 0,
|
|
218
|
+
/**
|
|
219
|
+
*
|
|
220
|
+
* * Specifies what character encoding to use where applicable (type {@link String})
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
CharacterSet = 1,
|
|
224
|
+
/**
|
|
225
|
+
*
|
|
226
|
+
* * Specifies the matrix shape for Data Matrix (type {@link com.google.zxing.datamatrix.encoder.SymbolShapeHint})
|
|
227
|
+
*
|
|
228
|
+
*/
|
|
229
|
+
DataMatrixShape = 2,
|
|
230
|
+
/**
|
|
231
|
+
*
|
|
232
|
+
* * Specifies whether to use compact mode for Data Matrix (type {@link Boolean}, or "true" or "false"
|
|
233
|
+
* * {@link String } value).
|
|
234
|
+
* * The compact encoding mode also supports the encoding of characters that are not in the ISO-8859-1
|
|
235
|
+
* * character set via ECIs.
|
|
236
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
237
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
238
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
239
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
240
|
+
* * Compact encoding also provides GS1-FNC1 support when {@link #GS1_FORMAT} is selected. In this case
|
|
241
|
+
* * group-separator character (ASCII 29 decimal) can be used to encode the positions of FNC1 codewords
|
|
242
|
+
* * for the purpose of delimiting AIs.
|
|
243
|
+
* * This option and {@link #FORCE_C40} are mutually exclusive.
|
|
244
|
+
*
|
|
245
|
+
*/
|
|
246
|
+
DataMatrixCompact = 3,
|
|
247
|
+
/**
|
|
248
|
+
*
|
|
249
|
+
* * Specifies a minimum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
250
|
+
* *
|
|
251
|
+
* * @deprecated use width/height params in
|
|
252
|
+
* * {@link com.google.zxing.datamatrix.DataMatrixWriter#encode(String, BarcodeFormat, int, int)}
|
|
253
|
+
*
|
|
254
|
+
*/
|
|
255
|
+
MinSize = 4,
|
|
256
|
+
/**
|
|
257
|
+
*
|
|
258
|
+
* * Specifies a maximum barcode size (type {@link Dimension}). Only applicable to Data Matrix now.
|
|
259
|
+
* *
|
|
260
|
+
* * @deprecated without replacement
|
|
261
|
+
*
|
|
262
|
+
*/
|
|
263
|
+
MaxSize = 5,
|
|
264
|
+
/**
|
|
265
|
+
*
|
|
266
|
+
* * Specifies margin, in pixels, to use when generating the barcode. The meaning can vary
|
|
267
|
+
* * by format; for example it controls margin before and after the barcode horizontally for
|
|
268
|
+
* * most 1D formats. (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
269
|
+
*
|
|
270
|
+
*/
|
|
271
|
+
MARGIN = 6,
|
|
272
|
+
/**
|
|
273
|
+
*
|
|
274
|
+
* * Specifies whether to use compact mode for PDF417 (type {@link Boolean}, or "true" or "false"
|
|
275
|
+
* * {@link String} value).
|
|
276
|
+
*
|
|
277
|
+
*/
|
|
278
|
+
Pdf417Compact = 7,
|
|
279
|
+
/**
|
|
280
|
+
*
|
|
281
|
+
* * Specifies what compaction mode to use for PDF417 (type
|
|
282
|
+
* * {@link com.google.zxing.pdf417.encoder.Compaction Compaction} or {@link String} value of one of its
|
|
283
|
+
* * enum values).
|
|
284
|
+
*
|
|
285
|
+
*/
|
|
286
|
+
Pdf417Compaction = 8,
|
|
287
|
+
/**
|
|
288
|
+
*
|
|
289
|
+
* * Specifies the minimum and maximum number of rows and columns for PDF417 (type
|
|
290
|
+
* * {@link com.google.zxing.pdf417.encoder.Dimensions Dimensions}).
|
|
291
|
+
*
|
|
292
|
+
*/
|
|
293
|
+
Pdf417Dimensions = 9,
|
|
294
|
+
/**
|
|
295
|
+
*
|
|
296
|
+
* * Specifies whether to automatically insert ECIs when encoding PDF417 (type {@link Boolean}, or "true" or "false"
|
|
297
|
+
* * {@link String} value).
|
|
298
|
+
* * Please note that in that case, the most compact character encoding is chosen for characters in
|
|
299
|
+
* * the input that are not in the ISO-8859-1 character set. Based on experience, some scanners do not
|
|
300
|
+
* * support encodings like cp-1256 (Arabic). In such cases the encoding can be forced to UTF-8 by
|
|
301
|
+
* * means of the {@link #CHARACTER_SET} encoding hint.
|
|
302
|
+
*
|
|
303
|
+
*/
|
|
304
|
+
Pdf417AutoEci = 10,
|
|
305
|
+
/**
|
|
306
|
+
*
|
|
307
|
+
* * Specifies the required number of layers for an Aztec code.
|
|
308
|
+
* * A negative number (-1, -2, -3, -4) specifies a compact Aztec code.
|
|
309
|
+
* * 0 indicates to use the minimum number of layers (the default).
|
|
310
|
+
* * A positive number (1, 2, .. 32) specifies a normal (non-compact) Aztec code.
|
|
311
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
312
|
+
*
|
|
313
|
+
*/
|
|
314
|
+
AztecLayers = 11,
|
|
315
|
+
/**
|
|
316
|
+
*
|
|
317
|
+
* * Specifies the exact version of QR code to be encoded.
|
|
318
|
+
* * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
319
|
+
*
|
|
320
|
+
*/
|
|
321
|
+
QrVersion = 12,
|
|
322
|
+
/**
|
|
323
|
+
*
|
|
324
|
+
* * Specifies the QR code mask pattern to be used. Allowed values are
|
|
325
|
+
* * 0..QRCode.NUM_MASK_PATTERNS-1. By default the code will automatically select
|
|
326
|
+
* * the optimal mask pattern.
|
|
327
|
+
* * * (Type {@link Integer}, or {@link String} representation of the integer value).
|
|
328
|
+
*
|
|
329
|
+
*/
|
|
330
|
+
QrMaskPattern = 13,
|
|
331
|
+
/**
|
|
332
|
+
*
|
|
333
|
+
* * Specifies whether to use compact mode for QR code (type {@link Boolean}, or "true" or "false"
|
|
334
|
+
* * {@link String } value).
|
|
335
|
+
* * Please note that when compaction is performed, the most compact character encoding is chosen
|
|
336
|
+
* * for characters in the input that are not in the ISO-8859-1 character set. Based on experience,
|
|
337
|
+
* * some scanners do not support encodings like cp-1256 (Arabic). In such cases the encoding can
|
|
338
|
+
* * be forced to UTF-8 by means of the {@link #CHARACTER_SET} encoding hint.
|
|
339
|
+
*
|
|
340
|
+
*/
|
|
341
|
+
QrCompact = 14,
|
|
342
|
+
/**
|
|
343
|
+
*
|
|
344
|
+
* * Specifies whether the data should be encoded to the GS1 standard (type {@link Boolean}, or "true" or "false"
|
|
345
|
+
* * {@link String } value).
|
|
346
|
+
*
|
|
347
|
+
*/
|
|
348
|
+
Gs1Format = 15,
|
|
349
|
+
/**
|
|
350
|
+
*
|
|
351
|
+
* * Forces which encoding will be used. Currently only used for Code-128 code sets (Type {@link String}).
|
|
352
|
+
* * Valid values are "A", "B", "C".
|
|
353
|
+
* * This option and {@link #CODE128_COMPACT} are mutually exclusive.
|
|
354
|
+
*
|
|
355
|
+
*/
|
|
356
|
+
ForceCodeSet = 16,
|
|
357
|
+
/**
|
|
358
|
+
*
|
|
359
|
+
* * Forces C40 encoding for data-matrix (type {@link Boolean}, or "true" or "false") {@link String } value). This
|
|
360
|
+
* * option and {@link #DATA_MATRIX_COMPACT} are mutually exclusive.
|
|
361
|
+
*
|
|
362
|
+
*/
|
|
363
|
+
ForceC40 = 17,
|
|
364
|
+
/**
|
|
365
|
+
*
|
|
366
|
+
* * Specifies whether to use compact mode for Code-128 code (type {@link Boolean}, or "true" or "false"
|
|
367
|
+
* * {@link String } value).
|
|
368
|
+
* * This can yield slightly smaller bar codes. This option and {@link #FORCE_CODE_SET} are mutually
|
|
369
|
+
* * exclusive.
|
|
370
|
+
*
|
|
371
|
+
*/
|
|
372
|
+
Code128Compact = 18,
|
|
373
|
+
TelepenAsNumeric = 19,
|
|
374
|
+
}
|
|
429
375
|
export class BarcodeResult {
|
|
376
|
+
private constructor();
|
|
430
377
|
free(): void;
|
|
431
|
-
/**
|
|
432
|
-
* @returns {number}
|
|
433
|
-
*/
|
|
434
378
|
timestamp(): number;
|
|
435
|
-
/**
|
|
436
|
-
* @returns {BarcodeFormat}
|
|
437
|
-
*/
|
|
438
379
|
format(): BarcodeFormat;
|
|
439
|
-
/**
|
|
440
|
-
* Each pair of f32 values is an (x,y) point
|
|
441
|
-
|
|
442
|
-
*/
|
|
380
|
+
/**
|
|
381
|
+
* Each pair of f32 values is an (x,y) point
|
|
382
|
+
*/
|
|
443
383
|
result_points(): Float32Array;
|
|
444
|
-
/**
|
|
445
|
-
* @returns {number}
|
|
446
|
-
*/
|
|
447
384
|
num_bits(): number;
|
|
448
|
-
/**
|
|
449
|
-
* @returns {Uint8Array}
|
|
450
|
-
*/
|
|
451
385
|
raw_bytes(): Uint8Array;
|
|
452
|
-
/**
|
|
453
|
-
* @returns {string}
|
|
454
|
-
*/
|
|
455
386
|
text(): string;
|
|
456
|
-
/**
|
|
457
|
-
* @returns {Map<any, any>}
|
|
458
|
-
*/
|
|
459
387
|
get_meta_data(): Map<any, any>;
|
|
460
388
|
}
|
|
461
|
-
/**
|
|
462
|
-
*/
|
|
463
389
|
export class DecodeHintDictionary {
|
|
464
390
|
free(): void;
|
|
465
|
-
/**
|
|
466
|
-
*/
|
|
467
391
|
constructor();
|
|
468
|
-
/**
|
|
469
|
-
* @param {DecodeHintTypes} hint
|
|
470
|
-
* @returns {string}
|
|
471
|
-
*/
|
|
472
392
|
get_hint(hint: DecodeHintTypes): string;
|
|
473
|
-
/**
|
|
474
|
-
* @param {DecodeHintTypes} hint
|
|
475
|
-
* @param {string} value
|
|
476
|
-
* @returns {boolean}
|
|
477
|
-
*/
|
|
478
393
|
set_hint(hint: DecodeHintTypes, value: string): boolean;
|
|
479
|
-
/**
|
|
480
|
-
* @param {DecodeHintTypes} hint
|
|
481
|
-
* @returns {boolean}
|
|
482
|
-
*/
|
|
483
394
|
remove_hint(hint: DecodeHintTypes): boolean;
|
|
484
395
|
}
|
|
485
|
-
/**
|
|
486
|
-
*/
|
|
487
396
|
export class EncodeHintDictionary {
|
|
488
397
|
free(): void;
|
|
489
|
-
/**
|
|
490
|
-
*/
|
|
491
398
|
constructor();
|
|
492
|
-
/**
|
|
493
|
-
* @param {EncodeHintTypes} hint
|
|
494
|
-
* @returns {string}
|
|
495
|
-
*/
|
|
496
399
|
get_hint(hint: EncodeHintTypes): string;
|
|
497
|
-
/**
|
|
498
|
-
* @param {EncodeHintTypes} hint
|
|
499
|
-
* @param {string} value
|
|
500
|
-
* @returns {boolean}
|
|
501
|
-
*/
|
|
502
400
|
set_hint(hint: EncodeHintTypes, value: string): boolean;
|
|
503
|
-
/**
|
|
504
|
-
* @param {EncodeHintTypes} hint
|
|
505
|
-
* @returns {boolean}
|
|
506
|
-
*/
|
|
507
401
|
remove_hint(hint: EncodeHintTypes): boolean;
|
|
508
402
|
}
|