You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let ctx = c.getContext("2d");
let canvasDataWrapper = ctx.getImageData(0, 0, c.width, c.height);
let canvasData = imageDataWrapper.data; // 8 bit ARGB
let canvasData32 = new Uint32Array(canvasData.buffer); // 32 bit pixel
Hi thanks for your interest and taking the time to post this. I might not have time to look at this for a couple of months but I've always been curious as to whether this could be speeded up so I'm sure I'll look at it at some point.
I'm a firm believer of "relaxation driven development." That's where you're relaxed and decide to do a little bit of a puzzle/code for fun. Not that much around these days! Catch up with you in a month or two!
This may speed it up a little?
let ctx = c.getContext("2d");
let canvasDataWrapper = ctx.getImageData(0, 0, c.width, c.height);
let canvasData = imageDataWrapper.data; // 8 bit ARGB
let canvasData32 = new Uint32Array(canvasData.buffer); // 32 bit pixel
copyFnc = function(idxC, idxT){
canvasData[idxC + 0] = textureData[idxT + 0];
canvasData[idxC + 1] = textureData[idxT + 1];
canvasData[idxC + 2] = textureData[idxT + 2];
canvasData[idxC + 3] = 255;
};
Vs
copyFnc = function(idxC, idxT){
canvasData32[idxC] = textureData32[idxT]
};
The text was updated successfully, but these errors were encountered: