PhotoCraft's UI moves onto the shared craft UI framework in storytold/craft-libs (next branch): shell, dock and panels, hosted dialogs, keyboard, focus, IME and pointer routing, the canvas's view commands, themes and tokens. The engine, document model, file formats, commands and automation stay. PhotoCraft pins storytold/craft-libs next.
Integrate the merged cross-document implementation while retaining picked-layer sampling, ICC and source coverage, preview strength, and offset fixes. Preserve upstream explicit preview mappings and closed-document state, and adapt regression fixtures and mode/layer lifetime expectations.
apply_color_replacement and apply_mixer_stroke return a Result since #11070.
Two tests that landed on main after that PR's CI ran still dropped it, so
clippy's unused-must-use lint fails the gate on main.
* paint: refuse a sequential-dab stroke whose working copy is too large
apply_dab_stroke read the whole rectangle enclosing a stroke's dabs into
two dense f32 copies (and a third for the mix), sized by the area
between the dabs rather than what they paint. Two distant points asked
for gigabytes on a sparse document.
Check the three planes against a 4 GiB budget (1 GiB on 32-bit) before
reading, and paint nothing past it.
* address review: apply_dab_stroke returns Result so over-budget dab strokes fail with 'stroke too large'
* fix tests: apply_dab_stroke returns a Result
* fix tests: handle the Result of the dab-stroke functions
craft-cms was extracted from crates/cms (storytold/craft-libs#779), and both
copies changed afterwards. storytold/craft-libs#PRNUM ports the 41 commits made
here since the extraction, so the shared crate now has everything this copy
had, and PhotoCraft depends on it.
craft-cms returns errors where the local crate panicked on caller input:
transforms, tables and LUT constructors return Result. Call sites propagate
the error where the function already returns one, and fall back where the
arguments are fixed by construction (each with a comment saying why).
Lut3d's fields are private there; the proof and HDR display table is built
with Lut3d::from_fn.
The pin is the head of the craft-libs branch and moves to main when that
pull request merges.
The Smudge options bar gets Mode: (Normal, Darken, Lighten, Hue,
Saturation, Color, Luminosity; tooltip "Painting Mode"), first after the
brush controls. `paint.smudge` takes `mode` and refuses any other name;
the stroke sends it and Reset Tool sets Normal.
With a Mode other than Normal each dab's smudged colour is blended with
the pixel from before the stroke the way a paint colour would be, and
laid down through the tip's coverage. 8-bit RGB only: other colour modes
and depths were not measured and keep smudging as Normal. Blur and
Sharpen are unchanged.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Typed inks between two 8-bit levels (30% cyan is stored as 77/255) missed
the pixels filled with them at a low Tolerance and left partial alpha.
Round them as the foreground already is.
Protect Foreground Color and Sampling Background Swatch converted the
foreground and background from their sRGB stand-ins, so a colour picked
as CMYK inks (100/0/0/0) came back as other inks and pixels painted with
exactly those inks were erased or missed. BgEraseSettings now carries the
picked inks, as BrushSettings::color_cmyk does, and a CMYK target compares
against them while the colour is still that sRGB colour. RGB, Gray and Lab
documents are unchanged.
Smoothing::default() now has catch_up_on_end: false, so after Reset Tool
a smoothed stroke ends short of the release point unless the option is
turned on. Tests that relied on the old default set it explicitly.
davidmann4 measured the reference application on #11944: on an empty layer,
Wet and Mix change nothing, and the centre alpha is about 251 x Flow / 100
(126 at Flow 50, 251 at Flow 100, at Wet 80 with Mix 50 and Mix 90). This
test pins that row.
main brought the graded erase (#11901), decontamination (#11902) and graded
Find Edges (#11904) into bg_erase.rs, and kept Protect Foreground Color on the
largest per-channel difference to the foreground. Resolved by narrowing the
Tolerance itself: with protection on, graded_weight runs on min(Tolerance,
distance from the sample to the foreground); a foreground equal to the sample
erases nothing. This replaces the distance stretch from before the merge.
Measured in the reference application with the issue's drag, foreground off in
two channels: (100,140,40) gives 0 32 75 112 156 196 238 255 (no protection),
(150,90,40) the block-5 row, (230,90,40) and (200,90,70) a Tolerance of 50
levels. So the narrowing uses the sample-match distance (largest increase plus
largest decrease), not the largest per-channel difference: the test on main
that kept the sampled colour for a two-channel foreground is replaced by these
rows. The reference rows of #11903 now match within 8 levels, 8- and 16-bit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Only the sample match uses the measured increase-plus-decrease distance (#11901).
Protect Foreground Color keeps today's largest per-channel difference, as #11903
asks for its unmeasured cases. The tolerance doc describes the new distance and
the graded falloff.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Current Brush Load menu gets a separator and the checkable entry Load
Solid Colors Only, off by default and kept with the Mixer Brush's own brush
(MixerSettings.solid_colors_only). With it on, Alt+click loads the one
colour under the hotspot (paint.mixerLoad) instead of the sampled tip image;
off, it loads the tip image as before.
When a dab picks up nothing (a transparent canvas under a clean pickup),
the reservoir is no longer cut to amount x (1 - mix x wet): the load is
deposited at full strength, as a dry dab. A click on a colour still mixes
it in as before.
In a Lab document the Color mode no longer blends through RGB (which
changed the pixel's L): it keeps the stored L and moves a and b to the
foreground's, as in the reference application. Hue, Saturation and
Luminosity keep today's RGB blend.
With Anti-alias off, a pixel the Color Replacement tip reaches at all is
replaced fully instead of blended by its partial coverage, so the tip has
a hard edge as in the reference application. With Anti-alias on the edge
stays blended, and a colour boundary stays hard either way.