From bf166ccbfbd18be6f5fe3ba157184a212db15054 Mon Sep 17 00:00:00 2001 From: wangzemei Date: Tue, 18 Oct 2022 16:34:30 +0800 Subject: [PATCH] * remove unused file --- module/report/js/processor.js | 46 ----------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 module/report/js/processor.js diff --git a/module/report/js/processor.js b/module/report/js/processor.js deleted file mode 100644 index dd8093fed1..0000000000 --- a/module/report/js/processor.js +++ /dev/null @@ -1,46 +0,0 @@ -let processor = { - timerCallback: function() { - if (this.video.paused || this.video.ended) { - return; - } - this.computeFrame(); - let self = this; - setTimeout(function () { - self.timerCallback(); - }, 0); - }, - - doLoad: function() { - this.video = document.getElementById("video"); - this.c1 = document.getElementById("c1"); - this.ctx1 = this.c1.getContext("2d"); - this.c2 = document.getElementById("c2"); - this.ctx2 = this.c2.getContext("2d"); - let self = this; - this.video.addEventListener("play", function() { - self.width = self.video.videoWidth / 2; - self.height = self.video.videoHeight / 2; - self.timerCallback(); - }, false); - }, - - computeFrame: function() { - this.ctx1.drawImage(this.video, 0, 0, this.width, this.height); - let frame = this.ctx1.getImageData(0, 0, this.width, this.height); - let l = frame.data.length / 4; - - for (let i = 0; i < l; i++) { - let r = frame.data[i * 4 + 0]; - let g = frame.data[i * 4 + 1]; - let b = frame.data[i * 4 + 2]; - if (g > 100 && r > 100 && b < 43) - frame.data[i * 4 + 3] = 0; - } - this.ctx2.putImageData(frame, 0, 0); - return; - } -}; - -document.addEventListener("DOMContentLoaded", () => { -processor.doLoad(); -}); \ No newline at end of file