Support highlighting the outline of detected codes

This commit is contained in:
Daniel
2022-01-28 18:24:13 +01:00
parent 16ad9b9b82
commit 0d48a807f5
10 changed files with 188 additions and 142 deletions
+5 -2
View File
@@ -7,12 +7,14 @@ export default class QrScanner {
static listCameras(requestLabels?: boolean): Promise<Array<QrScanner.Camera>>;
readonly $video: HTMLVideoElement;
readonly $canvas: HTMLCanvasElement;
readonly $scanRegionHighlight?: HTMLDivElement;
readonly $highlightOverlay?: HTMLDivElement;
private readonly $codeOutlineHighlight?;
private readonly _onDecode?;
private readonly _legacyOnDecode?;
private readonly _legacyCanvasSize;
private _preferredCamera;
private _scanRegion;
private _codeOutlineHighlightRemovalTimeout?;
private _qrEnginePromise;
private _active;
private _paused;
@@ -23,6 +25,7 @@ export default class QrScanner {
calculateScanRegion?: (video: HTMLVideoElement) => QrScanner.ScanRegion;
preferredCamera?: QrScanner.FacingMode | QrScanner.DeviceId;
highlightScanRegion?: boolean;
highlightCodeOutline?: boolean;
/** just a temporary flag until we switch entirely to the new api */
returnDetailedScanResult?: true;
});
@@ -60,7 +63,7 @@ export default class QrScanner {
private _onLoadedMetaData;
private _onVisibilityChange;
private _calculateScanRegion;
private _updateScanRegionHighlight;
private _updateHighlightOverlay;
private static _convertPoints;
private _scanFrame;
private _onDecodeError;