(texture, width, height)
| 327 | } |
| 328 | |
| 329 | function 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 | |
| 342 | function downloadURI (filename, uri) { |
| 343 | let link = document.createElement('a'); |