quadqr-js 1.5.4 → 1.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/README.md +2 -2
- package/dist/camera-scanner-worker.js +388 -734
- package/dist/esm/camera-scanner-worker-core.js +794 -0
- package/dist/esm/camera-scanner-worker.js +388 -734
- package/dist/esm/quadqr.js +315 -36
- package/dist/quadqr.js +315 -36
- package/dist/quadqr.min.js +315 -36
- package/docs/API.md +2 -0
- package/docs/BROWSER_CDN.md +4 -4
- package/docs/GETTING_STARTED.md +1 -1
- package/docs/WASM.md +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -782,7 +782,7 @@ console.log(result.text);
|
|
|
782
782
|
The `quadqr-js` package can be loaded directly from npm-backed CDNs:
|
|
783
783
|
|
|
784
784
|
```html
|
|
785
|
-
<script src="https://cdn.jsdelivr.net/npm/quadqr-js@1.5.
|
|
785
|
+
<script src="https://cdn.jsdelivr.net/npm/quadqr-js@1.5.5/dist/quadqr.min.js"></script>
|
|
786
786
|
<script>
|
|
787
787
|
const code = QuadQR.encodeText("Hello from a script tag");
|
|
788
788
|
</script>
|
|
@@ -1104,7 +1104,7 @@ Scans one frame from an HTML video element. By default, if the video is displaye
|
|
|
1104
1104
|
|
|
1105
1105
|
### `startCameraScanner(video, options?)`
|
|
1106
1106
|
|
|
1107
|
-
Starts a reusable live-camera scanning loop. On supported browsers it requests continuous focus/exposure/white-balance camera modes and scans the CSS-visible preview crop. Modern browsers use a **dual-worker camera engine**: a lightweight fresh-frame worker continuously runs normal finder/geometry/decode attempts, while an independent recovery worker retains the complete high-resolution, Auto Color, precise-alignment, perspective, multi-frame, ECC, and damaged-code recovery stack. A slow recovery attempt therefore cannot prevent the fast worker from inspecting a newer camera frame. Finder detection remains JavaScript; optional WASM accelerates grayscale/binary preprocessing and CRC beneath the same detector. The scheduler uses `requestVideoFrameCallback()` when available and does not queue stale fast-path frames. Normal camera acquisition requests an environment camera around 1280×720 and crops/resizes the visible preview to a 640 px working bitmap **before** transferring it to the worker. Once a candidate validates structure, Spectrum ECC, and CRC, scanning returns immediately. If the fast worker misses, full recovery runs concurrently on a fresh frame at up to 960 px. Strong finder evidence dispatches recovery quickly. Finder-less frames remain on the lightweight fresh-frame detector only, so pointing the camera at an empty scene never starts Auto Color or deeper recovery work. QuadQR Auto Color crop profiles, center-weighted histograms, threshold bracketing, precise alignment, projective recovery, QR-region enhancement, multi-frame confidence fusion, and soft-decision Spectrum ECC are unchanged. `cameraHighResolutionMaxDimension` defaults to 960. The optional `onDiagnostic(event)` callback exposes whether an event came from the fast or recovery worker, finder candidates, active locator method, crop/geometry/version hypothesis, recovery method, timing, and scan dimensions. `onResult(result, frame)` receives the exact frame that decoded, including enhanced recovery pixels when applicable, so UIs can keep the frozen frame and finder overlay aligned.
|
|
1107
|
+
Starts a reusable live-camera scanning loop. On supported browsers it requests continuous focus/exposure/white-balance camera modes and scans the CSS-visible preview crop. Modern browsers use a **dual-worker camera engine**: a lightweight fresh-frame worker continuously runs normal finder/geometry/decode attempts, while an independent recovery worker retains the complete high-resolution, Auto Color, precise-alignment, perspective, multi-frame, ECC, and damaged-code recovery stack. A slow recovery attempt therefore cannot prevent the fast worker from inspecting a newer camera frame. Finder detection remains JavaScript; optional WASM accelerates grayscale/binary preprocessing and CRC beneath the same detector. The scheduler uses `requestVideoFrameCallback()` when available and does not queue stale fast-path frames. Normal camera acquisition requests an environment camera around 1280×720 and crops/resizes the visible preview to a 640 px working bitmap **before** transferring it to the worker. Once a candidate validates structure, Spectrum ECC, and CRC, scanning returns immediately. If the fast worker misses, full recovery runs concurrently on a fresh frame at up to 960 px. Strong finder evidence dispatches recovery quickly. Finder-less frames remain on the lightweight fresh-frame detector only, so pointing the camera at an empty scene never starts Auto Color or deeper recovery work. QuadQR Auto Color crop profiles, center-weighted histograms, threshold bracketing, precise alignment, projective recovery, QR-region enhancement, multi-frame confidence fusion, and soft-decision Spectrum ECC are unchanged. `cameraHighResolutionMaxDimension` defaults to 960. The optional `onDiagnostic(event)` callback exposes whether an event came from the fast or recovery worker, finder candidates, active locator method, crop/geometry/version hypothesis, recovery method, timing, and scan dimensions. `onResult(result, frame)` receives the exact frame that decoded, including enhanced recovery pixels when applicable, so UIs can keep the frozen frame and finder overlay aligned. For repeated scanning, `continuous: true` is the preferred shorthand for keeping the stream alive (`stopOnResult: false` remains supported). Continuous mode suppresses the same CRC result for `duplicateCooldown` milliseconds by default (1200 ms), invalidates late results from the other worker lane after a successful decode, and resets tracking before the next symbol. `pauseWhenHidden` defaults to `true`; hidden tabs stop scheduling scan work and resume with fresh state. The returned scanner also exposes `pause()` and `resume()`, accepts an `AbortSignal` through `signal`, and cleans up if the camera track ends unexpectedly. The main-thread fallback now uses the same candidate-gated recovery rule, so miss count alone never wakes Auto Color or deeper recovery.
|
|
1108
1108
|
|
|
1109
1109
|
### `getVersionInfo(version, options?)`
|
|
1110
1110
|
|