Point at something grey and let the pipeline work out the rest

FR-DEV-3 has asked for "white balance (temperature/tint, and picker)" since
it was written, and only the first half existed. `WidgetKind::WhitePoint` was
in the vocabulary and `develop::supported` answered false for it, so the node
degraded to two sliders — correct behaviour that had quietly become the only
behaviour. Sampling a neutral is the first move of the global tonal pass and
every colour judgement afterwards is measured against where the grey was put,
so guessing at two sliders until a wall stops looking green is the wrong way
round.

The awkward part is that a picker genuinely needs to know how far a hundred
units of temperature move red against blue, and that number is declared in
the node's own file. So the inversion lives in `dr_pipeline::neutral` rather
than in the interface: the canvas hands over a colour, the core finds the
operation that asked to be driven by a pixel and bisects its declared
response until the sample comes back grey. Nothing in `ui/` names white
balance, and nothing holds a second copy of a response that would be wrong
the first time somebody adjusted the range. A bisection rather than a
closed-form inverse because only monotonicity is part of the bargain — the
expression is free to become a table tomorrow.

The result is rounded to the precision the control is drawn at, which is not
cosmetic: unrounded, sampling something already neutral lands a
ten-thousandth off zero, and the photograph comes back modified with an undo
step for a correction of nothing.

On the panel side this needed one distinction the generated path was
missing. `is_on_canvas` was being read as "and so the panel draws nothing for
it", which is right for a crop — four edge fractions are not controls anyone
drags in a list — and wrong for an eyedropper, which *writes* temperature and
tint and leaves them exactly the controls a photographer reaches for next.
So a sampling widget keeps its sliders and puts the affordance that arms the
canvas in the group's heading, built like the reset beside it. One click, one
sample, one history step: `Edit::Action` never coalesces, and there is no
hover preview to fill the stack with temperatures nobody chose.

Declaring the presentation also groups temperature and tint under one undo
step, where they were two. That follows from what `Presentation` means and
reads correctly — white balance is one decision — but it is a change, and
worth saying so.
This commit is contained in:
2026-09-06 19:01:52 +02:00
parent 2584b9ecbc
commit 901f51e6c4
11 changed files with 969 additions and 60 deletions
+27
View File
@@ -32,6 +32,33 @@ params:
label: param.tint
kind: amount
# An eyedropper, where the frontend has a canvas to hang one on.
#
# Sampling a neutral is the first move of the global tonal pass — every colour
# judgement afterwards is measured against where the grey was put — and it is
# a thing you do by pointing at the photograph, not by guessing at two sliders
# until a wall stops looking green.
#
# A *hint*, on the usual terms: the two parameters below stay ordinary
# addressable scalars, and a frontend with nowhere to host a sampler renders
# them as the sliders they already were. This one is additive rather than a
# replacement — the picker writes temperature and tint and the photographer
# still nudges them afterwards — which is a difference the frontend draws for
# itself; nothing here has to say it.
#
# The order matters and is the widget kind's own contract: the first parameter
# trades red against blue, the second green against magenta.
presentation:
widgets: [white_point]
params: [temperature, tint]
demand:
# A neutral is a point on the picture, so both axes at once.
two_dimensional: true
# Deliberately false. A grey card, a cloud, a white wall — the things
# worth sampling are large, and FR-UI-7 grows the hit region to the
# modality in any case, so a thumb is as workable as a mouse.
precise_pointing: false
# Temperature trades red against blue; tint trades green against magenta.
# Both are scaled so the full range is a strong but not destructive
# correction: ±0.5 in log2 at the extremes — half a stop of channel shift,