Created
March 18, 2014 01:29
-
-
Save djabif/9611904 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
// render result back to canvas | |
var data_u32 = new Uint32Array(imageData.data.buffer); | |
var alpha = (0xff << 24); | |
var i = img_u8.cols*img_u8.rows, pix = 0; | |
while(--i >= 0) { | |
pix = img_u8.data[i]; | |
data_u32[i] = alpha | (pix << 16) | (pix << 8) | pix; | |
} | |
ctx.putImageData(imageData, 0, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment