()
| 370 | img.addEventListener("load", () => URL.revokeObjectURL(objectURL)); |
| 371 | |
| 372 | function updateLUTPreview() { |
| 373 | |
| 374 | if(params.lut["show LUT"]) { |
| 375 | |
| 376 | // This is pretty fast. |
| 377 | const lut = LookupTexture3D.from(lutEffect.getLUT()); |
| 378 | const { image } = lut.convertToUint8().toDataTexture(); |
| 379 | const rawImageData = RawImageData.from(image); |
| 380 | |
| 381 | // This takes a while if the image is large. |
| 382 | rawImageData.toCanvas().toBlob((blob) => { |
| 383 | |
| 384 | objectURL = URL.createObjectURL(blob); |
| 385 | img.src = objectURL; |
| 386 | img.classList.remove("hidden"); |
| 387 | |
| 388 | }); |
| 389 | |
| 390 | } else { |
| 391 | |
| 392 | img.classList.add("hidden"); |
| 393 | |
| 394 | } |
| 395 | |
| 396 | } |
| 397 | |
| 398 | function changeLUT() { |
| 399 |
nothing calls this directly
no test coverage detected