photocraft/crates/ui-egui/examples
Brandon Thomas 8b0ceea374
Adjustment dialogs: GPU live preview through a clipped adjustment layer (#77) (#85)
* Adjustment dialogs: preview through a clipped adjustment layer on the GPU (#77)

While an Image › Adjustments dialog is open on a pixel layer, the canvas shows the
document with a temporary adjustment layer (the dialog's settings, the selection as
its mask) clipped to the target instead of re-running the command on a CPU proxy.
The canvas compositor draws it, so on the GPU canvas a change recomposites only the
target's area within the selection, and of that only what the view shows (the rest
catches up as the view moves); zoomed out on a large document it composites a copy
reduced to about screen resolution, built once per session. The base document and
region are built once per session; a change swaps the layer's adjustment in a
shallow copy. OK still runs the real command (one history step); Cancel drops it.

Kept on the CPU proxy where the layer composite can't match the command: non-pixel
or clipped targets, Blend If, visible untouched area, channel / Quick Mask targets,
CMYK/Lab/other modes, colour-making kinds in Grayscale, and documents the GPU
compositor doesn't cover. The navigator waits for settings to settle.

Tests: preview vs command within 1/255 (worst 0.37/255) for all 13 kinds at
8/16/32-bit, RGB and Gray, with/without selection; nothing changes outside the
region; dialog flow (cache, keys, damage, Cancel untouched, OK one step); GPU
parity of the preview and of the zoomed-out proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* interactive_bench: per-change Image › Adjustments dialog preview rows (#77)

Times the old CPU proxy preview against the clipped-layer preview at full
resolution, at 100 % view and zoomed out, with and without a selection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 23:31:05 -04:00
..
fx_bench.rs Large images: adapter texture limits, banded compositing/export, proxy thumbnails, history byte budget (#71) 2026-10-04 16:45:17 -04:00
interactive_bench.rs Adjustment dialogs: GPU live preview through a clipped adjustment layer (#77) (#85) 2026-10-04 23:31:05 -04:00
large_image_bench.rs GPU canvas: Rgba16Float display texture for 16/32-bit documents (#46) (#84) 2026-10-04 23:30:53 -04:00
parity.rs more algorithms, progress 2026-10-01 08:25:06 -04:00
snapshot.rs macOS: open files from Finder/Open With/Dock; file path, recent, warnings and .pcraft fixes (#63) 2026-10-04 15:18:03 -04:00