MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / updateLUTPreview

Method updateLUTPreview

demo/src/demos/ColorGradingDemo.js:372–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

getLUTMethod · 0.80
toDataTextureMethod · 0.80
convertToUint8Method · 0.80
toCanvasMethod · 0.80
addMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected