Skip to content
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6d29e03
LR-BEHAV-RENDER-FIDELITY: process V8, Whites and the tone curves meas…
smi-leonivkovic Nov 10, 2026
1835f3a
LR-EDIT-COLOR-MIXER-HSL: process V8, the colour mixer measured agains…
smi-leonivkovic Nov 10, 2026
b16fd0c
LR-BEHAV-RENDER-FIDELITY: doc comments for the V8 curve stage, Gap 3 …
smi-leonivkovic Nov 11, 2026
3fd3930
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
a8280a6
LR-EDIT-COLOR-MIXER-HSL: test that V8 leaves the mixer to the mixer s…
smi-leonivkovic Nov 11, 2026
6cb4e5b
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Nov 11, 2026
9188e4d
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
815ebe6
LR-BEHAV-RENDER-FIDELITY: what's new names process 9 (#523)
smi-leonivkovic Nov 11, 2026
95b9016
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
fc55dde
LR-BEHAV-RENDER-FIDELITY: review fixes: neutral-render claims, Whites…
smi-leonivkovic Nov 11, 2026
92f35bb
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
c7c5ee2
LR-EDIT-COLOR-MIXER-HSL: review fixes: each slider's amount bracket o…
smi-leonivkovic Nov 11, 2026
5154467
LR-BEHAV-RENDER-FIDELITY: review fixes: measured curve tables only at…
smi-leonivkovic Nov 11, 2026
93c9132
Merge lr-v8-tone into lr-v8-color; review fixes: V1 to V8 also run th…
smi-leonivkovic Nov 11, 2026
7d20abd
LR-BEHAV-RENDER-FIDELITY: review fix: Calibration runs before the ton…
smi-leonivkovic Nov 11, 2026
b1f6a66
LR-EDIT-LIGHT-CURVE-PARAM: the parametric graph draws and drags the c…
smi-leonivkovic Nov 11, 2026
0bbd0fc
LR-BEHAV-RENDER-FIDELITY: review fixes: the chart tool refuses render…
smi-leonivkovic Nov 11, 2026
e0193c8
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
b0e9b29
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 11, 2026
6f565fe
LR-EDIT-LIGHT-CURVE-PARAM: review fixes: a graph drag searches the cu…
smi-leonivkovic Nov 11, 2026
a8b4d7e
LR-BEHAV-RENDER-FIDELITY: review fixes: the measured tables are read …
smi-leonivkovic Nov 11, 2026
00405c3
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 11, 2026
0b26397
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 11, 2026
8bec5c5
LR-EDIT-LIGHT-CURVE-PARAM: review fixes: doc comments on the graph's …
smi-leonivkovic Nov 11, 2026
3437e59
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Nov 14, 2026
099c0f9
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 14, 2026
5ba1722
Merge branch 'lr-v8-tone' into lr-v9-curve-graph
smi-leonivkovic Nov 14, 2026
14909c4
curve_stage: say in apply's doc that values above white are added bac…
smi-leonivkovic Nov 18, 2026
f54fd34
LR-EDIT-LIGHT-CURVE-PARAM: the parametric graph's fix from #4126 land…
smi-leonivkovic Nov 20, 2026
03de271
Merge origin/main into lr-v8-tone
smi-leonivkovic Nov 20, 2026
789c1a0
LR-BEHAV-RENDER-FIDELITY: Whites and the parametric regions are a fit…
smi-leonivkovic Nov 24, 2026
d1ce3c8
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Nov 24, 2026
c9dfb53
LR-EDIT-COLOR-MIXER-HSL: the colour mixer is a fitted model, not a me…
smi-leonivkovic Nov 24, 2026
7c0e8ea
Merge main into lr-v8-tone (#523)
smi-leonivkovic Dec 2, 2026
be29de8
Merge remote-tracking branch 'origin/main' into lr-v8-tone
smi-leonivkovic Dec 3, 2026
5ae163c
Merge lr-v8-tone (with main) into lr-v8-color (#523)
smi-leonivkovic Dec 3, 2026
1f53475
test(curve): the drag test allows the framework's drag threshold, not…
smi-leonivkovic Dec 3, 2026
4f01fd1
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
ff7529a
Merge main into lr-v8-tone: the series moves to process V18 (#523)
smi-leonivkovic Dec 3, 2026
a85845d
test(proraw): V18's curve stage leaves Whites to the ProRAW chain; V1…
smi-leonivkovic Dec 3, 2026
2722f97
fix(curve_stage): Refine Saturation restores the colour after Whites …
smi-leonivkovic Dec 3, 2026
5a58233
fix(curve_input): under V18 sample where the curve stage reads (#523)
smi-leonivkovic Dec 3, 2026
de0c5a8
fix(tools): the tone charts' manifest carries the tool's prefix and f…
smi-leonivkovic Dec 3, 2026
ee3071e
Merge lr-v8-tone into lr-v8-color: the series moves to process V18 (#…
smi-leonivkovic Dec 3, 2026
023c93c
test(gpu): the curve-input prefix test names V17, where the sample is…
smi-leonivkovic Dec 3, 2026
e246094
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
a8872ab
fix(curve_input): on ProRAW the sample's curve stage leaves Whites to…
smi-leonivkovic Dec 3, 2026
fbf3704
Merge lr-v8-tone into lr-v8-color; curve-stage.md names V18's colour …
smi-leonivkovic Dec 3, 2026
587ed53
docs: V17's Apple ProRAW uses its chain's fitted Whites, not V2 White…
smi-leonivkovic Dec 3, 2026
6f70731
Merge branch 'lr-v8-tone' into lr-v8-color
smi-leonivkovic Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions crates/develop/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,17 @@ pub enum Process {
/// V16, with Apple ProRAW's tone sliders running in Lightroom's fitted tone chain
/// (`lightcraft_pipeline::proraw`).
V17,
/// V17, with Whites and the parametric curve from a fitted model, and the tone curves applied
/// hue-preserving: Whites, the parametric and point curve in linear ProPhoto RGB, then the red, green and
/// blue curves per channel, before the colour stage (`lightcraft_pipeline::curve_stage`,
/// `docs/curve-stage.md`).
V18,
}

impl Process {
/// Every process, oldest first (`ProcessVersion(9)` names none and renders as V8; 11 and 12 name none and
/// render as V10).
pub const ALL: [Process; 14] = [
pub const ALL: [Process; 15] = [
Process::V1,
Process::V2,
Process::V3,
Expand All @@ -147,8 +152,9 @@ impl Process {
Process::V15,
Process::V16,
Process::V17,
Process::V18,
];
pub const LATEST: Process = Process::V17;
pub const LATEST: Process = Process::V18;

pub const fn version(self) -> ProcessVersion {
match self {
Expand All @@ -166,6 +172,7 @@ impl Process {
Process::V15 => ProcessVersion(15),
Process::V16 => ProcessVersion(16),
Process::V17 => ProcessVersion(17),
Process::V18 => ProcessVersion(18),
}
}
}
Expand Down
49 changes: 35 additions & 14 deletions crates/gpu/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ const FIELDS: &[(&str, usize)] = &[
("SRGB_OFF", 1),
("CURVE_OFF", 1),
("CURVES", 1),
("STAGE", 1),
("STAGE_OFF", 1),
("STAGE_REFINE", 1),
("MSTAGE", 1),
("MSTAGE_OFF", 1),
("STAGE_WHITES", 1),
("GAIN", 1),
("EV", 1),
("AIR", 1),
Expand Down Expand Up @@ -296,21 +302,30 @@ pub fn finish_block(fp: &FinishParams, masks: &[[f32; MASK_TERMS]], present: &Pr
let srgb_off = aux.len();
aux.extend_from_slice(&srgb_lut()[..]);
let curve_off = aux.len();
if let Some(c) = &fp.curves {
for l in c {
if l.v.len() != CURVE_N as usize {
// a wrong-length curve would shift every later aux offset (CURVE_OFF, MASK_OFF and
// the mask terms that follow) and make the kernel read the wrong data. `fail()`
// records the failure on this thread so the render falls back to the CPU; the
// partial `(p, aux)` returned here is never bound to a pipeline.
fail(FailKind::Fatal, format!("curve table has {} entries, expected {}", l.v.len(), CURVE_N));
// `p` is only assembled below the curve loop, so an empty block is as good as any:
// the caller (render.rs) gates on `failed()` right after this returns and bails to
// the CPU fallback before indexing `p` or uploading `aux`.
return (Vec::new(), aux);
}
aux.extend_from_slice(&l.v);
let stage_off = curve_off + fp.curves.as_ref().map_or(0, |c| c.len() * CURVE_N as usize);
// process V18's stage (red, green, blue, then the base table) or the earlier processes' curves
// (and Whites alone after the base table, when Refine Saturation needs it)
let tables = fp.curves.iter().flatten().chain(fp.curve_stage.iter().flat_map(|c| c.chan.iter().chain([&c.base]).chain(c.whites.iter())));
for l in tables {
if l.v.len() != CURVE_N as usize {
// a wrong-length curve would shift every later aux offset (CURVE_OFF, MASK_OFF and
// the mask terms that follow) and make the kernel read the wrong data. `fail()`
// records the failure on this thread so the render falls back to the CPU; the
// partial `(p, aux)` returned here is never bound to a pipeline.
fail(FailKind::Fatal, format!("curve table has {} entries, expected {}", l.v.len(), CURVE_N));
// `p` is only assembled below the curve loop, so an empty block is as good as any:
// the caller (render.rs) gates on `failed()` right after this returns and bails to
// the CPU fallback before indexing `p` or uploading `aux`.
return (Vec::new(), aux);
}
aux.extend_from_slice(&l.v);
}
// process V18's mixer stage: its 9 chroma and 3 lightness keys, then its table
let mstage_off = aux.len();
if let Some(cs) = &fp.mixer_stage {
aux.extend(cs.chroma.iter().flatten());
aux.extend_from_slice(&cs.light);
aux.extend_from_slice(&cs.table[..]);
}
let mask_off = aux.len();
for m in masks {
Expand Down Expand Up @@ -358,6 +373,12 @@ pub fn finish_block(fp: &FinishParams, masks: &[[f32; MASK_TERMS]], present: &Pr
p.u("SRGB_OFF", srgb_off as u32);
p.u("CURVE_OFF", curve_off as u32);
p.b("CURVES", fp.curves.is_some());
p.b("STAGE", fp.curve_stage.is_some());
p.u("STAGE_OFF", stage_off as u32);
p.f("STAGE_REFINE", fp.curve_stage.as_ref().map_or(1.0, |c| c.refine));
p.b("MSTAGE", fp.mixer_stage.is_some());
p.u("MSTAGE_OFF", mstage_off as u32);
p.b("STAGE_WHITES", fp.curve_stage.as_ref().is_some_and(|c| c.whites.is_some()));
p.f("REFINE_SAT", fp.refine_sat);
p.f("GAIN", fp.gain);
p.f("EV", fp.ev);
Expand Down
151 changes: 151 additions & 0 deletions crates/gpu/src/wgsl/finish.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,149 @@ fn light_ops(d: vec3<f32>) -> vec3<f32> {
return mul3(PRO_TO_2020, p);
}

// `mixer_stage::level`: the lower and upper of three keys around `x` and the upper's weight, clamped.
struct CLevel {
a: u32,
b: u32,
f: f32,
}

fn mstage_level(k: vec3<f32>, x: f32) -> CLevel {
if (x <= k.x) {
return CLevel(0u, 0u, 0.0);
}
if (x <= k.y) {
return CLevel(0u, 1u, (x - k.x) / (k.y - k.x));
}
if (x <= k.z) {
return CLevel(1u, 2u, (x - k.y) / (k.z - k.y));
}
return CLevel(2u, 2u, 0.0);
}

// `MixerStage::look`, with the level keys at `keys` (9 chroma by lightness level, then 3 lightness) and the table
// after them: (hue shift, chroma factor, lightness change).
fn mstage_look(keys: u32, l: f32, c: f32, h: f32) -> vec3<f32> {
let t = keys + 12u;
let hd = ((h * 57.29577951308232) % 360.0 + 360.0) % 360.0 / 5.0;
let i0 = u32(hd) % 72u;
let i1 = (i0 + 1u) % 72u;
let fh = hd - floor(hd);
let lb = mstage_level(vec3<f32>(aux[keys + 9u], aux[keys + 10u], aux[keys + 11u]), l);
var r = array<vec3<f32>, 2>(vec3<f32>(0.0), vec3<f32>(0.0));
for (var j = 0u; j < 2u; j++) {
let m = select(lb.a, lb.b, j == 1u);
let ck = vec3<f32>(aux[keys + 3u * m], aux[keys + 3u * m + 1u], aux[keys + 3u * m + 2u]);
let cb = mstage_level(ck, c);
var v = vec3<f32>(0.0);
for (var o = 0u; o < 3u; o++) {
let r0 = t + ((m * 3u + cb.a) * 3u + o) * 72u;
let r1 = t + ((m * 3u + cb.b) * 3u + o) * 72u;
let a = aux[r0 + i0] * (1.0 - fh) + aux[r0 + i1] * fh;
let b = aux[r1 + i0] * (1.0 - fh) + aux[r1 + i1] * fh;
v[o] = a * (1.0 - cb.f) + b * cb.f;
}
if (c < ck.x) {
v.z *= max(c / ck.x, 0.0);
}
r[j] = v;
}
return r[0] * (1.0 - lb.f) + r[1] * lb.f;
}

// `MixerStage::apply`: the colour mixer, through OkLCh.
fn mixer_stage(d: vec3<f32>) -> vec3<f32> {
let lab = oklab(d);
let l = lab.x;
let c = sqrt(lab.y * lab.y + lab.z * lab.z);
// atan2(0, 0) is undefined in WGSL; the CPU's gives 0
let h = select(atan2(lab.z, lab.y), 0.0, c == 0.0);
let r = mstage_look(pu(F_MSTAGE_OFF), l, c, h);
let h2 = h + r.x;
let c2 = c * r.y;
return oklab_inv(vec3<f32>(max(l + r.z, 0.0), c2 * cos(h2), c2 * sin(h2)));
}

// A table of process V18's curve stage (`Lut1::eval`) at offset `o` in `aux`.
fn stage_lut(o: u32, x: f32) -> f32 {
let f = clamp(x, 0.0, 1.0) * f32(CURVE_N - 1u);
let i = min(u32(f), CURVE_N - 2u);
let t = f - f32(i);
return aux[o + i] + (aux[o + i + 1u] - aux[o + i]) * t;
}

// `CurveStage::apply`: the base table on the largest and smallest channel of sRGB-encoded linear ProPhoto, the
// middle one keeping its place between them in linear light, then the red, green and blue curves per channel.
// `curve_stage::hue_preserving`: the table at `o` on the largest and smallest channel of `e`, the middle one keeping
// its place between them in linear light (`pc`). Linear, in [0, 1].
fn stage_hue_preserving(o: u32, e: vec3<f32>, pc: vec3<f32>, hi: u32, lo: u32) -> vec3<f32> {
let la = srgb_linear(stage_lut(o, e[hi]));
let lb = srgb_linear(stage_lut(o, e[lo]));
let pa = pc[hi];
let pb = pc[lo];
var out = vec3<f32>(0.0);
for (var k = 0u; k < 3u; k++) {
var t = 1.0;
if (pa > pb) {
t = (pc[k] - pb) / (pa - pb);
}
out[k] = clamp(lb + (la - lb) * t, 0.0, 1.0);
}
return out;
}

fn curve_stage(d: vec3<f32>) -> vec3<f32> {
let p = mul3(PRO_FROM_2020, d);
var pc = clamp(p, vec3<f32>(0.0), vec3<f32>(1.0));
var e = vec3<f32>(srgb_exact(pc.x), srgb_exact(pc.y), srgb_exact(pc.z));
var hi = 0u;
var lo = 0u;
for (var k = 1u; k < 3u; k++) {
if (e[k] > e[hi]) {
hi = k;
}
if (e[k] < e[lo]) {
lo = k;
}
}
let off = pu(F_STAGE_OFF);
let base = stage_hue_preserving(off + 3u * CURVE_N, e, pc, hi, lo);
var curved = vec3<f32>(0.0);
for (var k = 0u; k < 3u; k++) {
curved[k] = stage_lut(off + k * CURVE_N, srgb_exact(base[k]));
}
var q = vec3<f32>(0.0);
for (var k = 0u; k < 3u; k++) {
q[k] = srgb_linear(clamp(curved[k], 0.0, 1.0));
}
let rs = pf(F_STAGE_REFINE);
if (rs < 1.0) {
// the saturation back towards the input's after Whites, at the curves' luminance
var reference = e;
if (pu(F_STAGE_WHITES) != 0u) {
let w = stage_hue_preserving(off + 4u * CURVE_N, e, pc, hi, lo);
reference = vec3<f32>(srgb_exact(w.x), srgb_exact(w.y), srgb_exact(w.z));
}
let rr = refine_saturation(reference, curved, rs);
var r = vec3<f32>(0.0);
for (var k = 0u; k < 3u; k++) {
r[k] = srgb_linear(clamp(rr[k], 0.0, 1.0));
}
let yq = dot(q, PRO_Y);
let yr = dot(r, PRO_Y);
q = r;
if (yr > 1e-6) {
q = r * (yq / yr);
}
}
for (var k = 0u; k < 3u; k++) {
if (p[k] > 1.0) {
q[k] += p[k] - 1.0;
}
}
return mul3(PRO_TO_2020, q);
}

// `proraw::tone_rgb`: the table at `o` on linear ProPhoto `p`, hue-preserving (the largest and
// smallest channel go through it, the middle one keeps its relative position between them).
fn tone_rgb_at(o: u32, p: vec3<f32>) -> vec3<f32> {
Expand Down Expand Up @@ -811,6 +954,14 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
d = light_ops(d);
}

// --- process V18: the colour mixer, then Whites and the tone curves
if (pu(F_MSTAGE) != 0u) {
d = mixer_stage(d);
}
if (pu(F_STAGE) != 0u) {
d = curve_stage(d);
}

// --- colour
d = color_ops(d, lt[11], lt[12]);
if (tint_on) {
Expand Down
77 changes: 76 additions & 1 deletion crates/gpu/tests/it/equivalence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ fn curve_input_matches_the_gpu_prefix_and_keeps_later_operations_out() {
let v = 0.01 + x as f32 / 500.0;
[v, v * (0.25 + y as f32 / 100.0), v * 0.4]
}));
let mut s = DevelopSettings::default();
// up to V17 the curves act on the encoded output, so a curve's input is the output of its predecessors; V18 samples
// where its curve stage reads (`lightcraft_pipeline` `v18_samples_where_the_curve_stage_reads_not_after_the_colour_tools`)
let mut s = DevelopSettings { process: Process::V17.version(), ..DevelopSettings::default() };
s.light.exposure = 0.5;
s.curve.shadows = 45.0;
s.curve.master = vec![Point::new(0.0, 0.04), Point::new(0.25, 0.65), Point::new(1.0, 0.95)];
Expand Down Expand Up @@ -988,6 +990,79 @@ fn light_v3_operators_match() {
}
}

/// Process V18's curve stage: Whites, the parametric curve, the point curves and Refine Saturation, on a camera curve
/// and without one, in SDR and HDR.
#[test]
fn curve_stage_matches() {
if !gpu() {
return;
}
use lightcraft_geom::Point;
let src = scene(0, 960, 640);
let curve = lightcraft_pipeline::tone::CameraTone::new(std::array::from_fn(|i| {
let x = 0.004 * 1.18f32.powi(i as i32);
[x, 1.0 - (-2.0 * x).exp()]
}))
.unwrap();
let raw = SourceInfo { raw: true, camera_tone: Some(curve), ..Default::default() };
let req = RenderRequest::fit(720, 720);
let v18 = || DevelopSettings { process: Process::V18.version(), ..Default::default() };
for v in [-100.0, -30.0, 40.0, 100.0] {
let mut s = v18();
s.light.whites = v;
check(&format!("V18 Whites {v}"), &src, &raw, &s, &req);
}
let mut s = v18();
s.curve.highlights = -40.0;
s.curve.lights = 25.0;
s.curve.darks = -15.0;
s.curve.shadows = 30.0;
check("V18 parametric", &src, &raw, &s, &req);
s.curve.master = vec![Point { x: 0.0, y: 0.05 }, Point { x: 0.5, y: 0.55 }, Point { x: 1.0, y: 0.95 }];
s.curve.red = vec![Point { x: 0.0, y: 0.0 }, Point { x: 0.4, y: 0.5 }, Point { x: 1.0, y: 1.0 }];
s.curve.blue = vec![Point { x: 0.0, y: 0.1 }, Point { x: 1.0, y: 0.9 }];
s.light.whites = -25.0;
check("V18 curves", &src, &raw, &s, &req);
s.curve.refine_saturation = 30.0;
check("V18 Refine Saturation", &src, &raw, &s, &req);
check("V18 curves, no camera curve", &src, &SourceInfo::default(), &s, &req);
s.curve.split_mid = 40.0;
check("V18 other splits", &src, &raw, &s, &req);
s.curve.split_mid = 50.0;
s.hdr.enabled = true;
s.hdr.max_ev = 2.0;
check("V18 HDR preview", &src, &raw, &s, &req);
}

/// Process V18's mixer stage matches the CPU's, alone, with Calibration (still V7's operator), with the curve
/// stage after it, and with V7's colour tools (Saturation, B&W) that still follow.
#[test]
fn mixer_stage_matches() {
if !gpu() {
return;
}
let src = scene(0, 960, 640);
let raw = SourceInfo { raw: true, ..Default::default() };
let req = RenderRequest::fit(720, 720);
let v18 = || DevelopSettings { process: Process::V18.version(), ..Default::default() };
let mut s = v18();
s.mixer.orange.sat = -60.0;
s.mixer.blue.hue = -40.0;
s.mixer.green.lum = 70.0;
s.mixer.magenta.hue = 15.0;
check("V18 mixer", &src, &raw, &s, &req);
s.calibration.red_hue = 45.0;
s.calibration.blue_sat = 60.0;
s.calibration.shadows_tint = 30.0;
check("V18 mixer and calibration", &src, &raw, &s, &req);
s.curve.master = vec![Point { x: 0.0, y: 0.05 }, Point { x: 0.5, y: 0.6 }, Point { x: 1.0, y: 0.95 }];
s.color.saturation = 20.0;
check("V18 colour stage, curves, Saturation", &src, &raw, &s, &req);
check("V18 colour stage, not raw", &src, &SourceInfo::default(), &s, &req);
s.treatment = lightcraft_develop::Treatment::Bw;
check("V18 colour stage, B&W", &src, &raw, &s, &req);
}

/// Issue #632: the Highlights / Shadows base of each process (V1: the edge-aware filter of log
/// luminance; V2 to V7: of its fine median, V8 on: of its detail-free plane, a radius that grows with the render) matches the CPU's, and
/// a warm cache never hands one process the other's base.
Expand Down
16 changes: 16 additions & 0 deletions crates/pipeline/src/colorops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ impl ColorOps {
if let Some((wheels, _, _)) = ops.grading.as_mut() {
wheels[3] = global_wheel(wheels[3], s.process.process());
}
// from process V18 the colour stage applies the mixer (`crate::mixer_stage`)
ops.mixer &= s.process.process() < Process::V18;
ColorOps(ops)
}
}
Expand Down Expand Up @@ -76,4 +78,18 @@ mod tests {
assert_eq!((v13.0.signum(), v13.1.signum(), v13.2), (v10.0.signum(), v10.1.signum(), v10.2), "same hue, same luminance");
assert_eq!(tint(Process::V10, false), tint(Process::V13, false), "the shadows wheel is unchanged");
}

#[test]
fn v18_leaves_the_mixer_to_the_mixer_stage() {
// from V18 `crate::mixer_stage` applies the mixer, so `ColorOps` must not apply it again
let mut s = DevelopSettings { process: Process::V7.version(), ..DevelopSettings::default() };
s.mixer.blue.sat = -100.0;
assert!(ColorOps::new(&s).mixer);
// V17 still applies the earlier mixer, and has no mixer stage
s.process = Process::V17.version();
assert!(ColorOps::new(&s).mixer);
assert!(crate::mixer_stage::MixerStage::new(&s).is_none());
s.process = Process::V18.version();
assert!(!ColorOps::new(&s).mixer);
}
}
Loading