Skip to content
Open
Show file tree
Hide file tree
Changes from 38 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 @@ -124,12 +124,17 @@ pub enum Process {
/// build-up times the highest falloff of the dabs that reach a point, so overlapping dabs no
/// longer pile their soft edges up into a hard one; V1 to V15 accumulate each dab's falloff.
V16,
/// V16, 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`).
V17,
}

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; 13] = [
pub const ALL: [Process; 14] = [
Process::V1,
Process::V2,
Process::V3,
Expand All @@ -143,8 +148,9 @@ impl Process {
Process::V14,
Process::V15,
Process::V16,
Process::V17,
];
pub const LATEST: Process = Process::V16;
pub const LATEST: Process = Process::V17;

pub const fn version(self) -> ProcessVersion {
match self {
Expand All @@ -161,6 +167,7 @@ impl Process {
Process::V14 => ProcessVersion(14),
Process::V15 => ProcessVersion(15),
Process::V16 => ProcessVersion(16),
Process::V17 => ProcessVersion(17),
}
}
}
Expand Down
46 changes: 32 additions & 14 deletions crates/gpu/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ 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),
("GAIN", 1),
("EV", 1),
("AIR", 1),
Expand Down Expand Up @@ -197,21 +202,29 @@ 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 V17's stage (red, green, blue, then the base table) or the earlier processes' curves
let tables = fp.curves.iter().flatten().chain(fp.curve_stage.iter().flat_map(|c| c.chan.iter().chain([&c.base])));
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 V17'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 @@ -258,6 +271,11 @@ 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.f("REFINE_SAT", fp.refine_sat);
p.f("GAIN", fp.gain);
p.f("EV", fp.ev);
Expand Down
136 changes: 136 additions & 0 deletions crates/gpu/src/wgsl/finish.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,134 @@ 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 V17'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.
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 = off + 3u * CURVE_N;
let la = srgb_linear(stage_lut(base, e[hi]));
let lb = srgb_linear(stage_lut(base, e[lo]));
let pa = pc[hi];
let pb = pc[lo];
var curved = vec3<f32>(0.0);
for (var k = 0u; k < 3u; k++) {
var t = 1.0;
if (pa > pb) {
t = (pc[k] - pb) / (pa - pb);
}
curved[k] = stage_lut(off + k * CURVE_N, srgb_exact(clamp(lb + (la - lb) * t, 0.0, 1.0)));
}
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, at the curves' luminance
let rr = refine_saturation(e, 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);
}

fn band_weights(h: f32) -> array<f32, 8> {
var w: array<f32, 8>;
for (var i = 0u; i < 8u; i++) {
Expand Down Expand Up @@ -664,6 +792,14 @@ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
d = light_ops(d);
}

// --- process V17: 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
73 changes: 73 additions & 0 deletions crates/gpu/tests/it/equivalence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,79 @@ fn light_v3_operators_match() {
}
}

/// Process V17'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 v17 = || DevelopSettings { process: Process::V17.version(), ..Default::default() };
for v in [-100.0, -30.0, 40.0, 100.0] {
let mut s = v17();
s.light.whites = v;
check(&format!("V17 Whites {v}"), &src, &raw, &s, &req);
}
let mut s = v17();
s.curve.highlights = -40.0;
s.curve.lights = 25.0;
s.curve.darks = -15.0;
s.curve.shadows = 30.0;
check("V17 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("V17 curves", &src, &raw, &s, &req);
s.curve.refine_saturation = 30.0;
check("V17 Refine Saturation", &src, &raw, &s, &req);
check("V17 curves, no camera curve", &src, &SourceInfo::default(), &s, &req);
s.curve.split_mid = 40.0;
check("V17 other splits", &src, &raw, &s, &req);
s.curve.split_mid = 50.0;
s.hdr.enabled = true;
s.hdr.max_ev = 2.0;
check("V17 HDR preview", &src, &raw, &s, &req);
}

/// Process V17'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 v17 = || DevelopSettings { process: Process::V17.version(), ..Default::default() };
let mut s = v17();
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("V17 mixer", &src, &raw, &s, &req);
s.calibration.red_hue = 45.0;
s.calibration.blue_sat = 60.0;
s.calibration.shadows_tint = 30.0;
check("V17 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("V17 colour stage, curves, Saturation", &src, &raw, &s, &req);
check("V17 colour stage, not raw", &src, &SourceInfo::default(), &s, &req);
s.treatment = lightcraft_develop::Treatment::Bw;
check("V17 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 V17 the colour stage applies the mixer (`crate::mixer_stage`)
ops.mixer &= s.process.process() < Process::V17;
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 v17_leaves_the_mixer_to_the_mixer_stage() {
// from V17 `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);
// V16 still applies the earlier mixer, and has no mixer stage
s.process = Process::V16.version();
assert!(ColorOps::new(&s).mixer);
assert!(crate::mixer_stage::MixerStage::new(&s).is_none());
s.process = Process::V17.version();
assert!(!ColorOps::new(&s).mixer);
}
}
3 changes: 3 additions & 0 deletions crates/pipeline/src/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use lightcraft_develop::ToneCurve;
pub use craft_develop::curve::{PARAM_AMOUNTS, PARAM_LUT};

/// The parametric (region) curve of a [`ToneCurve`], backed by `craft_develop::curve::ParametricCurve`.
///
/// Processes V1 to V16 render it, and V17 renders it when the splits are moved. The curve editor draws it
/// through [`crate::curve_stage::ParametricGraph`], which picks the measured regions where V17 renders those.
#[derive(Clone, Debug)]
pub struct ParametricCurve(craft_develop::curve::ParametricCurve);

Expand Down
7 changes: 5 additions & 2 deletions crates/pipeline/src/curve_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! The normal renderer is unchanged. A small, separate render shares its spatial stages and
//! per-pixel code, stopping before the selected curve and everything that follows it.

use lightcraft_develop::{DevelopSettings, ToneCurve};
use lightcraft_develop::{DevelopSettings, Process, ToneCurve};
use lightcraft_raster::{Histogram, Rgb32f, Rgba8};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
Expand Down Expand Up @@ -107,7 +107,10 @@ pub(crate) fn finish(
if let Some(display) = &request.display {
fp.for_display(display, request.proof);
}
fp.curves = crate::finish::curve_luts(&input.predecessors(&settings.curve));
// only the predecessors, wherever the process applies its curves (encoded output, or V17's curve stage)
let predecessors = DevelopSettings { curve: input.predecessors(&settings.curve), ..settings.clone() };
fp.curves = if settings.process.process() < Process::V17 { crate::finish::curve_luts(&predecessors.curve) } else { None };
fp.curve_stage = crate::curve_stage::CurveStage::new(&predecessors);
fp.refine_sat = 1.0;
// the samples, and the 8-bit pixels as `finish` dithers them at the same place in the output
let samples = crate::finish::finish_with(p, &fp, false, true, |x, y, e| {
Expand Down
Loading