5a24289898fd
tests_light.rs
//! Process V4's calibrated Contrast and Blacks (`light_v3`): V1 and V2 render as they
//! always did, and the V4 operators behave.
use lightcraft_color::transfer::{linear_to_srgb, srgb_to_linear};
use lightcraft_develop::{DevelopSettings, Process, ProcessVersion, controls};
use lightcraft_raster::{Rgb32f, Rgba8};
use crate::light_v3::{self, FITS, LUT_N, LightOps, Mode, Operator, Reference};
use crate::light_v3_params as fitted;
use crate::{DeepSamples, OutputDepth, PixelWindow, RenderRequest, SourceInfo, StageCache, render, render_cached};
fn camera_curve() -> crate::tone::CameraTone {
let knots = std::array::from_fn(|i| {
let x = 0.004 * 1.18f32.powi(i as i32);
[x, 1.0 - (-2.0 * x).exp()]
});
crate::tone::CameraTone::new(knots).unwrap().with_chroma([1.3, 1.2, 1.1, 1.0, 0.9, 0.7, 0.5, 0.4]).unwrap()
}
/// A raw with a camera look: the path V4 changes.
fn camera_look() -> SourceInfo {
SourceInfo { raw: true, as_shot_temp: 5200.0, as_shot_tint: 4.0, camera_tone: Some(camera_curve()), ..Default::default() }
}
fn check_luminance_cutoff(chroma: f32, pixel: [f32; 3], expected: [u8; 4]) {
// Nonnegative source pixels become mixed-sign ProPhoto values after camera chroma
// scaling. Contrast must not move their nearly cancelling luminance across 1e-6.
let curve = crate::tone::CameraTone::new(std::array::from_fn(|i| {
let x = (i + 1) as f32 / 33.0;
[x, x]
}))
.unwrap()
.with_chroma([chroma; 8])
.unwrap();
let info = SourceInfo { raw: true, camera_tone: Some(curve), ..Default::default() };
let src = Rgb32f::filled(64, 64, pixel);
let mut s = DevelopSettings { process: Process::V4.version(), ..Default::default() };
s.light.contrast = 100.0;
s.light.blacks = 80.0;
let image = render(&src, &info, &s, &RenderRequest::fit(64, 64)).image;
// (8-bit output is dithered: a flat source varies by a level)
assert!(image.data.iter().all(|p| p.iter().zip(image.data[0]).all(|(a, b)| a.abs_diff(b) <= 1)));
for (actual, expected) in image.data[0].into_iter().zip(expected) {
assert!(actual.abs_diff(expected) <= 1, "chroma {chroma}: {:?}, expected {expected}", image.data[0]);
}
}
#[test]
fn v3_luminance_cutoff_chroma_2() {
check_luminance_cutoff(2.0, [0.023_433_316, 0.000_071_107_73, 0.005_175_675], [27, 0, 8, 255]);
}
#[test]
fn v3_luminance_cutoff_chroma_4() {
check_luminance_cutoff(4.0, [0.035_338_085, 0.000_048_468_723, 0.010_193_758], [47, 0, 19, 255]);
}
fn scenes() -> Vec<Rgb32f> {
let lib = lightcraft_scenes::demo_library();
vec![lib[0].render(480, 320), lib[3].render(400, 300)]
}
/// FNV-1a over the bytes of a render: its 8-bit image and its deep samples.
fn fnv(hash: &mut u64, bytes: impl IntoIterator<Item = u8>) {
for b in bytes {
*hash = (*hash ^ b as u64).wrapping_mul(0x0000_0100_0000_01B3);
}
}
fn render_hash(src: &Rgb32f, info: &SourceInfo, s: &DevelopSettings, req: &RenderRequest) -> u64 {
let r = render(src, info, s, req);
let mut h = 0xCBF2_9CE4_8422_2325u64;
fnv(&mut h, r.image.data.iter().flatten().copied());
match r.deep.map(|d| d.samples) {
Some(DeepSamples::U16(v)) => fnv(&mut h, v.iter().flat_map(|x| x.to_le_bytes())),
Some(DeepSamples::F32(v)) => fnv(&mut h, v.iter().flat_map(|x| x.to_bits().to_le_bytes())),
None => {}
}
h
}
/// The settings the V1 / V2 golden renders cover: plain, a typical edit, and Contrast, Whites and
/// Blacks at both ends on their own.
fn golden_settings() -> Vec<DevelopSettings> {
let mut out = vec![DevelopSettings::for_raw(5200.0, 4.0)];
let mut edited = DevelopSettings::for_raw(5200.0, 4.0);
for (id, v) in [("light.exposure", 0.4), ("light.contrast", 30.0), ("light.highlights", -60.0), ("light.whites", 15.0), ("light.blacks", -20.0)] {
controls::set(&mut edited, id, v);
}
out.push(edited);
for id in ["light.contrast", "light.whites", "light.blacks"] {
for v in [-100.0, 100.0] {
let mut s = DevelopSettings::for_raw(5200.0, 4.0);
controls::set(&mut s, id, v);
out.push(s);
}
}
let mut hdr = DevelopSettings::for_raw(5200.0, 4.0);
hdr.hdr.enabled = true;
hdr.hdr.max_ev = 2.0;
for (id, v) in [("light.contrast", 25.0), ("light.whites", 40.0), ("light.blacks", -30.0)] {
controls::set(&mut hdr, id, v);
}
out.push(hdr);
out
}
/// One hash over every golden render of `process`: two scenes, three sources (rendered, raw,
/// raw with a camera look), the settings above, at 8 and 16 bits and as float HDR.
fn golden(process: ProcessVersion) -> u64 {
let infos = [SourceInfo::default(), SourceInfo { raw: true, as_shot_temp: 5200.0, as_shot_tint: 4.0, ..Default::default() }, camera_look()];
let reqs = [
// (at 480 px V2's Highlights / Shadows base takes its median: V1 and V2 differ)
RenderRequest::fit(480, 480),
RenderRequest { depth: OutputDepth::U16, ..RenderRequest::fit(320, 320) },
RenderRequest { depth: OutputDepth::F32Hdr, ..RenderRequest::fit(240, 240) },
];
let mut h = 0xCBF2_9CE4_8422_2325u64;
for src in scenes() {
for info in &infos {
for s in golden_settings() {
let s = DevelopSettings { process, ..s };
for req in &reqs {
fnv(&mut h, render_hash(&src, info, &s, req).to_le_bytes());
}
}
}
}
h
}
/// V1 and V2 render byte for byte as they do on main after #3509's intentional 8-bit dithering.
/// The hashes were captured on unchanged main at a220d3eb on macOS aarch64, where they are checked: the renders
/// call the platform's `powf` / `exp2` / `log2`, whose last bit can differ on other platforms, so
/// elsewhere the test only prints them. Before updating them during a rebase, run this exact fixture
/// on main and confirm that both hashes match. Restoring only the pre-#3509 quantizer on that
/// baseline reproduces the original e2d18b5fb goldens (0x5bf0a7c8579f3f34, 0x87a3598c15979e4d)
/// exactly: only the intended final quantization change requires this baseline update.
#[test]
fn v1_and_v2_render_as_before_v3() {
let got = [golden(ProcessVersion(1)), golden(ProcessVersion(2))];
eprintln!("golden V1 {:#018x}, V2 {:#018x}", got[0], got[1]);
if cfg!(all(target_os = "macos", target_arch = "aarch64")) {
assert_eq!(got, GOLDEN, "V1 / V2 renders changed");
}
}
const GOLDEN: [u64; 2] = [0x4830_59a3_ad92_326c, 0x9653_aed0_ea32_aff3];
fn on(process: Process, s: &DevelopSettings) -> DevelopSettings {
DevelopSettings { process: process.version(), ..s.clone() }
}
/// Every slider and amount the operator checks sweep: Contrast and Blacks with
/// their fits and references.
fn fits() -> [(&'static str, &'static light_v3::Fit, &'static [Reference]); 2] {
[("contrast", &fitted::CONTRAST, fitted::CONTRAST_REFERENCE), ("blacks", &fitted::BLACKS, fitted::BLACKS_REFERENCE)]
}
#[test]
fn the_shipped_fits_unpack_as_the_family_lays_them_out() {
assert!(std::ptr::eq(FITS[0], &fitted::CONTRAST) && std::ptr::eq(FITS[1], &fitted::BLACKS));
for (name, fit, _) in fits() {
let u = fit.unpack().unwrap_or_else(|| panic!("{name} doesn't unpack"));
// D(1) = 0, and Contrast's shapes are anchored at black too
assert_eq!((u.d_pos[11], u.d_neg[11]), (0.0, 0.0), "{name}");
assert_eq!(fit.signed, name == "contrast");
if fit.signed {
assert_eq!((u.d_pos[0], u.d_neg[0]), (0.0, 0.0));
}
assert!([u.law_pos, u.law_neg].iter().all(|(t, q)| t.is_finite() && q.is_finite() && *t > 0.0 && *q > 0.0), "{name}");
let (w0, w1) = u.weights;
assert!((0.0..=1.0).contains(&w0) && (0.0..=1.0).contains(&w1), "{name}");
}
assert_eq!(fitted::CONTRAST.mode, Mode::PerChannel);
assert_eq!(fitted::BLACKS.mode, Mode::Mix);
// a parameter vector that doesn't fit the layout is refused, not read past its end
let short = light_v3::Fit { params: &fitted::CONTRAST.params[..20], ..fitted::CONTRAST };
assert!(short.unpack().is_none());
assert!(Operator::new(&short, 50.0).is_none());
}
#[test]
fn exact_mix_endpoints_select_only_the_contributing_mode() {
assert_eq!(Operator::new(&fitted::BLACKS, -30.0).unwrap().mode, Mode::PerChannel);
assert_eq!(Operator::new(&fitted::BLACKS, 30.0).unwrap().mode, Mode::Mix);
// Synthetic logits also exercise a weight that rounds to exactly zero.
let mut params = fitted::BLACKS.params.to_vec();
*params.last_mut().unwrap() = -1000.0;
let fit = light_v3::Fit { params: Box::leak(params.into_boxed_slice()), ..fitted::BLACKS };
assert_eq!(Operator::new(&fit, -30.0).unwrap().mode, Mode::Luminance);
}
#[test]
fn preview_tables_match_exact_operators_over_combined_amounts() {
let info = camera_look();
let encode = |v| crate::finish::encode_srgb(crate::finish::srgb_lut(), v);
let mut worst = 0.0f32;
for contrast in [-100.0, -60.0, -30.0, 0.0, 30.0, 60.0, 100.0] {
for blacks in [-100.0, -60.0, -30.0, 0.0, 30.0, 60.0, 100.0] {
let mut s = DevelopSettings::default();
s.light.contrast = contrast;
s.light.blacks = blacks;
let Some(exact) = LightOps::new(&s, &info) else { continue };
let preview = light_v3::PreviewOps::new(&exact, &encode);
assert_eq!(preview.is_some(), blacks <= 0.0);
for i in 0..=8192 {
let v = i as f32 / 8192.0;
for p in [[v; 3], [v, v * 0.1, v * 0.02], [v * 0.04, v, v * 0.2], [v * 0.1, v * 0.03, v], [v * 3.0, -v * 0.2, v]] {
let a = exact.apply(p, &linear_to_srgb);
let b = preview.as_ref().map_or_else(|| exact.apply(p, &encode), |preview| preview.apply(p));
for (a, b) in a.into_iter().zip(b) {
let error = (linear_to_srgb(a.clamp(0.0, 1.0)) - linear_to_srgb(b.clamp(0.0, 1.0))).abs() * 255.0;
worst = worst.max(error);
assert!(error <= 1.0, "Contrast {contrast}, Blacks {blacks}, input {p:?}: {error} levels");
}
}
}
}
}
eprintln!("Preview table maximum encoded error {worst:.6} of an 8-bit level");
}
/// The port against the family's own Python (`tools/light_v3_family.py`, through the generated
/// references): `Family.curve` to the references' 12 digits, and `Family.apply` on pixels to the
/// tables' interpolation.
#[test]
fn the_operators_are_fit_pointwise_family() {
for (name, fit, refs) in fits() {
let u = fit.unpack().unwrap();
assert!(!refs.is_empty());
let mut worst = 0.0f64;
for r in refs {
for (v, want) in fitted::REF_V.iter().zip(r.curve) {
let got = u.curve(r.amount, *v);
// (the references are written at 12 significant digits)
assert!((got - want).abs() < 1e-11, "{name} {} at {v}: {got} vs {want}", r.amount);
}
let Some(apply) = r.apply else { continue };
let op = Operator::new(fit, r.amount).unwrap();
for (px, want) in fitted::REF_PIX.iter().zip(apply) {
let lin = px.map(|v| srgb_to_linear(v as f32));
let got = op.apply(lin, &linear_to_srgb).map(linear_to_srgb);
for k in 0..3 {
worst = worst.max((got[k] as f64 - want[k]).abs());
}
}
}
eprintln!("{name}: worst |apply - Family.apply| {worst:.2e} (encoded)");
assert!(worst < 1e-3, "{name}: {worst}");
}
}
/// Each operator is non-decreasing at every integer amount and maps white to white.
#[test]
fn every_operator_is_monotone_and_keeps_white() {
for (name, fit, _) in fits() {
for a in (-100..=100).filter(|a| *a != 0) {
let op = Operator::new(fit, a as f64).unwrap();
assert!(op.lut[0] >= 0.0, "{name} {a}: F(0) = {}", op.lut[0]);
assert!((op.lut[LUT_N - 1] - 1.0).abs() < 1e-6, "{name} {a}: F(1) = {}", op.lut[LUT_N - 1]);
assert!(op.lut.windows(2).all(|w| w[1] >= w[0]), "{name} {a} decreases");
let mut prev = f32::MIN;
for i in -50..=1100 {
let x = i as f32 / 1000.0;
let y = op.channel(x, &linear_to_srgb);
assert!(y >= prev, "{name} {a} at {x}: {y} < {prev}");
prev = y;
}
}
}
}
/// The tables flatten a fold instead of letting tones swap; where the fit is increasing they are
/// the fit.
#[test]
fn a_folding_fit_is_flattened_and_others_are_untouched() {
for (name, fit, _) in fits() {
let u = fit.unpack().unwrap();
for a in [-100.0, -50.0, -10.0, 10.0, 50.0, 100.0] {
let mut fold = 0.0f64;
let mut top = 0.0f64;
for i in 0..LUT_N {
let f = u.curve(a, i as f64 / (LUT_N - 1) as f64);
top = top.max(f);
fold = fold.max(top - f);
}
eprintln!("{name} {a}: fitted curve folds back by {fold:.4}");
assert!(fold < 0.03, "{name} {a}: {fold}");
}
}
}
/// A grey ramp through the camera look: each V4 slider moves the tones its way, keeps their order
/// and keeps the ramp neutral.
#[test]
fn v3_sliders_move_a_grey_ramp_their_way() {
let ramp = Rgb32f::from_fn(256, 8, |x, _| [0.0005 * 1.035f32.powi(x as i32); 3]);
let shot = |id: &str, v: f64| {
let mut s = DevelopSettings::default();
assert!(s.process.process() >= Process::V4, "the default process has the V4 sliders");
controls::set(&mut s, id, v);
let r = render(&ramp, &camera_look(), &s, &RenderRequest::fit(256, 8)).image;
(0..256).map(|x| r.get(x, 4)).collect::<Vec<[u8; 4]>>()
};
let plain = shot("light.exposure", 0.0);
let luma = |p: [u8; 4]| p[1] as i32;
for (id, v) in [
("light.contrast", 60.0),
("light.contrast", -60.0),
("light.whites", 60.0),
("light.whites", -60.0),
("light.blacks", 60.0),
("light.blacks", -60.0),
] {
let r = shot(id, v);
// (within a level of 8-bit dither)
assert!(r.windows(2).all(|w| luma(w[1]) >= luma(w[0]) - 1), "{id} {v}: the ramp is no longer increasing");
assert!(r.iter().all(|p| p[0].abs_diff(p[1]) <= 1 && p[1].abs_diff(p[2]) <= 1), "{id} {v}: the ramp is no longer grey");
let diff = |lo: usize, hi: usize| (lo..hi).map(|x| luma(r[x]) - luma(plain[x])).sum::<i32>();
let (dark, light) = (diff(40, 90), diff(170, 220));
match (id, v > 0.0) {
("light.contrast", true) => assert!(dark < 0 && light > 0, "{id} {v}: {dark} {light}"),
("light.contrast", false) => assert!(dark > 0 && light < 0, "{id} {v}: {dark} {light}"),
("light.whites", true) => assert!(light > 0, "{id} {v}: {dark} {light}"),
("light.whites", false) => assert!(light < 0, "{id} {v}: {dark} {light}"),
(_, true) => assert!(dark > 0, "{id} {v}: {dark} {light}"),
(_, false) => assert!(dark < 0, "{id} {v}: {dark} {light}"),
}
}
}
/// V4 with Contrast, Whites and Blacks at 0 is the Neutral camera look exactly (V2's at 0),
/// whatever the other sliders; other sources render under V4 as under V2.
#[test]
fn v3_at_zero_is_the_neutral_camera_look_and_other_paths_are_v2() {
let reqs = [RenderRequest::fit(480, 480), RenderRequest { depth: OutputDepth::U16, ..RenderRequest::fit(320, 320) }];
let mut typical = DevelopSettings::for_raw(5200.0, 4.0);
for (id, v) in [("light.exposure", 0.4), ("light.highlights", -60.0), ("light.shadows", 30.0), ("effects.clarity", 20.0)] {
controls::set(&mut typical, id, v);
}
let mut hdr = typical.clone();
hdr.hdr.enabled = true;
let hdr_req = RenderRequest { depth: OutputDepth::F32Hdr, ..RenderRequest::fit(240, 240) };
for src in scenes() {
for s in [DevelopSettings::for_raw(5200.0, 4.0), typical.clone()] {
for req in &reqs {
assert_eq!(
render_hash(&src, &camera_look(), &on(Process::V4, &s), req),
render_hash(&src, &camera_look(), &on(Process::V3, &s), req)
);
}
}
assert_eq!(
render_hash(&src, &camera_look(), &on(Process::V4, &hdr), &hdr_req),
render_hash(&src, &camera_look(), &on(Process::V3, &hdr), &hdr_req)
);
let mut edited = typical.clone();
for (id, v) in [("light.contrast", 30.0), ("light.whites", 25.0), ("light.blacks", -20.0)] {
controls::set(&mut edited, id, v);
}
for info in [SourceInfo::default(), SourceInfo { raw: true, ..Default::default() }] {
for req in &reqs {
assert_eq!(render_hash(&src, &info, &on(Process::V4, &edited), req), render_hash(&src, &info, &on(Process::V3, &edited), req));
}
}
// and on the camera look the sliders do something
assert_ne!(
render_hash(&src, &camera_look(), &on(Process::V4, &edited), &reqs[0]),
render_hash(&src, &camera_look(), &on(Process::V4, &typical), &reqs[0])
);
}
let info = camera_look();
assert!(LightOps::new(&on(Process::V4, &typical), &info).is_none(), "nothing to apply at 0");
assert!(
LightOps::new(
&on(Process::V3, &DevelopSettings { light: lightcraft_develop::Light { contrast: 50.0, ..Default::default() }, ..typical.clone() }),
&info
)
.is_none()
);
}
/// Cached renders (a view's stage cache) render as uncached ones do, whole or as a window.
#[test]
fn calibrated_operators_match_in_cached_and_windowed_renders() {
let src = std::sync::Arc::new(lightcraft_scenes::demo_library()[3].render(1200, 800));
let info = camera_look();
let mut s = DevelopSettings::default();
s.light.contrast = 40.0;
s.light.blacks = -60.0;
s.light.whites = 80.0;
let cache = StageCache::default();
let req = RenderRequest::fit(1200, 1200);
for _ in 0..2 {
assert!(render_cached(&src, &info, &s, &req, &cache).image == render(&src, &info, &s, &req).image);
}
let win = PixelWindow { x: 300, y: 200, w: 400, h: 300 };
let wreq = RenderRequest { window: Some(win), ..req };
let (f, w) = (render(&src, &info, &s, &req).image, render_cached(&src, &info, &s, &wreq, &cache).image);
assert!(window_diff(&f, &w, win) <= 1, "the window is the frame's pixels");
}
/// Largest channel difference between window `win` of `full` and the window render `w`.
fn window_diff(full: &Rgba8, w: &Rgba8, win: PixelWindow) -> u8 {
let mut max = 0;
for y in 0..win.h {
for x in 0..win.w {
let (a, b) = (full.get(win.x + x, win.y + y), w.get(x, y));
for k in 0..3 {
max = max.max(a[k].abs_diff(b[k]));
}
}
}
max
}
/// HDR values follow the mode (review of 5a7016c8): per channel a component above 1 passes
/// unchanged; on luminance a pixel whose luminance is at most 1 is scaled as a whole, components
/// above 1 included, and one whose luminance is above 1 passes; Mix blends the two. Both are
/// continuous where a component or the luminance crosses 1.
#[test]
fn hdr_components_follow_the_operators_mode() {
let enc = &linear_to_srgb;
let lum = |p: [f32; 3]| light_v3::PRO_Y[0] * p[0] + light_v3::PRO_Y[1] * p[1] + light_v3::PRO_Y[2] * p[2];
for (name, fit, _) in fits() {
for a in [-100.0, -40.0, 40.0, 100.0] {
let op = Operator::new(fit, a).unwrap();
for p in [[1.2f32, 0.2, 0.05], [3.0, 1.5, 0.8], [0.4, 1.1, 0.02]] {
let pc = p.map(|c| op.channel(c, enc));
assert!(p.iter().zip(&pc).all(|(c, o)| *c <= 1.0 || o == c), "{name} {a}: per channel {p:?} -> {pc:?}");
let y = lum(p);
let l = if y > 1.0 { p } else { p.map(|c| c * op.channel(y, enc) / y) };
let want: [f32; 3] = match op.mode {
Mode::PerChannel => pc,
Mode::Luminance => l,
Mode::Mix => std::array::from_fn(|k| op.weight * pc[k] + (1.0 - op.weight) * l[k]),
};
let got = op.apply(p, enc);
assert!(got.iter().all(|v| v.is_finite()));
assert!(got.iter().zip(&want).all(|(g, w)| (g - w).abs() < 1e-6), "{name} {a} ({:?}): {p:?} -> {got:?}, want {want:?}", op.mode);
}
// continuous where a component crosses 1, and where the luminance does
let (lo, hi) = (op.apply([0.9999, 0.3, 0.1], enc), op.apply([1.0001, 0.3, 0.1], enc));
assert!(lo.iter().zip(&hi).all(|(a, b)| (a - b).abs() < 2e-3), "{name} {a}: {lo:?} | {hi:?}");
let (lo, hi) = (op.apply([0.9999; 3], enc), op.apply([1.0001; 3], enc));
assert!(lo.iter().zip(&hi).all(|(a, b)| (a - b).abs() < 2e-3), "{name} {a}: {lo:?} | {hi:?}");
}
}
}
/// Whites keeps the V2 tone curve for both signs, including HDR and render windows.
#[test]
fn whites_is_byte_identical_to_v2() {
let src = scenes().remove(0);
let info = camera_look();
let reqs = [
RenderRequest::fit(480, 480),
RenderRequest { depth: OutputDepth::U16, ..RenderRequest::fit(320, 320) },
RenderRequest { depth: OutputDepth::F32Hdr, ..RenderRequest::fit(240, 240) },
RenderRequest { window: Some(PixelWindow { x: 80, y: 60, w: 160, h: 120 }), ..RenderRequest::fit(480, 480) },
];
for amount in [-100.0, -50.0, -1.0, 0.0, 1.0, 50.0, 100.0] {
for hdr in [false, true] {
let mut s = DevelopSettings::for_raw(5200.0, 4.0);
s.light.whites = amount;
s.light.exposure = 0.35;
s.light.highlights = -30.0;
s.light.shadows = 20.0;
s.hdr.enabled = hdr;
s.hdr.max_ev = 2.0;
for req in &reqs {
assert_eq!(
render_hash(&src, &info, &on(Process::V4, &s), req),
render_hash(&src, &info, &on(Process::V3, &s), req),
"Whites {amount}, HDR {hdr}, {req:?}"
);
}
}
}
}
#[test]
fn invalid_amounts_are_skipped_and_finite_amounts_are_bounded() {
for fit in FITS {
for a in [0.0, f64::NAN, f64::INFINITY, f64::NEG_INFINITY] {
assert!(Operator::new(fit, a).is_none());
}
for (a, endpoint) in [(-101.0, -100.0), (101.0, 100.0)] {
assert_eq!(Operator::new(fit, a).unwrap().lut, Operator::new(fit, endpoint).unwrap().lut);
}
}
}
#[test]
fn section_bypass_and_local_adjustments_keep_v2_behavior() {
let src = scenes().remove(0);
let info = camera_look();
let req = RenderRequest::fit(480, 480);
let mut s = DevelopSettings::default();
s.light.contrast = 70.0;
s.light.blacks = -50.0;
s.disabled_sections.push("light".into());
assert_eq!(render_hash(&src, &info, &on(Process::V4, &s), &req), render_hash(&src, &info, &on(Process::V3, &s), &req));
s.light = Default::default();
s.disabled_sections.clear();
s.masks = vec![lightcraft_develop::Mask {
components: vec![lightcraft_develop::MaskComponent {
name: None,
op: lightcraft_develop::MaskOp::Add,
invert: false,
shape: lightcraft_develop::MaskShape::Linear { start: lightcraft_geom::Point::new(0.2, 0.0), end: lightcraft_geom::Point::new(0.8, 1.0) },
}],
adjust: lightcraft_develop::LocalAdjustments { contrast: 40.0, whites: 60.0, blacks: -30.0, ..Default::default() },
..Default::default()
}];
assert_eq!(render_hash(&src, &info, &on(Process::V4, &s), &req), render_hash(&src, &info, &on(Process::V3, &s), &req));
}
No file is open. Choose one in the tree, or press Ctrl+O (⌘O on a Mac) to find one by name.
Syntax highlighting could not load. The unmodified read-only text remains available above.