From 54d53f1b91191fcd6f7d62cb0fcd20ca536eb788 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Mon, 10 Jun 2024 23:27:00 +0200 Subject: [PATCH] Remove unused code to make Aard work --- src/ext/lib/ar-detect/ArDetector.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/ext/lib/ar-detect/ArDetector.ts b/src/ext/lib/ar-detect/ArDetector.ts index 8c3ce04..08fe34e 100644 --- a/src/ext/lib/ar-detect/ArDetector.ts +++ b/src/ext/lib/ar-detect/ArDetector.ts @@ -84,9 +84,7 @@ class ArDetector { private animationFrameHandle: any; private attachedCanvas: HTMLCanvasElement; canvas: HTMLCanvasElement; - private blackframeCanvas: HTMLCanvasElement; private context: CanvasRenderingContext2D; - private blackframeContext: CanvasRenderingContext2D; canvasImageDataRowLength: number; private timers = { @@ -213,8 +211,6 @@ class ArDetector { // this.blackframeCanvas.height = this.settings.active.arDetect.canvasDimensions.blackframeCanvas.height; this.context = this.canvas.getContext("2d"); - // this.blackframeContext = this.blackframeCanvas.getContext("2d"); - // // [2] determine places we'll use to sample our main frame @@ -826,7 +822,7 @@ class ArDetector { return; } - if (!this.blackframeContext) { + if (!this.context) { this.init(); } @@ -980,16 +976,6 @@ class ArDetector { */ const bfDrawStartTime = performance.now(); - // await new Promise( - // resolve => { - // this.blackframeContext.drawImage(this.video, 0, 0, this.blackframeCanvas.width, this.blackframeCanvas.height); - // resolve(); - // } - // ); - // const rows = this.blackframeCanvas.height; - // const cols = this.blackframeCanvas.width; - // const bfImageData = this.blackframeContext.getImageData(0, 0, cols, rows).data; - const rows = this.settings.active.arDetect.canvasDimensions.blackframeCanvas.width; const cols = this.settings.active.arDetect.canvasDimensions.blackframeCanvas.height; const samples = rows * cols;