mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Destructive adjustments (pixels::adjusted) and the RGBA filter helper (adjust_cmds process_surface) each had the same loop mixing the edited pixels back over the original by selection coverage, looking the selection's tile up for every pixel (sample_channel, a BTreeMap lookup per pixel). They now share pixels::mix_through_selection, which reads the coverage one row at a time with sample_row_strided: one tile lookup per tile per row, and a row-sized buffer. Results are unchanged: a new test compares the helper with the per-pixel sample_channel mix, bit for bit, for 8-bit, 8-bit-with-alpha and 32-bit selections over 8- and 16-bit layers, across tile edges and untouched (default) selection tiles. Claude-Session: https://claude.ai/code/session_01QUda3K786uop8kvEQoUjSf Co-authored-by: Claude <[email protected]>