Created
March 2, 2019 19:33
Create image data
This file contains 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
window.plasmaRender = (w, h, ctx, buffer64) => { | |
let bytes = atob(buffer64); | |
let buffer = new Uint8ClampedArray(bytes.length); | |
for (let i = 0; i < bytes.length; i+=1) { | |
buffer[i] = bytes.charCodeAt(i); | |
} | |
let imageData = new ImageData(buffer, w, h); | |
ctx.putImageData(imageData, 0, 0); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment