Skip to content

Commit

Permalink
use the module directly, because qt>6.6 removed the loader (#52) (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyTheCo authored Nov 10, 2023
1 parent 767a4b7 commit 80fad4e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions QtQrDec/Qrimagedecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ EM_JS(void, js_start, (), {
let canvas = document.querySelector("#qrcanvas");
let ctx=canvas.getContext("2d");
const processFrame = function () {
//You need to define qtQR module when loading the module of the qt application.
//You need to define qtQR module when loading the module of the qt application.
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const sourceBuffer = imageData.data;
if (qtQR.module() != null) {
const buffer = qtQR.module()._malloc(sourceBuffer.byteLength);
qtQR.module().HEAPU8.set(sourceBuffer, buffer);
qtQR.module().QRImageDecoder.getdecoder().reload(buffer,video.width,video.height);
qtQR.module()._free(buffer);
}
const buffer = qtQR._malloc(sourceBuffer.byteLength);
qtQR.HEAPU8.set(sourceBuffer, buffer);
qtQR.QRImageDecoder.getdecoder().reload(buffer,video.width,video.height);
qtQR._free(buffer);
if(window.localStream.active)
{
requestAnimationFrame(processFrame);
Expand Down

0 comments on commit 80fad4e

Please sign in to comment.