Last active
January 23, 2023 04:32
-
-
Save bigalex95/db0f99f424d07bc72808ea336eda7287 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
width = 256; | |
height = 256; | |
let dst = new Uint8Array(Module.HEAPU8.buffer, dst_ptr, width * height); | |
canvasResultsLenna.width = width; | |
canvasResultsLenna.height = height; | |
var imgData = ctxResultsLenna.createImageData(width, height); | |
for (var i = 0; i < dst.length; i++) { | |
imgData.data[i * 4] = dst[i]; | |
imgData.data[i * 4 + 1] = dst[i]; | |
imgData.data[i * 4 + 2] = dst[i]; | |
imgData.data[i * 4 + 3] = 255; | |
} | |
console.log(imgData); | |
ctxResultsLenna.putImageData(imgData, 0, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment