![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Established on top of fda814dd0c, 2026-11-14. Measurements on top of 6a9005ef9c, 2026-11-13.
_sample_picker_from_cache() (gui/color_picker_proxy.c) samples the module's input and output cachelines in the preview pipe and hands the module picked_color, picked_color_min and picked_color_max for its input (and the picked_output_* triple for its output). dt_color_picker_helper() blurs the area first (blur_2D_Bspline) and then takes the mean, minimum and maximum of each channel independently. A module that reads the minimum or the maximum therefore gets, in general, three values from three different pixels, and most reduce them over channels themselves (negadoctor's v_maxf() / v_minf()). When the module's quantity is monotone in each channel, its value equals the one it would compute on a single pixel per channel: the one holding that channel's extreme.
A picker declares which extremes its module reads with dt_color_picker_set_extremes(). For such a picker, and only for the input sample, the helper also scans the same blurred buffer for the first pixel in raster order holding each channel's minimum and maximum (strict < / >), so the pixel found holds exactly the value the module received. It records the pixel's buffer coordinates and all four of its channels (dt_color_picker_extremes_t). The proxy converts the coordinates back to raw-norm with the inverse of the picker box's own chain: the pixel centre over roi->scale, then dt_dev_distort_transform_plus() from the module's iop_order (FORW_INCL for the input), then image-abs → image-norm → raw-norm. It stores them in dev->color_picker with the picker they belong to; a new input sample, a reset, a deactivation or the picker widget's destruction clears them.
Locating costs one sequential pass over the area per sample; the statistics themselves already read every pixel of it.
Measured by dumping the blurred module input of negadoctor on 20250921_0007 (preview pipe) and replaying its D max, bias, paper black and print exposure pickers in Python, against one pixel chosen by its luminance (the darkest or the brightest one):
So the strict per-channel extreme stays, and the marks show which pixel each value comes from.