@gueshbzh-perso/scanner 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/core.d.ts +12 -4
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +24 -11
- package/dist/core.js.map +1 -1
- package/dist/engine.d.ts +13 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +24 -4
- package/dist/engine.js.map +1 -1
- package/dist/native.d.ts +43 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +107 -0
- package/dist/native.js.map +1 -0
- package/dist/reader.d.ts +40 -1
- package/dist/reader.d.ts.map +1 -1
- package/dist/reader.js +186 -30
- package/dist/reader.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wasm/scanner_wasm.d.ts +20 -0
- package/dist/wasm/scanner_wasm.js +53 -0
- package/dist/wasm/scanner_wasm_bg.wasm +0 -0
- package/dist/wasm/scanner_wasm_bg.wasm.d.ts +2 -0
- package/package.json +1 -1
- package/src/core.ts +24 -11
- package/src/engine.ts +43 -5
- package/src/native.ts +140 -0
- package/src/reader.ts +205 -34
- package/src/types.ts +15 -0
package/src/types.ts
CHANGED
|
@@ -118,6 +118,17 @@ export interface ProcessingOptions {
|
|
|
118
118
|
maxDimension?: number;
|
|
119
119
|
/** Frame pipeline. `'auto'` uses WebGL2 and falls back to Canvas 2D. Default: `'auto'`. */
|
|
120
120
|
backend?: 'auto' | 'webgl' | 'canvas';
|
|
121
|
+
/**
|
|
122
|
+
* Use the browser's native `BarcodeDetector` (Chrome on Android, macOS and
|
|
123
|
+
* ChromeOS) as the fast pass, when it supports every requested format
|
|
124
|
+
* (`micro_qr` excepted). The engine's fallback strategies keep running on
|
|
125
|
+
* the frames it finds nothing in: hard codes (laser engraving, shadows…)
|
|
126
|
+
* are still read. Codes get the same confirmation and de-duplication.
|
|
127
|
+
* It reads codes whatever their orientation. Elsewhere (Safari, Firefox,
|
|
128
|
+
* Chrome on Windows / Linux), or if it fails, the engine does everything.
|
|
129
|
+
* `'off'`: always the engine alone. Default: `'auto'`.
|
|
130
|
+
*/
|
|
131
|
+
nativeDetector?: 'auto' | 'off';
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
export interface ReaderOptions extends EngineOptions, AssetOptions {
|
|
@@ -152,6 +163,10 @@ export interface ReaderStats {
|
|
|
152
163
|
worker: boolean;
|
|
153
164
|
/** Frames decoded in parallel (number of workers, `1` on the main thread). */
|
|
154
165
|
workers: number;
|
|
166
|
+
/** `true` when the native `BarcodeDetector` does the fast pass (see `processing.nativeDetector`). */
|
|
167
|
+
native: boolean;
|
|
168
|
+
/** Average native detection time, in ms (`0` when not used). */
|
|
169
|
+
nativeMs: number;
|
|
155
170
|
}
|
|
156
171
|
|
|
157
172
|
export interface ReaderEvents {
|