(menu)
| 317 | } |
| 318 | |
| 319 | registerOptions(menu) { |
| 320 | |
| 321 | const renderer = this.composer.getRenderer(); |
| 322 | const context = renderer.getContext(); |
| 323 | const capabilities = renderer.capabilities; |
| 324 | const assets = this.assets; |
| 325 | const luts = this.luts; |
| 326 | |
| 327 | const brightnessContrastEffect = this.brightnessContrastEffect; |
| 328 | const colorAverageEffect = this.colorAverageEffect; |
| 329 | const hueSaturationEffect = this.hueSaturationEffect; |
| 330 | const sepiaEffect = this.sepiaEffect; |
| 331 | const lutEffect = this.lutEffect; |
| 332 | |
| 333 | const params = { |
| 334 | colorAverage: { |
| 335 | "opacity": colorAverageEffect.blendMode.opacity.value, |
| 336 | "blend mode": colorAverageEffect.blendMode.blendFunction |
| 337 | }, |
| 338 | sepia: { |
| 339 | "opacity": sepiaEffect.blendMode.opacity.value, |
| 340 | "blend mode": sepiaEffect.blendMode.blendFunction |
| 341 | }, |
| 342 | brightnessContrast: { |
| 343 | "brightness": brightnessContrastEffect.uniforms.get("brightness").value, |
| 344 | "contrast": brightnessContrastEffect.uniforms.get("contrast").value, |
| 345 | "opacity": brightnessContrastEffect.blendMode.opacity.value, |
| 346 | "blend mode": brightnessContrastEffect.blendMode.blendFunction |
| 347 | }, |
| 348 | hueSaturation: { |
| 349 | "hue": 0.0, |
| 350 | "saturation": hueSaturationEffect.uniforms.get("saturation").value, |
| 351 | "opacity": hueSaturationEffect.blendMode.opacity.value, |
| 352 | "blend mode": hueSaturationEffect.blendMode.blendFunction |
| 353 | }, |
| 354 | lut: { |
| 355 | "LUT": lutEffect.getLUT().name, |
| 356 | "base size": lutEffect.getLUT().image.width, |
| 357 | "3D texture": true, |
| 358 | "tetrahedral filter": false, |
| 359 | "scale up": false, |
| 360 | "target size": 48, |
| 361 | "show LUT": false, |
| 362 | "opacity": lutEffect.blendMode.opacity.value, |
| 363 | "blend mode": lutEffect.blendMode.blendFunction |
| 364 | } |
| 365 | }; |
| 366 | |
| 367 | let objectURL = null; |
| 368 | |
| 369 | const img = document.querySelector(".lut"); |
| 370 | img.addEventListener("load", () => URL.revokeObjectURL(objectURL)); |
| 371 | |
| 372 | function updateLUTPreview() { |
| 373 | |
| 374 | if(params.lut["show LUT"]) { |
| 375 | |
| 376 | // This is pretty fast. |
nothing calls this directly
no test coverage detected