MCPcopy Create free account
hub / github.com/PavelDoGreat/WebGL-Fluid-Simulation / textureToCanvas

Function textureToCanvas

script.js:329–340  ·  view source on GitHub ↗
(texture, width, height)

Source from the content-addressed store, hash-verified

327}
328
329function textureToCanvas (texture, width, height) {
330 let captureCanvas = document.createElement('canvas');
331 let ctx = captureCanvas.getContext('2d');
332 captureCanvas.width = width;
333 captureCanvas.height = height;
334
335 let imageData = ctx.createImageData(width, height);
336 imageData.data.set(texture);
337 ctx.putImageData(imageData, 0, 0);
338
339 return captureCanvas;
340}
341
342function downloadURI (filename, uri) {
343 let link = document.createElement('a');

Callers 1

captureScreenshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected