diff --git a/crates/catalog/src/journal.rs b/crates/catalog/src/journal.rs index 2600d794a45..ddcfde7eddd 100644 --- a/crates/catalog/src/journal.rs +++ b/crates/catalog/src/journal.rs @@ -52,6 +52,7 @@ //! | 7 | Kelvin white balance for raws whose camera has matrices (#730) | `Op::SetAsShotWb`, `WhiteBalance.scale` | //! | 8 | History cursor: Go to History Step adds no step | `Op::SetHistoryCursor`, `Photo.history_cursor` | //! | 9 | preview-only recheck | `Photo.preview_checked`, `Op::SetContent.preview_checked` | +//! | 10 | masks stay on the photo under lens corrections, Upright and Transform | `Mask.on_photo` (develop settings) | //! //! Rules: //! - **Bump [`VERSION`]** (and add a row above) in the change that adds an [`Op`] variant or a @@ -76,7 +77,7 @@ pub const LOG: &str = "catalog.log"; const FORMAT: &str = "lightcraft-catalog"; /// The catalog format this build writes (and the newest it reads). See the module docs → /// *Format versions*; bump it whenever an [`Op`] variant or a serialized field is added. -pub const VERSION: u32 = 9; +pub const VERSION: u32 = 10; /// When [`Journal::wants_snapshot`] says it's time to compact the log. #[derive(Clone, Copy, Debug)] diff --git a/crates/catalog/src/tests_format_version.rs b/crates/catalog/src/tests_format_version.rs index e31d7fe0c49..87ced1b8718 100644 --- a/crates/catalog/src/tests_format_version.rs +++ b/crates/catalog/src/tests_format_version.rs @@ -238,8 +238,8 @@ fn op_variants_are_versioned() { Op::SetHistoryCursor { .. } => 8, } } - /// v9: `Photo.preview_checked` and `Op::SetContent.preview_checked`. - const NEWEST_FIELDS: u32 = 9; + /// v10: `Mask.on_photo` (v9: `Photo.preview_checked` and `Op::SetContent.preview_checked`). + const NEWEST_FIELDS: u32 = 10; let newest = since(&Op::SetHistoryCursor { id: PhotoId(1), cursor: None }); assert_eq!(newest.max(NEWEST_FIELDS), VERSION, "the newest op's or fields' version must be the current format version"); } diff --git a/crates/develop/src/settings.rs b/crates/develop/src/settings.rs index 739171abd93..2c880bc69ec 100644 --- a/crates/develop/src/settings.rs +++ b/crates/develop/src/settings.rs @@ -1054,15 +1054,35 @@ pub struct Mask { /// Refine Edges 0..100: the mask's edges snap to the photo's (guided filter). #[serde(skip_serializing_if = "is_zero")] pub refine: f64, + /// Where its coordinates (gradients, brush strokes, AI selections) live: `true`, on the photo as + /// shot (user orientation, before lens corrections, Upright and Transform), so the mask stays + /// on the same content whatever those do; `false`, a mask from before that, on the corrected + /// frame. Read as `false` when absent; [`Mask::default`] (every new mask) is `true`, and an + /// edit converts an old one (`lightcraft_pipeline::mask_space::attach`). + #[serde(default, skip_serializing_if = "is_false")] + pub on_photo: bool, } fn is_zero(v: &f64) -> bool { *v == 0.0 } +fn is_false(v: &bool) -> bool { + !*v +} + impl Default for Mask { fn default() -> Self { - Self { id: 0, name: "Mask 1".into(), visible: true, invert: false, components: Vec::new(), adjust: LocalAdjustments::default(), refine: 0.0 } + Self { + id: 0, + name: "Mask 1".into(), + visible: true, + invert: false, + components: Vec::new(), + adjust: LocalAdjustments::default(), + refine: 0.0, + on_photo: true, + } } } diff --git a/crates/engine/src/cmd/library/selection.rs b/crates/engine/src/cmd/library/selection.rs index 964b2a8c857..40130adb9d4 100644 --- a/crates/engine/src/cmd/library/selection.rs +++ b/crates/engine/src/cmd/library/selection.rs @@ -182,12 +182,17 @@ pub(super) fn rotate(s: &mut Session, p: &Value, cw: bool) -> Result { let targets = s.targets(p)?; let mut ops = Vec::new(); for id in targets { - if let Some(d) = s.develop_of(id) { - let mut d = (*d).clone(); + if let Some(before) = s.develop_of(id) { + let mut d = (*before).clone(); d.orientation = d.orientation.rotated(cw); // the crop lives in the oriented frame, so it turns with the image (else it keeps the old width and height and cuts the photo) let turn = lightcraft_geom::Orientation::Normal.rotated(cw); d.crop.geometry.rect = turn.map_norm_rect(d.crop.geometry.rect); + // and so do the masks: on the photo first (an old one), then turned with it + s.attach_masks(id, &before, &mut d); + for m in &mut d.masks { + lightcraft_pipeline::mask_space::turn(m, turn); + } d.crop.aspect = d.crop.aspect.map(|(w, h)| (h, w)); ops.extend(s.develop_op(id, d, "Rotate")); } diff --git a/crates/engine/src/cmd/masks.rs b/crates/engine/src/cmd/masks.rs index 5fc083f51f8..171435e22b2 100644 --- a/crates/engine/src/cmd/masks.rs +++ b/crates/engine/src/cmd/masks.rs @@ -464,6 +464,31 @@ pub fn specs() -> Vec { let exclude = bool_or(p, "exclude", false); let id = s.active().ok_or_else(|| bad(c, "no active photo"))?; let mid = mask_id(p, s.active_mask, c)?; + // an old mask (on the corrected frame, as the click then is) goes onto the photo + // first, and the click with it: the model works on the photo before lens + // corrections, Upright and Transform, and reads every click there + let mut at = at; + if let Some(cur) = s.develop_of(id).filter(|d| d.masks.iter().any(|m| m.id == mid && !m.on_photo)) { + if let Some(f) = s.mask_frame(id, &cur) { + // a click on the corrected frame's blank space is off the photo, not on + // its edge (a hair past it, from rounding, is on the edge) + const EDGE: f64 = 1e-6; + let n = f.for_mask(true).norm_to_mask(at); + let on = |v: f64| v.is_finite() && (-EDGE..=1.0 + EDGE).contains(&v); + if !(on(n.x) && on(n.y)) { + return Err(bad(c, "the point is outside the photo")); + } + at = Point::new(n.x.clamp(0.0, 1.0), n.y.clamp(0.0, 1.0)); + } + let mut on = (*cur).clone(); + s.attach_masks(id, &cur, &mut on); + s.apply_silent(lightcraft_catalog::Op::SetDevelop { + id, + settings: std::sync::Arc::new(on), + label: "Masks".into(), + edited: None, + })?; + } let d = s.develop_of(id).unwrap_or_default(); let m = d.masks.iter().find(|m| m.id == mid).ok_or_else(|| bad(c, format!("no mask {mid}")))?; let k = m diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index 163a1026804..eea895fcaf9 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -1023,6 +1023,30 @@ impl Session { /// The op that sets a photo's develop settings and appends a History entry (for batches). pub fn develop_op(&self, id: PhotoId, settings: DevelopSettings, label: &str) -> Option { self.catalog.photo(id)?; + let mut settings = settings; + // old masks (on the corrected frame) go onto the photo, from the frame they were drawn on: + // masks this edit kept, under the photo's settings before it (a geometry edit then moves + // the photo, not them); masks it brought in (paste, sync, a preset, a history step, a + // sidecar), under the settings they came with, where they render now. Kept masks also + // turn with an orientation change the edit makes (a sync or paste of the Crop group). + let before = match &self.interaction { + Some(i) if i.photo == id => Some(i.original.clone()), + _ => self.develop_of(id), + }; + let turn = before.as_ref().and_then(|b| orientation_change(b.orientation, settings.orientation)); + if settings.masks.iter().any(|m| !m.on_photo) || turn.is_some() { + let kept_frame = before.as_ref().and_then(|b| self.mask_frame(id, b)); + let new_frame = self.mask_frame(id, &settings); + for m in &mut settings.masks { + let kept = before.as_ref().is_some_and(|b| b.masks.contains(m)); + if let Some(f) = if kept { kept_frame.as_ref() } else { new_frame.as_ref() } { + lightcraft_pipeline::mask_space::attach(m, f); + } + if let (true, Some(t)) = (kept, turn) { + lightcraft_pipeline::mask_space::turn(m, t); + } + } + } let settings = Arc::new(settings); let step = lightcraft_catalog::HistoryStep { label: label.into(), settings: settings.clone() }; Some(Op::Batch { @@ -1030,11 +1054,45 @@ impl Session { }) } + /// Put the old masks of `d` (on the corrected frame, `Mask::on_photo` false) on photo `id` + /// before the warp, from the frame of `drawn` (the settings they were drawn under): they + /// render where they did and from then on stay on their content when lens corrections, + /// Upright or Transform change. + pub fn attach_masks(&self, id: PhotoId, drawn: &DevelopSettings, d: &mut DevelopSettings) { + if d.masks.iter().all(|m| m.on_photo) { + return; + } + let Some(frame) = self.mask_frame(id, drawn) else { return }; + for m in &mut d.masks { + lightcraft_pipeline::mask_space::attach(m, &frame); + } + } + + /// The uncropped frame of photo `id` under settings `d`, with its lens: where mask + /// coordinates go through its warp ([`lightcraft_pipeline::geometry::Frame::for_mask`]). + pub(crate) fn mask_frame(&self, id: PhotoId, d: &DevelopSettings) -> Option { + let p = self.catalog.photo(id)?; + Some(lightcraft_pipeline::geometry::Frame::with_lens( + p.width.max(1) as usize, + p.height.max(1) as usize, + &d.effective(), + false, + p.embedded_lens.as_ref(), + )) + } + pub fn begin_interaction(&mut self, label: &str) -> Result<()> { if self.interaction.is_some() { self.end_interaction()?; } let id = self.active().ok_or_else(|| EngineError::Other("no active photo".into()))?; + // old masks go onto the photo before a drag moves the frame under them (they then stay on + // their content while it does, not only once it ends) + if let Some(d) = self.develop_of(id).filter(|d| d.masks.iter().any(|m| !m.on_photo)) { + let mut on = (*d).clone(); + self.attach_masks(id, &d, &mut on); + self.apply_silent(Op::SetDevelop { id, settings: Arc::new(on), label: label.into(), edited: None })?; + } let original = self.develop_of(id).unwrap_or_default(); self.interaction = Some(Interaction { label: label.into(), photo: id, original, crop_edited: false }); Ok(()) @@ -1373,3 +1431,22 @@ mod tests; use tests::face_recognize as tests_face_recognize; #[cfg(test)] use tests::xmp as tests_xmp; + +/// The turn or flip that takes orientation `from` to `to` (`None` when they are the same): what the +/// masks, on the oriented photo, must follow ([`lightcraft_pipeline::mask_space::turn`]). +pub(crate) fn orientation_change(from: lightcraft_geom::Orientation, to: lightcraft_geom::Orientation) -> Option { + use lightcraft_geom::Orientation; + if from == to { + return None; + } + let inv = from.inverse(); + let probes = [(0.2, 0.3), (0.7, 0.1), (0.4, 0.9)]; + let close = |a: (f64, f64), b: (f64, f64)| (a.0 - b.0).abs() < 1e-9 && (a.1 - b.1).abs() < 1e-9; + (0..8u8).map(|k| Orientation::from_parts(k >= 4, k % 4)).find(|t| { + probes.iter().all(|&(x, y)| { + let (rx, ry) = inv.map(x, y, 1.0, 1.0); + let (tx, ty) = from.map(rx, ry, 1.0, 1.0); + close(t.map(tx, ty, 1.0, 1.0), to.map(rx, ry, 1.0, 1.0)) + }) + }) +} diff --git a/crates/engine/src/segment.rs b/crates/engine/src/segment.rs index b69a6dca277..53ee4a5f839 100644 --- a/crates/engine/src/segment.rs +++ b/crates/engine/src/segment.rs @@ -376,12 +376,23 @@ fn clicks_of(include: &[Point], exclude: &[Point]) -> Vec { } impl Session { - /// The key and settings of photo `id` as the model sees it: its look without masks, uncropped. + /// The key and settings of photo `id` as the model sees it: its look without masks, uncropped + /// and unflipped, and without lens corrections, Upright and Transform. Mask coordinates + /// (clicks, stored selections) live on the photo before those (`Mask::on_photo`), so a + /// selection stays on its content when they change, and changing them doesn't ask again. #[cfg_attr(not(feature = "sam"), allow(dead_code))] - fn segment_key(&self, id: PhotoId) -> Option<(u64, lightcraft_develop::DevelopSettings)> { + pub(crate) fn segment_key(&self, id: PhotoId) -> Option<(u64, lightcraft_develop::DevelopSettings)> { let p = self.catalog.photo(id)?; let mut d = (*p.develop).clone(); d.masks.clear(); + // (the crop doesn't show in the uncropped input: it doesn't ask again either) + d.crop = Default::default(); + d.geometry = Default::default(); + d.optics.lens_profile = false; + d.optics.distortion = 0.0; + d.optics.remove_ca = false; + d.optics.ca_red = 0.0; + d.optics.ca_blue = 0.0; let content = crate::media::content_key(p); let mut h = mix(0xcbf2_9ce4_8422_2325, d.hash64()); h = mix(h, id.0); @@ -410,6 +421,13 @@ impl Session { region: Option<[f64; 4]>, ) -> Result { let dir = self.segmenter.model_dir()?; + // old masks go onto the photo first: the selection that comes back is in its coordinates + if let Some(cur) = self.develop_of(id).filter(|d| d.masks.iter().any(|m| !m.on_photo)) { + let mut on = (*cur).clone(); + self.attach_masks(id, &cur, &mut on); + self.apply_silent(lightcraft_catalog::Op::SetDevelop { id, settings: std::sync::Arc::new(on), label: "Masks".into(), edited: None }) + .map_err(|e| e.to_string())?; + } let (key, mut d) = self.segment_key(id).ok_or("no such photo")?; let p = self.catalog.photo(id).ok_or("no such photo")?.clone(); let missing = match &p.source { diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs index 37b300dbfc3..9a409cbc9a6 100644 --- a/crates/engine/src/tests.rs +++ b/crates/engine/src/tests.rs @@ -33,6 +33,7 @@ mod libops; mod library; mod lightroom_folder; mod mask_effects; +mod mask_geometry; mod merge; mod move_to_share; mod organize; diff --git a/crates/engine/src/tests/mask_geometry.rs b/crates/engine/src/tests/mask_geometry.rs new file mode 100644 index 00000000000..c2a1edef855 --- /dev/null +++ b/crates/engine/src/tests/mask_geometry.rs @@ -0,0 +1,315 @@ +//! Masks stay on the photo's content when its geometry changes: Rotate +//! Left / Right turns them with the photo, an old mask (on the corrected frame) goes onto the +//! photo at its next edit without moving, and the AI models see the photo the masks live on +//! (no lens corrections, Upright, Transform, crop or flips), so changing those leaves the AI +//! selections as they are. + +use lightcraft_develop::{DevelopSettings, Mask, MaskComponent, MaskOp, MaskShape}; +use lightcraft_geom::Point; +use serde_json::json; + +use crate::Session; + +fn active_dev(s: &Session) -> DevelopSettings { + (*s.develop_of(s.active().unwrap()).unwrap()).clone() +} + +fn radial_at(p: Point) -> Mask { + Mask { + id: 1, + components: vec![MaskComponent { + name: None, + op: MaskOp::Add, + invert: false, + shape: MaskShape::Radial { center: p, rx: 0.1, ry: 0.05, angle: 20.0, feather: 50.0, invert: false }, + }], + ..Default::default() + } +} + +fn centre(d: &DevelopSettings) -> (Point, f64) { + match &d.masks[0].components[0].shape { + MaskShape::Radial { center, angle, .. } => (*center, *angle), + other => panic!("{other:?}"), + } +} + +#[test] +fn rotating_the_photo_turns_its_masks_with_it() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + let p = Point::new(0.2, 0.3); + d.masks = vec![radial_at(p)]; + s.set_develop(id, d, "Mask").unwrap(); + s.execute("photo.rotateRight", &json!({})).unwrap(); + let (c, a) = centre(&active_dev(&s)); + // a quarter turn clockwise: (x, y) → (1 − y, x), and the ellipse turns along + assert!((c.x - 0.7).abs() < 1e-9 && (c.y - 0.2).abs() < 1e-9, "{c:?}"); + assert_eq!(a, 110.0); + s.execute("photo.rotateLeft", &json!({})).unwrap(); + let (c, a) = centre(&active_dev(&s)); + assert!((c.x - p.x).abs() < 1e-9 && (c.y - p.y).abs() < 1e-9 && a == 20.0, "{c:?} {a}"); +} + +#[test] +fn an_old_mask_goes_onto_the_photo_at_its_next_edit_without_moving() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + d.geometry.vertical = 30.0; + d.geometry.rotate = 5.0; + let p = Point::new(0.3, 0.4); + let mut m = radial_at(p); + m.on_photo = false; + d.masks = vec![m]; + // as a catalog from before keeps it + s.catalog.apply(lightcraft_catalog::Op::SetDevelop { id, settings: std::sync::Arc::new(d.clone()), label: "Old".into(), edited: None }).unwrap(); + assert!(!active_dev(&s).masks[0].on_photo); + d.light.exposure = 0.5; + s.set_develop(id, d.clone(), "Exposure").unwrap(); + let now = active_dev(&s); + assert!(now.masks[0].on_photo, "attached at the edit"); + let photo = s.catalog.photo(id).unwrap(); + let frame = lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, &d, false, None); + let (c, _) = centre(&now); + let back = frame.for_mask(true).mask_to_norm(c); + assert!((back.x - p.x).abs() < 1e-6 && (back.y - p.y).abs() < 1e-6, "renders where it did: {back:?}"); + assert!((c.x - p.x).hypot(c.y - p.y) > 0.005, "its place on the photo differs from the corrected frame's: {c:?}"); + // a later Transform change leaves it on the photo where it is + let mut d = now.clone(); + d.geometry.vertical = -10.0; + s.set_develop(id, d, "Transform").unwrap(); + assert_eq!(centre(&active_dev(&s)).0, c); +} + +#[test] +fn the_ai_models_see_the_photo_the_masks_live_on() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let key = s.segment_key(id).unwrap().0; + let mut d = active_dev(&s); + d.geometry.vertical = 20.0; + d.optics.distortion = 30.0; + d.crop.geometry.angle = 5.0; + d.crop.flip_h = true; + s.set_develop(id, d.clone(), "Geometry").unwrap(); + assert_eq!(s.segment_key(id).unwrap().0, key, "geometry doesn't change what the models see: the AI masks stay valid"); + d.light.exposure = 1.0; + s.set_develop(id, d, "Exposure").unwrap(); + assert_ne!(s.segment_key(id).unwrap().0, key, "the look still does"); +} + +/// A mask saved before `Mask::on_photo` reads as an old mask (on the corrected frame), a new mask +/// is on the photo, and an old one is written as it was read. +#[test] +fn a_mask_saved_before_reads_as_an_old_mask() { + let old: Mask = serde_json::from_value(json!({"id": 3, "name": "Mask 3", "components": []})).unwrap(); + assert!(!old.on_photo); + assert!(Mask::default().on_photo); + let written = serde_json::to_value(&old).unwrap(); + assert!(written.get("on_photo").is_none(), "{written}"); + assert_eq!(serde_json::to_value(Mask::default()).unwrap()["on_photo"], json!(true)); +} + +/// Old masks an edit brings in (paste, sync, a preset, a history step, a sidecar) go onto the +/// photo from the settings they came with, where they render now, not from the photo's settings +/// before the edit (review of #3550). +#[test] +fn old_masks_an_edit_brings_in_go_onto_the_photo_from_the_settings_they_came_with() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + // the photo now: no Transform + let before = active_dev(&s); + // what comes in: a Transform and an old mask drawn under it + let p = Point::new(0.3, 0.4); + let mut incoming = before.clone(); + incoming.geometry.vertical = 30.0; + incoming.geometry.rotate = 5.0; + let mut m = radial_at(p); + m.on_photo = false; + incoming.masks = vec![m]; + s.set_develop(id, incoming.clone(), "Paste Settings").unwrap(); + let now = active_dev(&s); + assert!(now.masks[0].on_photo); + let photo = s.catalog.photo(id).unwrap(); + let frame = lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, &incoming, false, None); + let back = frame.for_mask(true).mask_to_norm(centre(&now).0); + assert!((back.x - p.x).abs() < 1e-6 && (back.y - p.y).abs() < 1e-6, "renders where it did under its own settings: {back:?}"); +} + +/// A click on an old Object mask goes onto the photo with the mask before the model reads it: the +/// stored clicks and the new one are then in the same coordinates (review of #3550). +#[test] +fn a_click_on_an_old_object_mask_goes_onto_the_photo_with_it() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + d.geometry.vertical = 30.0; + d.geometry.rotate = 5.0; + let p = Point::new(0.3, 0.4); + d.masks = vec![Mask { + id: 1, + on_photo: false, + components: vec![MaskComponent { + name: None, + op: MaskOp::Add, + invert: false, + shape: MaskShape::Object { hint: vec![p], exclude: Vec::new(), seg: None, detail: Vec::new(), edge: 0.0 }, + }], + ..Default::default() + }]; + s.catalog.apply(lightcraft_catalog::Op::SetDevelop { id, settings: std::sync::Arc::new(d.clone()), label: "Old".into(), edited: None }).unwrap(); + s.active_mask = Some(1); + // (no model: the command fails at the model, after the mask went onto the photo) + s.segmenter.dir = Some(std::env::temp_dir().join("lightcraft-no-model-mask-geometry")); + let _ = s.execute("mask.objectPoint", &json!({"x": 0.6, "y": 0.5})); + let now = active_dev(&s); + assert!(now.masks[0].on_photo); + let photo = s.catalog.photo(id).unwrap(); + let frame = lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, &d, false, None); + let MaskShape::Object { hint, .. } = &now.masks[0].components[0].shape else { panic!() }; + let want = frame.for_mask(true).norm_to_mask(p); + assert!((hint[0].x - want.x).abs() < 1e-9 && (hint[0].y - want.y).abs() < 1e-9, "{hint:?} vs {want:?}"); +} + +/// An old mask the photo keeps, when an edit both brings in a mask and changes the geometry (a +/// preset), goes onto the photo from the photo's settings before the edit, where it rendered; the +/// mask brought in, from the settings it came with (review of #3550). +#[test] +fn a_kept_old_mask_attaches_under_the_settings_before_an_edit_that_adds_one() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + d.geometry.vertical = 30.0; + d.geometry.rotate = 5.0; + let p = Point::new(0.3, 0.4); + let mut kept = radial_at(p); + kept.on_photo = false; + d.masks = vec![kept]; + s.catalog.apply(lightcraft_catalog::Op::SetDevelop { id, settings: std::sync::Arc::new(d.clone()), label: "Old".into(), edited: None }).unwrap(); + // the preset: another Transform and a new old mask + let mut incoming = d.clone(); + incoming.geometry.vertical = -20.0; + incoming.geometry.rotate = 0.0; + let q = Point::new(0.6, 0.6); + let mut added = radial_at(q); + added.id = 2; + added.on_photo = false; + incoming.masks.push(added); + s.set_develop(id, incoming.clone(), "Preset").unwrap(); + let now = active_dev(&s); + assert!(now.masks.iter().all(|m| m.on_photo)); + let photo = s.catalog.photo(id).unwrap(); + let frame = |d: &DevelopSettings| lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, d, false, None); + let at = |m: &Mask| match &m.components[0].shape { + MaskShape::Radial { center, .. } => *center, + other => panic!("{other:?}"), + }; + let back = frame(&d).for_mask(true).mask_to_norm(at(&now.masks[0])); + assert!((back.x - p.x).abs() < 1e-6 && (back.y - p.y).abs() < 1e-6, "the kept mask, from the frame it was drawn on: {back:?}"); + let back = frame(&incoming).for_mask(true).mask_to_norm(at(&now.masks[1])); + assert!((back.x - q.x).abs() < 1e-6 && (back.y - q.y).abs() < 1e-6, "the added mask, from its own: {back:?}"); +} + +/// A sync or paste of the Crop group without the Masks group turns the photo: its masks turn with +/// it, as Rotate does (review of #3550). +#[test] +fn masks_turn_with_an_orientation_a_sync_brings() { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + let p = Point::new(0.2, 0.3); + d.masks = vec![radial_at(p)]; + s.set_develop(id, d.clone(), "Mask").unwrap(); + let mut synced = d.clone(); + synced.orientation = d.orientation.rotated(true); + s.set_develop(id, synced, "Sync Settings").unwrap(); + let (c, a) = centre(&active_dev(&s)); + assert!((c.x - 0.7).abs() < 1e-9 && (c.y - 0.2).abs() < 1e-9 && a == 110.0, "{c:?} {a}"); + // Rotate itself still turns them once + s.execute("photo.rotateLeft", &json!({})).unwrap(); + let (c, a) = centre(&active_dev(&s)); + assert!((c.x - p.x).abs() < 1e-9 && (c.y - p.y).abs() < 1e-9 && a == 20.0, "{c:?} {a}"); +} + +/// The change between two orientations is the turn Rotate makes, and none between equal ones. +#[test] +fn the_change_between_orientations_is_the_turn_made() { + use lightcraft_geom::Orientation; + for k in 0..8u8 { + let o = Orientation::from_parts(k >= 4, k % 4); + assert_eq!(crate::orientation_change(o, o), None); + for cw in [true, false] { + assert_eq!(crate::orientation_change(o, o.rotated(cw)), Some(Orientation::Normal.rotated(cw)), "{o:?} {cw}"); + } + } +} + +/// An old Object mask with a Transform active, and a click. +fn old_object_mask() -> (Session, lightcraft_catalog::PhotoId, DevelopSettings, Point) { + let mut s = Session::with_demo(); + let id = s.active().unwrap(); + let mut d = active_dev(&s); + d.geometry.vertical = 30.0; + d.geometry.rotate = 5.0; + let p = Point::new(0.3, 0.4); + d.masks = vec![Mask { + id: 1, + on_photo: false, + components: vec![MaskComponent { + name: None, + op: MaskOp::Add, + invert: false, + shape: MaskShape::Object { hint: vec![p], exclude: Vec::new(), seg: None, detail: Vec::new(), edge: 0.0 }, + }], + ..Default::default() + }]; + s.catalog.apply(lightcraft_catalog::Op::SetDevelop { id, settings: std::sync::Arc::new(d.clone()), label: "Old".into(), edited: None }).unwrap(); + s.active_mask = Some(1); + (s, id, d, p) +} + +/// A click on an old Object mask that lands off the photo (the corrected frame's blank space) is +/// refused, not moved onto the photo's edge, and leaves the mask as it was (review of #3550). +#[test] +fn a_click_off_the_photo_on_an_old_object_mask_is_refused() { + let (mut s, id, d, _) = old_object_mask(); + let photo = s.catalog.photo(id).unwrap(); + let frame = lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, &d, false, None); + let f = frame.for_mask(true); + let off = [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0), (1.0, 1.0), (0.5, 0.0), (0.5, 1.0)] + .map(|(x, y)| Point::new(x, y)) + .into_iter() + .find(|p| { + let n = f.norm_to_mask(*p); + !(n.x.is_finite() && n.y.is_finite()) || n.x < -0.01 || n.x > 1.01 || n.y < -0.01 || n.y > 1.01 + }) + .expect("a corner of the transformed frame is off the photo"); + let e = s.execute("mask.objectPoint", &json!({"x": off.x, "y": off.y})).unwrap_err().to_string(); + assert!(e.contains("outside the photo"), "{e}"); + assert_eq!(active_dev(&s).masks, d.masks, "nothing changed"); +} + +/// The click on its way to the model is in the mask's coordinates with the stored ones (with a +/// model folder that looks installed; skipped where the build has no model support). +#[test] +fn a_pending_click_on_an_old_object_mask_is_in_the_masks_coordinates() { + if !crate::segment::Segmenter::AVAILABLE { + lightcraft_testkit::skip!(Model, "built without the segmentation model"); + return; + } + let (mut s, id, d, p) = old_object_mask(); + s.segmenter.background = true; + s.segmenter.dir = Some(super::segment::damaged_model("mask-geometry-pending")); + let r = s.execute("mask.objectPoint", &json!({"x": 0.6, "y": 0.5})).unwrap(); + assert_eq!(r["pending"], true); + let photo = s.catalog.photo(id).unwrap(); + let frame = lightcraft_pipeline::geometry::Frame::with_lens(photo.width as usize, photo.height as usize, &d, false, None); + let f = frame.for_mask(true); + let pending = s.segmenter.pending_clicks().expect("the click is pending").clone(); + assert_eq!(pending.hint.len(), 2); + for (got, want) in pending.hint.iter().zip([f.norm_to_mask(p), f.norm_to_mask(Point::new(0.6, 0.5))]) { + assert!((got.x - want.x).abs() < 1e-9 && (got.y - want.y).abs() < 1e-9, "{got:?} vs {want:?}"); + } +} diff --git a/crates/engine/src/tests/segment.rs b/crates/engine/src/tests/segment.rs index ceb2365fbee..b649dbdd7e6 100644 --- a/crates/engine/src/tests/segment.rs +++ b/crates/engine/src/tests/segment.rs @@ -17,7 +17,7 @@ fn tmp(name: &str) -> std::path::PathBuf { } /// A folder that looks installed but holds no usable model. -fn damaged_model(name: &str) -> std::path::PathBuf { +pub(super) fn damaged_model(name: &str) -> std::path::PathBuf { let d = tmp(name); std::fs::create_dir_all(&d).unwrap(); std::fs::write(d.join("model.safetensors"), b"\x10\x00\x00\x00\x00\x00\x00\x00{not json at all}").unwrap(); diff --git a/crates/gpu/src/render.rs b/crates/gpu/src/render.rs index 9d6172d9c36..f3794f47a2e 100644 --- a/crates/gpu/src/render.rs +++ b/crates/gpu/src/render.rs @@ -997,6 +997,11 @@ fn masks(cx: &mut Cx<'_>, lin: &Buf, prep: &Prep, plan: &Plan<'_>, host: &mut Ho } let comp_plane = cx.gpu.buffer(n); for (mi, m) in list.iter().enumerate() { + // its coordinates on the photo before the warp (`masks::evaluate_one`): through a lens or + // perspective warp the kernels' affine positions don't hold, so its shapes run on the CPU + let mframe = plan.frame.for_mask(m.on_photo); + let frame = &*mframe; + let warped = frame.mask_warp().is_some(); let mut first = true; for comp in &m.components { let op = match comp.op { @@ -1012,6 +1017,7 @@ fn masks(cx: &mut Cx<'_>, lin: &Buf, prep: &Prep, plan: &Plan<'_>, host: &mut Ho let mut aux: Vec = Vec::new(); let mut own: Option = None; let kind = match &comp.shape { + MaskShape::Linear { .. } | MaskShape::Radial { .. } if warped => None, MaskShape::Linear { start, end } => { let (a, b) = (frame.norm_to_long(*start), frame.norm_to_long(*end)); let d = b - a; diff --git a/crates/gpu/tests/mask_geometry.rs b/crates/gpu/tests/mask_geometry.rs new file mode 100644 index 00000000000..1cbd741a0e3 --- /dev/null +++ b/crates/gpu/tests/mask_geometry.rs @@ -0,0 +1,151 @@ +//! On the GPU, masks stay on the image content under every geometry change: +//! a mask drawn around a mark still brightens that mark after Straighten, a crop, a flip, a quarter +//! turn or a lens / perspective warp, rendered fresh or through the view's stage cache. (The CPU +//! side is `lightcraft-pipeline`'s `tests_mask_geometry`.) + +use std::sync::Arc; + +use lightcraft_develop::{BrushStroke, DevelopSettings, LocalAdjustments, Mask, MaskComponent, MaskOp, MaskShape, SegMask}; +use lightcraft_geom::{CropGeometry, Point, Rect}; +use lightcraft_pipeline::{RenderRequest, SourceInfo, StageCache}; +use lightcraft_raster::{Rgb32f, Rgba8}; + +const W: usize = 240; +const H: usize = 160; +const MARK: (f64, f64) = (0.3, 0.32); + +fn gpu() -> bool { + let ok = lightcraft_gpu::available(); + if !ok { + lightcraft_testkit::skip!(Gpu, "no GPU adapter"); + } + ok +} + +fn marked(mark: bool) -> Rgb32f { + let (mx, my) = (MARK.0 * W as f64, MARK.1 * H as f64); + Rgb32f::from_fn(W, H, |x, y| { + let d = ((x as f64 + 0.5 - mx).powi(2) + (y as f64 + 0.5 - my).powi(2)).sqrt(); + if d < 2.5 && mark { [0.9; 3] } else { [0.05; 3] } + }) +} + +fn with_mask(shape: MaskShape) -> DevelopSettings { + let mut s = DevelopSettings::default(); + s.masks.push(Mask { + id: 1, + components: vec![MaskComponent { name: None, op: MaskOp::Add, invert: false, shape }], + adjust: LocalAdjustments { exposure: 2.0, ..Default::default() }, + ..Default::default() + }); + s +} + +fn shapes() -> Vec<(&'static str, MaskShape)> { + let l = W.max(H) as f64; + const SIDE: usize = 64; + let logits: Vec = (0..SIDE * SIDE) + .map(|i| { + let (x, y) = ((i % SIDE) as f64 + 0.5, (i / SIDE) as f64 + 0.5); + let (dx, dy) = ((x / SIDE as f64 - MARK.0) * W as f64, (y / SIDE as f64 - MARK.1) * H as f64); + if (dx * dx + dy * dy).sqrt() < 10.0 { 8.0 } else { -8.0 } + }) + .collect(); + vec![ + ("radial", MaskShape::Radial { center: Point::new(MARK.0, MARK.1), rx: 12.0 / l, ry: 12.0 / l, angle: 0.0, feather: 40.0, invert: false }), + ( + "brush", + MaskShape::Brush { + strokes: vec![BrushStroke { + points: vec![Point::new(MARK.0 - 0.005, MARK.1), Point::new(MARK.0 + 0.005, MARK.1)], + size: 8.0 / l, + ..Default::default() + }], + }, + ), + ( + "object", + MaskShape::Object { + hint: vec![Point::new(MARK.0, MARK.1)], + exclude: Vec::new(), + seg: Some(SegMask::from_logits(SIDE, &logits)), + detail: Vec::new(), + edge: 0.0, + }, + ), + ] +} + +fn geometries() -> Vec<(&'static str, Box)> { + vec![ + ("straighten", Box::new(|s: &mut DevelopSettings| s.crop.geometry = CropGeometry { rect: Rect::new(0.08, 0.1, 0.92, 0.9), angle: 7.0 })), + ("crop", Box::new(|s: &mut DevelopSettings| s.crop.geometry.rect = Rect::new(0.1, 0.15, 0.7, 0.8))), + ("flip", Box::new(|s: &mut DevelopSettings| s.crop.flip_h = true)), + ( + "perspective", + Box::new(|s: &mut DevelopSettings| { + s.geometry.vertical = 25.0; + s.geometry.rotate = 4.0; + }), + ), + ("distortion", Box::new(|s: &mut DevelopSettings| s.optics.distortion = 40.0)), + ( + // Rotate Right: the photo and its masks turn together (`photo.rotateRight`) + "quarter turn", + Box::new(|s: &mut DevelopSettings| { + let turn = lightcraft_geom::Orientation::Normal.rotated(true); + s.orientation = s.orientation.rotated(true); + for m in &mut s.masks { + lightcraft_pipeline::mask_space::turn(m, turn); + } + }), + ), + ] +} + +fn luma(img: &Rgba8, i: usize) -> f64 { + let p = img.data[i]; + (p[0] as f64 + p[1] as f64 + p[2] as f64) / 3.0 +} + +fn centroid(w: usize, weights: impl Iterator) -> (f64, f64) { + let (mut sx, mut sy, mut n) = (0.0, 0.0, 0.0); + for (i, v) in weights.enumerate() { + sx += v * ((i % w) as f64 + 0.5); + sy += v * ((i / w) as f64 + 0.5); + n += v; + } + assert!(n > 0.0, "nothing found"); + (sx / n, sy / n) +} + +fn on_gpu(src: &Arc, s: &DevelopSettings, cache: Option<&StageCache>) -> Rgba8 { + let req = RenderRequest::fit(W, H); + lightcraft_gpu::try_render(src, &SourceInfo::default(), s, &req, cache).map(|r| r.image).unwrap_or_else(|e| panic!("GPU render failed: {e:?}")) +} + +#[test] +fn masks_stay_on_the_content_under_every_geometry_change_on_the_gpu() { + if !gpu() { + return; + } + let src = Arc::new(marked(true)); + for (name, shape) in shapes() { + for (what, change) in geometries() { + let mut s = with_mask(shape.clone()); + let cache = StageCache::default(); + on_gpu(&src, &s, Some(&cache)); + change(&mut s); + let unmasked = DevelopSettings { masks: Vec::new(), ..s.clone() }; + let plain = on_gpu(&src, &unmasked, None); + // (where the marked photo differs from an unmarked one: a warp leaves light blank canvas) + let bare = on_gpu(&Arc::new(marked(false)), &unmasked, None); + let mark = centroid(plain.width, (0..plain.data.len()).map(|i| (luma(&plain, i) - luma(&bare, i)).max(0.0))); + for (how, m) in [("fresh", on_gpu(&src, &s, None)), ("cached", on_gpu(&src, &s, Some(&cache)))] { + let at = centroid(m.width, (0..m.data.len()).map(|i| (luma(&m, i) - luma(&plain, i)).max(0.0))); + let d = ((at.0 - mark.0).powi(2) + (at.1 - mark.1).powi(2)).sqrt(); + assert!(d < 2.0, "{name} after {what} ({how}): the mask's effect is at {at:?}, the mark at {mark:?}"); + } + } + } +} diff --git a/crates/pipeline/src/geometry.rs b/crates/pipeline/src/geometry.rs index 641d50216bb..3fa043f5e13 100644 --- a/crates/pipeline/src/geometry.rs +++ b/crates/pipeline/src/geometry.rs @@ -33,6 +33,10 @@ pub struct Frame { pub warp: Option, /// Set when this frame draws only a window of a larger output (see [`Frame::window`]). pub view: Option, + /// Mask coordinates are on the photo before the warp ([`Frame::for_mask`], + /// `lightcraft_develop::Mask::on_photo`); otherwise they are normalized coordinates of this + /// frame's transformed image, like spots and the crop. + pub masks_on_photo: bool, } /// Where a windowed [`Frame`]'s pixels sit in the full output: its offset and the full output's @@ -77,6 +81,7 @@ impl Frame { flip_v: s.crop.flip_v, warp: (!warp.is_identity()).then_some(warp), view: None, + masks_on_photo: false, }; if apply_crop && s.geometry.constrain_crop { f.constrain_to_image(); @@ -223,6 +228,61 @@ impl Frame { self.out_to_norm(out_w, out_h).inverse().unwrap_or(Affine::IDENTITY) } + /// This frame for evaluating mask `m`: whether its coordinates are on the photo before the + /// warp ([`lightcraft_develop::Mask::on_photo`]). + pub fn for_mask(&self, on_photo: bool) -> std::borrow::Cow<'_, Frame> { + if self.masks_on_photo == on_photo { + std::borrow::Cow::Borrowed(self) + } else { + std::borrow::Cow::Owned(Frame { masks_on_photo: on_photo, ..self.clone() }) + } + } + + /// The warp mask coordinates go through: the lens / perspective warp when masks are on the + /// photo and the warp moves pixels, else none (mask coordinates are then this frame's + /// normalized coordinates). + pub fn mask_warp(&self) -> Option<&Warp> { + self.warp.as_ref().filter(|w| self.masks_on_photo && w.moves_pixels()) + } + + /// Output pixel → mask coordinates (see [`Frame::masks_on_photo`]). + pub fn out_to_mask(&self, out_w: usize, out_h: usize) -> MaskMap { + MaskMap { + o2t: self.out_to_oriented(out_w, out_h), + to_norm: self.out_to_norm(out_w, out_h), + ow: self.ow, + oh: self.oh, + warp: self.mask_warp().cloned(), + } + } + + /// Mask coordinates → output pixel (the inverse of [`Frame::out_to_mask`]); `None` for a + /// point the warp can't invert (far outside a strong one), which has no place in the output. + pub fn mask_to_out(&self, out_w: usize, out_h: usize) -> impl Fn(Point) -> Option + use<> { + let to_out = self.norm_to_out(out_w, out_h); + let (warp, ow, oh) = (self.mask_warp().cloned(), self.ow, self.oh); + move |n: Point| match &warp { + Some(w) => w.from_source(Point::new(n.x * ow, n.y * oh)).map(|t| to_out.apply(Point::new(t.x / ow, t.y / oh))), + None => Some(to_out.apply(n)), + } + } + + /// Normalized coordinates of this frame's transformed image → mask coordinates. + pub fn norm_to_mask(&self, n: Point) -> Point { + match self.mask_warp() { + Some(w) => { + let s = w.to_source(Point::new(n.x * self.ow, n.y * self.oh), 1); + Point::new(s.x / self.ow, s.y / self.oh) + } + None => n, + } + } + + /// Mask coordinates → normalized coordinates of this frame's transformed image. + pub fn mask_to_norm(&self, n: Point) -> Point { + mask_to_norm(self.mask_warp(), self.ow, self.oh, n) + } + /// Convert normalized oriented coordinates to "long-edge units" (isotropic), used by mask shapes. pub fn norm_to_long(&self, p: Point) -> Point { let l = self.ow.max(self.oh); @@ -287,6 +347,40 @@ impl Frame { } } +/// Mask coordinates `n` (on the photo before `warp`, normalized to `ow × oh`) → normalized +/// transformed coordinates. A point the warp can't invert (far outside a strong one) stays put. +fn mask_to_norm(warp: Option<&Warp>, ow: f64, oh: f64, n: Point) -> Point { + match warp.and_then(|w| w.from_source(Point::new(n.x * ow, n.y * oh))) { + Some(t) => Point::new(t.x / ow, t.y / oh), + None => n, + } +} + +/// Output pixel → mask coordinates of a frame ([`Frame::out_to_mask`]). +#[derive(Clone, Debug)] +pub struct MaskMap { + /// Output px → transformed px, and → normalized transformed coordinates. + o2t: Affine, + to_norm: Affine, + ow: f64, + oh: f64, + warp: Option, +} + +impl MaskMap { + /// The mask coordinates at output position `p` (px; pixel centres at `x + 0.5`). + #[inline] + pub fn apply(&self, p: Point) -> Point { + match &self.warp { + Some(w) => { + let s = w.to_source(self.o2t.apply(p), 1); + Point::new(s.x / self.ow, s.y / self.oh) + } + None => self.to_norm.apply(p), + } + } +} + /// How a render resamples its source (see [`Frame::sample_plan`]). #[derive(Clone, Debug)] pub struct SamplePlan { diff --git a/crates/pipeline/src/lib.rs b/crates/pipeline/src/lib.rs index d56e8fe82de..365f8445dab 100644 --- a/crates/pipeline/src/lib.rs +++ b/crates/pipeline/src/lib.rs @@ -34,6 +34,7 @@ pub mod geometry; pub mod local; pub mod local_tone; pub mod lut; +pub mod mask_space; pub mod masks; pub mod optics; pub mod output; @@ -754,6 +755,8 @@ mod tests_hdr; #[cfg(test)] mod tests_local; #[cfg(test)] +mod tests_mask_geometry; +#[cfg(test)] mod tests_nr_scale; #[cfg(test)] mod tests_tone; diff --git a/crates/pipeline/src/mask_space.rs b/crates/pipeline/src/mask_space.rs new file mode 100644 index 00000000000..36b998ab5e6 --- /dev/null +++ b/crates/pipeline/src/mask_space.rs @@ -0,0 +1,473 @@ +//! Moving a mask's coordinates between frames: [`attach`] puts an old mask's coordinates (on the +//! corrected frame) on the photo before the warp ([`lightcraft_develop::Mask::on_photo`]), and +//! [`turn`] follows a quarter turn or flip of the photo (Rotate Left / Right). Gradients, brush +//! strokes and clicks move point by point; stored AI segmentations are resampled. + +use lightcraft_develop::{Mask, MaskShape, SegMask}; +use lightcraft_geom::{Orientation, Point}; + +use crate::geometry::Frame; +use crate::masks::SegGrid; + +/// Put mask `m`, drawn on the corrected (transformed) image of `frame`, on the photo before the +/// warp: it then renders where it did under `frame` and stays on that content whatever lens +/// corrections, Upright or Transform do later. A mask already on the photo is left alone. +/// +/// Points move exactly; a gradient's shape (a radial's radii and angle, a linear's direction and +/// width) goes through the warp's local linear part at the gradient, so it covers the same region +/// as long as the warp is close to linear across it (lens and perspective warps are smooth). +pub fn attach(m: &mut Mask, frame: &Frame) { + if m.on_photo { + return; + } + m.on_photo = true; + let f = frame.for_mask(true); + if f.mask_warp().is_none() { + // without a warp both are the same coordinates + return; + } + let fwd = |p: Point| f.norm_to_mask(p); + let back = |p: Point| f.mask_to_norm(p); + let l = f.ow.max(f.oh).max(1e-9); + let (sx, sy) = (f.ow / l, f.oh / l); + for c in &mut m.components { + match &mut c.shape { + MaskShape::Linear { start, end } => (*start, *end) = attach_linear(*start, *end, &fwd, sx, sy), + MaskShape::Radial { center, rx, ry, angle, .. } => { + let mid = *center; + *center = fwd(mid); + if let Some(j) = jacobian(&fwd, mid, sx, sy) + && let Some((nrx, nry, na)) = attach_ellipse(j, *rx, *ry, *angle) + { + (*rx, *ry, *angle) = (nrx, nry, na); + } + } + _ => {} + } + } + remap(m, &fwd, &back, 0.0, false); +} + +/// The local linear part of `f` (normalized → normalized) at `p`, in long-edge units (isotropic; +/// `sx`, `sy` are the frame's sides over its long side): `[a, b, c, d]` takes `(dx, dy)` to +/// `(a dx + b dy, c dx + d dy)`. `None` where `f` isn't finite or collapses. +fn jacobian(f: &dyn Fn(Point) -> Point, p: Point, sx: f64, sy: f64) -> Option<[f64; 4]> { + const H: f64 = 1e-4; + let (o, px, py) = (f(p), f(Point::new(p.x + H, p.y)), f(Point::new(p.x, p.y + H))); + let j = [(px.x - o.x) / H, (py.x - o.x) * sx / (H * sy), (px.y - o.y) * sy / (H * sx), (py.y - o.y) / H]; + let det = j[0] * j[3] - j[1] * j[2]; + (j.iter().all(|v| v.is_finite()) && det.is_finite() && det.abs() > 1e-9).then_some(j) +} + +/// A linear gradient from `start` to `end` (normalized, on the corrected frame) on the photo: +/// its start moves through `f`, and its direction and length follow the local linear part, so +/// its bands (lines at right angles to it) land on the same content. The end moves through `f` +/// alone where that part isn't defined. +fn attach_linear(start: Point, end: Point, f: &dyn Fn(Point) -> Point, sx: f64, sy: f64) -> (Point, Point) { + let (a, plain_end) = (f(start), f(end)); + let mid = Point::new((start.x + end.x) / 2.0, (start.y + end.y) / 2.0); + let Some([ja, jb, jc, jd]) = jacobian(f, mid, sx, sy) else { return (a, plain_end) }; + // the bands are level sets of (p - start)·d / |d|²: through J they keep that form with the + // normal J^-T d, and the same |d|² sets the length + let d = ((end.x - start.x) * sx, (end.y - start.y) * sy); + let det = ja * jd - jb * jc; + let n = ((jd * d.0 - jc * d.1) / det, (-jb * d.0 + ja * d.1) / det); + let (dd, nn) = (d.0 * d.0 + d.1 * d.1, n.0 * n.0 + n.1 * n.1); + if !(dd.is_finite() && nn.is_finite()) || nn < 1e-18 { + return (a, plain_end); + } + let k = dd / nn; + let e = Point::new(a.x + n.0 * k / sx, a.y + n.1 * k / sy); + if e.x.is_finite() && e.y.is_finite() { (a, e) } else { (a, plain_end) } +} + +/// An ellipse of radii `rx`, `ry` (long-edge units) turned by `angle` degrees, through the linear +/// map `j` (long-edge units): the radii and angle of the ellipse it becomes, `rx` staying the +/// radius along the image of the old `rx` axis. `None` when the result isn't usable. +fn attach_ellipse(j: [f64; 4], rx: f64, ry: f64, angle: f64) -> Option<(f64, f64, f64)> { + let (s, c) = angle.to_radians().sin_cos(); + // M = J · R(angle) · diag(rx, ry): its columns are the images of the two semi-axes + let m = [(j[0] * c + j[1] * s) * rx, (j[1] * c - j[0] * s) * ry, (j[2] * c + j[3] * s) * rx, (j[3] * c - j[2] * s) * ry]; + // the new ellipse's axes: eigenvectors of M Mᵀ, its radii the square roots of the eigenvalues + let (p, q, r) = (m[0] * m[0] + m[1] * m[1], m[0] * m[2] + m[1] * m[3], m[2] * m[2] + m[3] * m[3]); + let (half, det) = ((p + r) / 2.0, p * r - q * q); + let root = (half * half - det).max(0.0).sqrt(); + let (l1, l2) = (half + root, (half - root).max(0.0)); + let v1 = if q.abs() > 1e-15 * (p.abs() + r.abs()) { + let (x, y) = (q, l1 - p); + let n = x.hypot(y); + (x / n, y / n) + } else if p >= r { + (1.0, 0.0) + } else { + (0.0, 1.0) + }; + let v2 = (-v1.1, v1.0); + // the old rx axis, mapped + let a = (m[0], m[2]); + let along1 = (a.0 * v1.0 + a.1 * v1.1).abs() >= (a.0 * v2.0 + a.1 * v2.1).abs(); + let (axis, nrx, nry) = if along1 { (v1, l1.sqrt(), l2.sqrt()) } else { (v2, l2.sqrt(), l1.sqrt()) }; + // (pointing the way the old axis went) + let axis = if axis.0 * a.0 + axis.1 * a.1 < 0.0 { (-axis.0, -axis.1) } else { axis }; + let na = axis.1.atan2(axis.0).to_degrees(); + (nrx.is_finite() && nry.is_finite() && na.is_finite() && nrx > 0.0 && nry > 0.0).then_some((nrx, nry, na)) +} + +/// Follow `turn` (the change of the user orientation, e.g. a quarter turn clockwise): mask +/// coordinates are on the oriented photo, so they turn with it. Radial angles turn by the same +/// quarter turns; sizes (long-edge units) don't change. +pub fn turn(m: &mut Mask, turn: Orientation) { + if turn == Orientation::Normal { + return; + } + let fwd = |p: Point| { + let (x, y) = turn.map(p.x, p.y, 1.0, 1.0); + Point::new(x, y) + }; + let inv = turn.inverse(); + let back = |p: Point| { + let (x, y) = inv.map(p.x, p.y, 1.0, 1.0); + Point::new(x, y) + }; + let (flip, quarters) = turn.to_parts(); + // a radial's angle is clockwise on screen: a quarter turn clockwise adds 90°; a mirror negates it first + let delta = 90.0 * quarters as f64; + if flip { + for c in &mut m.components { + if let MaskShape::Radial { angle, .. } = &mut c.shape { + *angle = -*angle; + } + } + } + remap(m, &fwd, &back, delta, true); +} + +/// Move every place `m` stores: `fwd` maps an old point to the new frame, `back` a new point to +/// the old one (for resampling segmentations); radial angles change by `delta` degrees. With +/// `gradients` false, linear and radial gradients are left to the caller. +fn remap(m: &mut Mask, fwd: &dyn Fn(Point) -> Point, back: &dyn Fn(Point) -> Point, delta: f64, gradients: bool) { + for c in &mut m.components { + match &mut c.shape { + MaskShape::Linear { start, end } if gradients => { + *start = fwd(*start); + *end = fwd(*end); + } + MaskShape::Radial { center, angle, .. } if gradients => { + *center = fwd(*center); + if delta != 0.0 { + // (kept within −180..180°) + *angle = (*angle + delta + 180.0).rem_euclid(360.0) - 180.0; + } + } + MaskShape::Linear { .. } | MaskShape::Radial { .. } => {} + MaskShape::Brush { strokes } => { + for s in strokes { + s.points.iter_mut().for_each(|p| *p = fwd(*p)); + } + } + MaskShape::Object { hint, exclude, seg, detail, .. } => { + hint.iter_mut().chain(exclude.iter_mut()).for_each(|p| *p = fwd(*p)); + remap_segs(seg, detail, fwd, back); + } + MaskShape::Prompt { seg, detail, .. } => remap_segs(seg, detail, fwd, back), + // computed from the photo at each render (its mattes follow the warp), or colours, + // tones and depths, which have no place (a colour range's samples are colours) + MaskShape::Subject + | MaskShape::Sky + | MaskShape::Background + | MaskShape::People { .. } + | MaskShape::Landscape { .. } + | MaskShape::ColorRange { .. } + | MaskShape::LuminanceRange { .. } + | MaskShape::DepthRange { .. } => {} + } + } +} + +/// A stored selection and its zoomed-in passes, resampled onto the new frame. Where a pass's new +/// box reaches past what it covered, it takes the whole-photo selection there (what the render +/// showed), not a copy of its own edge. +fn remap_segs(seg: &mut Option, detail: &mut [SegMask], fwd: &dyn Fn(Point) -> Point, back: &dyn Fn(Point) -> Point) { + let coarse = seg.as_ref().and_then(SegGrid::new); + for d in detail.iter_mut() { + if let Some(m) = moved(d, fwd, back, coarse.as_ref()) { + *d = m; + } + } + if let Some(s) = seg.as_ref() + && let Some(m) = moved(s, fwd, back, None) + { + *seg = Some(m); + } +} + +/// Points along each edge of a box [`map_rect`] maps: a lens warp bends an edge between its ends, +/// most where it crosses the centre lines. +const RECT_EDGE_SAMPLES: usize = 16; + +/// The box around `r` mapped by `f` (points along its edges), inside 0..1. +fn map_rect(r: [f64; 4], f: &dyn Fn(Point) -> Point) -> [f64; 4] { + let (mut x0, mut y0, mut x1, mut y1) = (f64::MAX, f64::MAX, f64::MIN, f64::MIN); + for i in 0..=RECT_EDGE_SAMPLES { + let t = i as f64 / RECT_EDGE_SAMPLES as f64; + let (x, y) = (r[0] + t * (r[2] - r[0]), r[1] + t * (r[3] - r[1])); + for q in [(x, r[1]), (x, r[3]), (r[0], y), (r[2], y)] { + let p = f(Point::new(q.0, q.1)); + if p.x.is_finite() && p.y.is_finite() { + (x0, y0, x1, y1) = (x0.min(p.x), y0.min(p.y), x1.max(p.x), y1.max(p.y)); + } + } + } + if x0 > x1 || y0 > y1 { + return r; + } + [x0.clamp(0.0, 1.0), y0.clamp(0.0, 1.0), x1.clamp(0.0, 1.0), y1.clamp(0.0, 1.0)] +} + +/// Segmentation `s` resampled onto the new frame: a grid of the same side over the mapped box +/// (the whole image for a whole-image one), each cell taking the old logit at its centre mapped +/// back. A cell whose centre maps back outside what `s` covered takes `outside`'s logit there +/// (for a zoomed-in pass: the whole-photo selection), else selects nothing. `None` when the data +/// is damaged (it is kept as it is). +fn moved(s: &SegMask, fwd: &dyn Fn(Point) -> Point, back: &dyn Fn(Point) -> Point, outside: Option<&SegGrid>) -> Option { + let old = SegGrid::new(s)?; + let side = s.side as usize; + let rect = match s.rect { + None => None, + Some(r) => Some(map_rect(r, fwd)).filter(|b| b[2] > b[0] && b[3] > b[1]), + }; + let b = rect.unwrap_or([0.0, 0.0, 1.0, 1.0]); + let logits: Vec = (0..side * side) + .map(|i| { + let (x, y) = ((i % side) as f64 + 0.5, (i / side) as f64 + 0.5); + let n = Point::new(b[0] + x / side as f64 * (b[2] - b[0]), b[1] + y / side as f64 * (b[3] - b[1])); + let o = back(n); + if old.contains(o) { old.logit(o) } else { outside.map_or(-16.0, |g| g.logit(o)) } + }) + .collect(); + Some(match rect { + Some(r) => SegMask::from_logits_in(side, &logits, r), + None => SegMask::from_logits(side, &logits), + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use lightcraft_develop::{BrushStroke, DevelopSettings, MaskComponent, MaskOp}; + + fn comp(shape: MaskShape) -> MaskComponent { + MaskComponent { name: None, op: MaskOp::Add, invert: false, shape } + } + + fn mask(shape: MaskShape) -> Mask { + Mask { components: vec![comp(shape)], ..Default::default() } + } + + fn seg_at(p: Point) -> SegMask { + const SIDE: usize = 32; + let l: Vec = (0..SIDE * SIDE) + .map(|i| { + let (x, y) = (((i % SIDE) as f64 + 0.5) / SIDE as f64, ((i / SIDE) as f64 + 0.5) / SIDE as f64); + if (x - p.x).hypot(y - p.y) < 0.08 { 8.0 } else { -8.0 } + }) + .collect(); + SegMask::from_logits(SIDE, &l) + } + + fn object_at(p: Point) -> MaskShape { + MaskShape::Object { hint: vec![p], exclude: Vec::new(), seg: Some(seg_at(p)), detail: Vec::new(), edge: 0.0 } + } + + /// The centre of what `s` selects (sampled on a fine grid). + fn centre_of(s: &SegMask) -> Point { + let g = SegGrid::new(s).unwrap(); + let (mut sx, mut sy, mut n) = (0.0, 0.0, 0.0); + for i in 0..200 * 200 { + let p = Point::new(((i % 200) as f64 + 0.5) / 200.0, ((i / 200) as f64 + 0.5) / 200.0); + if g.contains(p) && g.logit(p) > 0.0 { + (sx, sy, n) = (sx + p.x, sy + p.y, n + 1.0); + } + } + assert!(n > 0.0, "nothing selected"); + Point::new(sx / n, sy / n) + } + + fn seg_of(m: &Mask, i: usize) -> &SegMask { + match &m.components[i].shape { + MaskShape::Object { seg: Some(s), .. } => s, + other => panic!("{other:?}"), + } + } + + #[test] + fn a_quarter_turn_turns_every_place_a_mask_keeps() { + let p = Point::new(0.2, 0.3); + let mut m = mask(MaskShape::Radial { center: p, rx: 0.1, ry: 0.05, angle: 10.0, feather: 50.0, invert: false }); + m.components.push(comp(MaskShape::Brush { strokes: vec![BrushStroke { points: vec![p], ..Default::default() }] })); + m.components.push(comp(object_at(p))); + turn(&mut m, Orientation::Rotate90); + // a quarter turn clockwise: (x, y) → (1 − y, x) + let want = Point::new(0.7, 0.2); + let MaskShape::Radial { center, angle, .. } = &m.components[0].shape else { panic!() }; + assert!((center.x - want.x).abs() < 1e-9 && (center.y - want.y).abs() < 1e-9, "{center:?}"); + assert_eq!(*angle, 100.0); + let MaskShape::Brush { strokes } = &m.components[1].shape else { panic!() }; + assert!((strokes[0].points[0].x - want.x).abs() < 1e-9); + let MaskShape::Object { hint, .. } = &m.components[2].shape else { panic!() }; + assert!((hint[0].x - want.x).abs() < 1e-9 && (hint[0].y - want.y).abs() < 1e-9, "{hint:?}"); + let c = centre_of(seg_of(&m, 2)); + assert!((c.x - want.x).abs() < 0.04 && (c.y - want.y).abs() < 0.04, "{c:?}"); + // and back + turn(&mut m, Orientation::Rotate270); + let MaskShape::Radial { center, angle, .. } = &m.components[0].shape else { panic!() }; + assert!((center.x - p.x).abs() < 1e-9 && (center.y - p.y).abs() < 1e-9 && *angle == 10.0); + } + + #[test] + fn attaching_an_old_mask_keeps_where_it_renders() { + let mut s = DevelopSettings::default(); + s.geometry.vertical = 30.0; + s.geometry.rotate = 5.0; + let frame = Frame::new(300, 200, &s, false); + let p = Point::new(0.3, 0.4); + let mut m = mask(MaskShape::Linear { start: p, end: Point::new(0.6, 0.4) }); + m.components.push(comp(object_at(p))); + m.on_photo = false; + attach(&mut m, &frame); + assert!(m.on_photo); + let on = frame.for_mask(true); + let MaskShape::Linear { start, .. } = &m.components[0].shape else { panic!() }; + let back = on.mask_to_norm(*start); + assert!((back.x - p.x).abs() < 1e-6 && (back.y - p.y).abs() < 1e-6, "{back:?}"); + assert!((start.x - p.x).hypot(start.y - p.y) > 0.005, "the warp moved it on the photo: {start:?}"); + let c = on.mask_to_norm(centre_of(seg_of(&m, 1))); + assert!((c.x - p.x).abs() < 0.04 && (c.y - p.y).abs() < 0.04, "{c:?}"); + // attaching again changes nothing + let before = m.clone(); + attach(&mut m, &frame); + assert_eq!(m, before); + } + + #[test] + fn damaged_or_hostile_masks_move_without_a_panic() { + let mut m = + mask(MaskShape::Radial { center: Point::new(f64::NAN, f64::INFINITY), rx: 0.1, ry: 0.1, angle: f64::NAN, feather: 0.0, invert: false }); + m.components.push(comp(MaskShape::Object { + hint: vec![Point::new(1e300, -1e300)], + exclude: Vec::new(), + seg: Some(SegMask { side: 1024, data: "not base64".into(), rect: Some([f64::NAN, 0.0, 2.0, -1.0]) }), + detail: vec![SegMask { side: 0, data: String::new(), rect: None }], + edge: 0.0, + })); + m.on_photo = false; + let mut s = DevelopSettings::default(); + s.geometry.vertical = 80.0; + s.optics.distortion = 100.0; + attach(&mut m, &Frame::new(300, 200, &s, false)); + for o in [Orientation::Rotate90, Orientation::FlipH, Orientation::Rotate180] { + turn(&mut m, o); + } + assert!(m.on_photo); + } + + /// A Transform and lens warp strong enough to bend shapes across a gradient. + fn warped() -> DevelopSettings { + let mut s = DevelopSettings::default(); + s.geometry.vertical = 40.0; + s.geometry.horizontal = -25.0; + s.geometry.rotate = 8.0; + s.optics.distortion = 60.0; + s + } + + /// The mean and largest difference between mask `a` and `b` rendered under `s`. + fn alpha_diff(a: &Mask, b: &Mask, s: &DevelopSettings) -> (f32, f32) { + let frame = Frame::new(300, 200, s, true); + let (w, h) = frame.fit(300, 200); + let img = lightcraft_raster::Rgb32f::new(w, h); + let log_l = lightcraft_raster::Plane::new(w, h); + let pa = crate::masks::evaluate_one(a, &frame, w, h, &img, &log_l, 0.0, None); + let pb = crate::masks::evaluate_one(b, &frame, w, h, &img, &log_l, 0.0, None); + let d: Vec = pa.data.iter().zip(&pb.data).map(|(x, y)| (x - y).abs()).collect(); + (d.iter().sum::() / d.len().max(1) as f32, d.iter().copied().fold(0.0, f32::max)) + } + + /// An old gradient keeps its region when it goes onto the photo: its shape goes through the + /// warp's local linear part, not only its centre or ends (review of #3550). + #[test] + fn attaching_an_old_gradient_keeps_its_region() { + let s = warped(); + let frame = Frame::new(300, 200, &s, false); + for shape in [ + MaskShape::Radial { center: Point::new(0.3, 0.35), rx: 0.18, ry: 0.07, angle: 30.0, feather: 30.0, invert: false }, + MaskShape::Linear { start: Point::new(0.2, 0.25), end: Point::new(0.45, 0.6) }, + ] { + let mut old = mask(shape.clone()); + old.on_photo = false; + let mut on = old.clone(); + attach(&mut on, &frame); + // what moving the points alone would give + let mut naive = old.clone(); + naive.on_photo = true; + remap(&mut naive, &|p| frame.for_mask(true).norm_to_mask(p), &|p| frame.for_mask(true).mask_to_norm(p), 0.0, true); + let (mean, max) = alpha_diff(&old, &on, &s); + let (naive_mean, naive_max) = alpha_diff(&old, &naive, &s); + // (the warp isn't linear across the whole gradient: a little is left at its far edge) + assert!(mean < 0.01, "{shape:?}: mean {mean}, max {max}"); + assert!(naive_mean > 1.5 * mean && naive_max > 2.0 * max, "{shape:?}: points alone {naive_mean} / {naive_max} vs {mean} / {max}"); + } + } + + /// Where a zoomed-in pass's new box reaches past what it covered (a turned box's corners), it + /// takes the whole-photo selection: neither a copy of its own edge (a negative whole-photo + /// selection) nor a fixed "unselected" (a positive one) (review of #3550). + #[test] + fn a_moved_detail_pass_takes_the_whole_selection_past_its_own_area() { + const SIDE: usize = 16; + let mut s = DevelopSettings::default(); + s.geometry.rotate = 20.0; + let frame = Frame::new(300, 200, &s, false); + for whole in [8.0f32, -8.0] { + let detail = SegMask::from_logits_in(SIDE, &[8.0; SIDE * SIDE], [0.4, 0.4, 0.6, 0.6]); + let coarse = SegMask::from_logits(SIDE, &[whole; SIDE * SIDE]); + let mut m = + mask(MaskShape::Object { hint: vec![Point::new(0.5, 0.5)], exclude: Vec::new(), seg: Some(coarse), detail: vec![detail], edge: 0.0 }); + m.on_photo = false; + attach(&mut m, &frame); + let MaskShape::Object { detail, .. } = &m.components[0].shape else { panic!() }; + let g = SegGrid::new(&detail[0]).unwrap(); + let b = detail[0].bounds().unwrap(); + // a corner of the new box is outside the turned patch: the whole-photo selection's sign + let inset = |t: f64| Point::new(b[0] + t * (b[2] - b[0]), b[1] + t * (b[3] - b[1])); + let corner = g.logit(inset(0.03)); + assert!((corner > 0.0) == (whole > 0.0), "whole {whole}: corner {corner}"); + assert!(g.logit(inset(0.5)) > 0.0, "whole {whole}: the patch itself stays selected"); + } + } + + /// The box around a mapped rectangle holds the whole bent edge, also off the centre lines + /// (review of #3550). + #[test] + fn a_mapped_box_holds_its_bent_edges() { + let mut s = DevelopSettings::default(); + s.optics.distortion = -80.0; + let f = Frame::new(300, 200, &s, false).for_mask(true).into_owned(); + let fwd = |p: Point| f.norm_to_mask(p); + let r = [0.2, 0.1, 0.9, 0.4]; + let b = map_rect(r, &fwd); + let (mut x0, mut y0, mut x1, mut y1) = (f64::MAX, f64::MAX, f64::MIN, f64::MIN); + for i in 0..=2000 { + let t = i as f64 / 2000.0; + let (x, y) = (r[0] + t * (r[2] - r[0]), r[1] + t * (r[3] - r[1])); + for q in [(x, r[1]), (x, r[3]), (r[0], y), (r[2], y)] { + let p = fwd(Point::new(q.0, q.1)); + (x0, y0, x1, y1) = (x0.min(p.x), y0.min(p.y), x1.max(p.x), y1.max(p.y)); + } + } + let want = [x0.clamp(0.0, 1.0), y0.clamp(0.0, 1.0), x1.clamp(0.0, 1.0), y1.clamp(0.0, 1.0)]; + for k in 0..4 { + assert!((b[k] - want[k]).abs() < 5e-4, "{b:?} vs {want:?}"); + } + } +} diff --git a/crates/pipeline/src/masks.rs b/crates/pipeline/src/masks.rs index ca182ea81dd..097e080a7e1 100644 --- a/crates/pipeline/src/masks.rs +++ b/crates/pipeline/src/masks.rs @@ -152,6 +152,8 @@ pub fn evaluate(masks: &[Mask], frame: &Frame, w: usize, h: usize, img: &Rgb32f, /// scaled by its amount. #[allow(clippy::too_many_arguments)] pub fn evaluate_one(m: &Mask, frame: &Frame, w: usize, h: usize, img: &Rgb32f, log_l: &Plane, ev: f32, mattes: Option<&Mattes>) -> Plane { + // its coordinates on the photo before the warp, or (an old mask) on the corrected frame + let frame = &*frame.for_mask(m.on_photo); let mut alpha = Plane::new(w, h); let mut first = true; for comp in &m.components { @@ -195,7 +197,7 @@ pub fn evaluate_one(m: &Mask, frame: &Frame, w: usize, h: usize, img: &Rgb32f, l /// Per-pixel positions in long-edge units for output pixel centres. fn for_each_pos(frame: &Frame, w: usize, h: usize, out: &mut Plane, f: impl Fn(Point, usize) -> f32 + Sync + Send) { - let m = frame.out_to_norm(w, h); + let m = frame.out_to_mask(w, h); let (ow, oh, l) = (frame.ow, frame.oh, frame.ow.max(frame.oh)); for_rows(&mut out.data, w, |y, row| { for (x, v) in row.iter_mut().enumerate() { @@ -266,7 +268,7 @@ pub fn shape_alpha(shape: &MaskShape, frame: &Frame, w: usize, h: usize, img: &R MaskShape::Sky => { // Classical sky heuristic until the segmenter lands (M12): bright, smooth, blue-ish or // unsaturated, and connected to the top of the frame. - let m = frame.out_to_norm(w, h); + let m = frame.out_to_mask(w, h); for (i, v) in out.data.iter_mut().enumerate() { let (x, y) = (i % w, i / w); let n = m.apply(Point::new(x as f64 + 0.5, y as f64 + 0.5)); @@ -293,7 +295,7 @@ pub fn shape_alpha(shape: &MaskShape, frame: &Frame, w: usize, h: usize, img: &R MaskShape::Prompt { .. } => {} MaskShape::Subject | MaskShape::Object { .. } | MaskShape::People { .. } => { // Saliency heuristic: centre-weighted local contrast (replaced by the segmenter in M12). - let m = frame.out_to_norm(w, h); + let m = frame.out_to_mask(w, h); let blur = lightcraft_raster::blur::gaussian(log_l, 0.03 * frame_px(frame, w)); for (i, v) in out.data.iter_mut().enumerate() { let (x, y) = (i % w, i / w); @@ -315,24 +317,24 @@ pub fn shape_alpha(shape: &MaskShape, frame: &Frame, w: usize, h: usize, img: &R } /// A decoded [`SegMask`]: its logits and the normalized rectangle they cover. -struct SegGrid { +pub struct SegGrid { logits: Vec, side: usize, r: [f64; 4], } impl SegGrid { - fn new(seg: &SegMask) -> Option { + pub fn new(seg: &SegMask) -> Option { Some(SegGrid { logits: seg.logits()?, side: seg.side as usize, r: seg.bounds()? }) } - fn contains(&self, n: Point) -> bool { + pub fn contains(&self, n: Point) -> bool { n.x >= self.r[0] && n.x <= self.r[2] && n.y >= self.r[1] && n.y <= self.r[3] } /// The bilinearly sampled logit at normalized image point `n` (cell centres at /// `(i + 0.5) / side` of the rectangle). - fn logit(&self, n: Point) -> f32 { + pub fn logit(&self, n: Point) -> f32 { let side = self.side; let at = |x: usize, y: usize| self.logits.get(y.min(side - 1) * side + x.min(side - 1)).copied().unwrap_or(-16.0); let u = (n.x - self.r[0]) / (self.r[2] - self.r[0]); @@ -385,7 +387,7 @@ fn sample_seg(seg: Option<&SegMask>, detail: &[SegMask], gain: f32, frame: &Fram if coarse.is_none() && patches.is_empty() { return; } - let m = frame.out_to_norm(w, h); + let m = frame.out_to_mask(w, h); for_rows(&mut out.data, w, |y, row| { for (x, v) in row.iter_mut().enumerate() { let n = m.apply(Point::new(x as f64 + 0.5, y as f64 + 0.5)); @@ -571,7 +573,7 @@ pub fn brush_dabs(s: &BrushStroke, frame: &Frame, w: usize, h: usize) -> BrushDa /// Ask for one more than the threshold to tell "at it" from "past it": a result shorter than /// `max` is the whole stroke. pub fn brush_dabs_within(s: &BrushStroke, frame: &Frame, w: usize, h: usize, max: usize) -> BrushDabs { - let to_out = frame.norm_to_out(w, h); + let to_out = frame.mask_to_out(w, h); let ppl = frame.px_per_long(w); let r = (s.size * ppl).max(0.5); let hard = r * (1.0 - (s.feather / 100.0).clamp(0.0, 1.0)); @@ -588,7 +590,8 @@ pub fn brush_dabs_within(s: &BrushStroke, frame: &Frame, w: usize, h: usize, max if emitted >= max { break; } - let q = to_out.apply(*p); + // (a point the warp can't place lays no dab, rather than one at its unwarped place) + let Some(q) = to_out(*p) else { continue }; let before = dabs.len(); if push_dabs_within(&mut dabs, &mut emitted, prev, q, r, max) { let pq = s.pressure_at(i); diff --git a/crates/pipeline/src/optics.rs b/crates/pipeline/src/optics.rs index b0d7cc7f918..11789b8b55d 100644 --- a/crates/pipeline/src/optics.rs +++ b/crates/pipeline/src/optics.rs @@ -201,6 +201,39 @@ impl Warp { self.corrected_to_source(self.to_corrected(p), ch) } + /// Source px → transformed px (green plane): the inverse of [`Warp::to_source`], by Newton's + /// method on it (the warps are smooth and close to the identity, so a few steps reach a + /// hundredth of a pixel). `None` when it doesn't converge (a point far outside a strong warp). + pub fn from_source(&self, s: Point) -> Option { + if !(s.x.is_finite() && s.y.is_finite()) { + return None; + } + let f = |p: Point| self.to_source(p, 1); + // start from where the perspective alone puts it (the lens part moves pixels little) + let mut t = self.from_corrected(s); + let h = 1e-3 * self.w.max(self.h).max(1.0); + for _ in 0..24 { + let v = f(t); + let (ex, ey) = (v.x - s.x, v.y - s.y); + if !(ex.is_finite() && ey.is_finite()) { + return None; + } + if ex.abs() < 1e-4 && ey.abs() < 1e-4 { + return Some(t); + } + let (dx, dy) = (f(Point::new(t.x + h, t.y)), f(Point::new(t.x, t.y + h))); + let (a, c) = ((dx.x - v.x) / h, (dx.y - v.y) / h); + let (b, d) = ((dy.x - v.x) / h, (dy.y - v.y) / h); + let det = a * d - b * c; + if !det.is_finite() || det.abs() < 1e-12 { + return None; + } + t = Point::new(t.x - (d * ex - b * ey) / det, t.y - (a * ey - c * ex) / det); + } + let v = f(t); + ((v.x - s.x).abs() < 1e-2 && (v.y - s.y).abs() < 1e-2).then_some(t) + } + /// Vignetting compensation gain at source position `src` (px). pub fn gain(&self, src: Point) -> f32 { let mut g = 1.0; diff --git a/crates/pipeline/src/spots.rs b/crates/pipeline/src/spots.rs index a875ffb7fcb..0bd52f2c11b 100644 --- a/crates/pipeline/src/spots.rs +++ b/crates/pipeline/src/spots.rs @@ -161,17 +161,18 @@ pub fn window_for_reads_checked( win: crate::PixelWindow, ) -> Option { let spots = &s.spots; - let autos: Vec<&lightcraft_develop::BrushStroke> = s + // (with whether its mask's coordinates are on the photo before the warp) + let autos: Vec<(bool, &lightcraft_develop::BrushStroke)> = s .masks .iter() .filter(|m| m.visible) - .flat_map(|m| &m.components) - .filter_map(|c| match &c.shape { - lightcraft_develop::MaskShape::Brush { strokes } => Some(strokes), + .flat_map(|m| m.components.iter().map(move |c| (m.on_photo, c))) + .filter_map(|(on, c)| match &c.shape { + lightcraft_develop::MaskShape::Brush { strokes } => Some(strokes.iter().map(move |st| (on, st))), _ => None, }) .flatten() - .filter(|st| st.auto_mask) + .filter(|(_, st)| st.auto_mask) .collect(); if spots.is_empty() && autos.is_empty() { return Some(win); @@ -205,10 +206,10 @@ pub fn window_for_reads_checked( // Auto Mask strokes weigh each dab by its similarity to the pixel under the dab's centre and // refine the stroke over a couple of radii: each dab matters to pixels within 2.5 radii let mut dab_boxes: Vec<[f64; 4]> = Vec::new(); - for st in autos { + for (on_photo, st) in autos { // One more than the window takes, so a stroke past it is still recognised as past it // without the other 1.8 million dabs being built first (#1520). - let dabs = crate::masks::brush_dabs_within(st, frame, full_w, full_h, MAX_DABS_CONSIDERED + 1); + let dabs = crate::masks::brush_dabs_within(st, &frame.for_mask(on_photo), full_w, full_h, MAX_DABS_CONSIDERED + 1); let r = dabs.r; if dabs.dabs.len() > MAX_DABS_CONSIDERED { continue; diff --git a/crates/pipeline/src/tests_mask_geometry.rs b/crates/pipeline/src/tests_mask_geometry.rs new file mode 100644 index 00000000000..0a121711007 --- /dev/null +++ b/crates/pipeline/src/tests_mask_geometry.rs @@ -0,0 +1,216 @@ +//! Masks stay on the image content under every geometry change: a mask +//! drawn around a mark in the photo still brightens that mark after Straighten, a crop, a flip or +//! a lens / perspective warp, rendered fresh or through a view's stage cache. + +use std::sync::Arc; + +use lightcraft_develop::{BrushStroke, DevelopSettings, LocalAdjustments, Mask, MaskComponent, MaskOp, MaskShape, SegMask}; +use lightcraft_geom::{CropGeometry, Point, Rect}; +use lightcraft_raster::{Rgb32f, Rgba8}; + +use crate::{RenderRequest, SourceInfo, StageCache, render, render_cached}; + +const W: usize = 240; +const H: usize = 160; +/// Where the mark sits, normalized. +const MARK: (f64, f64) = (0.3, 0.32); + +/// Mid grey with a small bright mark at [`MARK`]. +fn marked(mark: bool) -> Rgb32f { + let (mx, my) = (MARK.0 * W as f64, MARK.1 * H as f64); + Rgb32f::from_fn(W, H, |x, y| { + let d = ((x as f64 + 0.5 - mx).powi(2) + (y as f64 + 0.5 - my).powi(2)).sqrt(); + if d < 2.5 && mark { [0.9; 3] } else { [0.05; 3] } + }) +} + +fn with_mask(shape: MaskShape) -> DevelopSettings { + let mut s = DevelopSettings::default(); + s.masks.push(Mask { + id: 1, + components: vec![MaskComponent { name: None, op: MaskOp::Add, invert: false, shape }], + adjust: LocalAdjustments { exposure: 2.0, ..Default::default() }, + ..Default::default() + }); + s +} + +fn radial() -> MaskShape { + let l = W.max(H) as f64; + // (radii in long-edge units) + MaskShape::Radial { center: Point::new(MARK.0, MARK.1), rx: 12.0 / l, ry: 12.0 / l, angle: 0.0, feather: 40.0, invert: false } +} + +/// An AI object selection (a stored segmentation) covering the mark. +fn subject() -> MaskShape { + const SIDE: usize = 64; + let logits: Vec = (0..SIDE * SIDE) + .map(|i| { + let (x, y) = ((i % SIDE) as f64 + 0.5, (i / SIDE) as f64 + 0.5); + let (dx, dy) = ((x / SIDE as f64 - MARK.0) * W as f64, (y / SIDE as f64 - MARK.1) * H as f64); + if (dx * dx + dy * dy).sqrt() < 10.0 { 8.0 } else { -8.0 } + }) + .collect(); + MaskShape::Object { + hint: vec![Point::new(MARK.0, MARK.1)], + exclude: Vec::new(), + seg: Some(SegMask::from_logits(SIDE, &logits)), + detail: Vec::new(), + edge: 0.0, + } +} + +fn luma(img: &Rgba8, i: usize) -> f64 { + let p = img.data[i]; + (p[0] as f64 + p[1] as f64 + p[2] as f64) / 3.0 +} + +/// The mark's centre in a render with `s` (where the marked photo differs from an unmarked one: +/// a warp leaves light blank canvas around the photo). +fn mark_at(s: &DevelopSettings) -> (f64, f64) { + let req = RenderRequest::fit(W, H); + let info = SourceInfo::default(); + let (a, b) = (render(&marked(true), &info, s, &req).image, render(&marked(false), &info, s, &req).image); + centroid(a.width, (0..a.data.len()).map(|i| (luma(&a, i) - luma(&b, i)).max(0.0))) +} + +fn centroid(w: usize, weights: impl Iterator) -> (f64, f64) { + let (mut sx, mut sy, mut n) = (0.0, 0.0, 0.0); + for (i, v) in weights.enumerate() { + sx += v * ((i % w) as f64 + 0.5); + sy += v * ((i / w) as f64 + 0.5); + n += v; + } + assert!(n > 0.0, "nothing found"); + (sx / n, sy / n) +} + +/// Where the mask brightened the render (`plain` is the same render without the mask). +fn mask_at(masked: &Rgba8, plain: &Rgba8) -> (f64, f64) { + centroid(masked.width, (0..masked.data.len()).map(|i| (luma(masked, i) - luma(plain, i)).max(0.0))) +} + +/// The geometry changes a user makes after drawing a mask. +pub(crate) fn geometries() -> Vec<(&'static str, Box)> { + vec![ + ("straighten", Box::new(|s: &mut DevelopSettings| s.crop.geometry = CropGeometry { rect: Rect::new(0.08, 0.1, 0.92, 0.9), angle: 7.0 })), + ( + "straighten the other way", + Box::new(|s: &mut DevelopSettings| s.crop.geometry = CropGeometry { rect: Rect::new(0.08, 0.1, 0.92, 0.9), angle: -9.0 }), + ), + ("crop", Box::new(|s: &mut DevelopSettings| s.crop.geometry.rect = Rect::new(0.1, 0.15, 0.7, 0.8))), + ("flip", Box::new(|s: &mut DevelopSettings| s.crop.flip_h = true)), + ("flip vertical", Box::new(|s: &mut DevelopSettings| s.crop.flip_v = true)), + ( + "perspective", + Box::new(|s: &mut DevelopSettings| { + s.geometry.vertical = 25.0; + s.geometry.rotate = 4.0; + }), + ), + ("distortion", Box::new(|s: &mut DevelopSettings| s.optics.distortion = 40.0)), + ( + // Rotate Right: the photo and its masks turn together (`photo.rotateRight`) + "quarter turn", + Box::new(|s: &mut DevelopSettings| { + let turn = lightcraft_geom::Orientation::Normal.rotated(true); + s.orientation = s.orientation.rotated(true); + for m in &mut s.masks { + crate::mask_space::turn(m, turn); + } + }), + ), + ] +} + +fn check(name: &str, shape: MaskShape) { + let src = Arc::new(marked(true)); + let req = RenderRequest::fit(W, H); + let info = SourceInfo::default(); + for (what, change) in geometries() { + let mut s = with_mask(shape.clone()); + // a view that rendered the photo before the change (its stage cache holds the mask) + let cache = StageCache::default(); + render_cached(&src, &info, &s, &req, &cache); + change(&mut s); + let plain = DevelopSettings { masks: Vec::new(), ..s.clone() }; + let p = render(&src, &info, &plain, &req).image; + let mark = mark_at(&plain); + for (how, m) in [("fresh", render(&src, &info, &s, &req).image), ("cached", render_cached(&src, &info, &s, &req, &cache).image)] { + let at = mask_at(&m, &p); + let d = ((at.0 - mark.0).powi(2) + (at.1 - mark.1).powi(2)).sqrt(); + assert!(d < 2.0, "{name} after {what} ({how}): the mask's effect is at {at:?}, the mark at {mark:?}"); + } + } +} + +#[test] +fn a_drawn_mask_stays_on_the_content_under_every_geometry_change() { + check("radial", radial()); +} + +fn brush() -> MaskShape { + let l = W.max(H) as f64; + MaskShape::Brush { + strokes: vec![BrushStroke { + points: vec![Point::new(MARK.0 - 0.005, MARK.1), Point::new(MARK.0 + 0.005, MARK.1)], + size: 8.0 / l, + ..Default::default() + }], + } +} + +#[test] +fn a_brushed_mask_stays_on_the_content_under_every_geometry_change() { + check("brush", brush()); +} + +/// A mask from before masks were on the photo keeps its place on the corrected frame: an old edit +/// renders as it did. +#[test] +fn an_old_mask_stays_where_it_was_drawn_on_the_corrected_frame() { + let src = Arc::new(marked(true)); + let req = RenderRequest::fit(W, H); + let info = SourceInfo::default(); + let mut s = with_mask(radial()); + s.masks[0].on_photo = false; + s.geometry.vertical = 25.0; + s.geometry.rotate = 6.0; + let unmasked = DevelopSettings { masks: Vec::new(), ..s.clone() }; + let plain = render(&src, &info, &unmasked, &req).image; + let at = mask_at(&render(&src, &info, &s, &req).image, &plain); + let frame = crate::geometry::Frame::new(W, H, &s, true); + let (w, h) = frame.fit(W, H); + let want = frame.norm_to_out(w, h).apply(Point::new(MARK.0, MARK.1)); + assert!((at.0 - want.x).hypot(at.1 - want.y) < 2.0, "{at:?} vs {want:?}"); + let mark = mark_at(&unmasked); + assert!((at.0 - mark.0).hypot(at.1 - mark.1) > 3.0, "and not on the mark, which the warp moved: {at:?} vs {mark:?}"); +} + +#[test] +fn an_ai_mask_stays_on_the_content_under_every_geometry_change() { + check("object", subject()); +} + +/// A brush point the warp can't place lays no dab, rather than one at its unwarped place, which +/// can be far from the stroke (review of #3550). +#[test] +fn a_brush_point_the_warp_cannot_place_lays_no_dab() { + let mut s = DevelopSettings::default(); + s.geometry.vertical = -100.0; + s.geometry.horizontal = -100.0; + s.optics.distortion = 100.0; + s.geometry.scale = 70.0; + let frame = crate::geometry::Frame::new(1000, 1500, &s, true).for_mask(true).into_owned(); + let (w, h) = frame.fit(1000, 1500); + let warp = frame.mask_warp().cloned().expect("a warp"); + // a point on the photo the inverse can't reach (found by search, so the test doesn't depend on + // the solver's exact limits) + let lost = (0..200 * 200) + .map(|i| Point::new((i % 200) as f64 / 199.0, (i / 200) as f64 / 199.0)) + .find(|p| warp.from_source(Point::new(p.x * frame.ow, p.y * frame.oh)).is_none()); + let lost = lost.expect("these settings leave points the inverse can't reach"); + let stroke = BrushStroke { points: vec![lost], size: 0.01, ..Default::default() }; + let dabs = crate::masks::brush_dabs_within(&stroke, &frame, w, h, 1000); + assert!(dabs.dabs.is_empty(), "{lost:?} laid {:?}", dabs.dabs); +} diff --git a/crates/ui-egui/src/panels/detail/geometry.rs b/crates/ui-egui/src/panels/detail/geometry.rs index d679010f175..b02c5eb9c1e 100644 --- a/crates/ui-egui/src/panels/detail/geometry.rs +++ b/crates/ui-egui/src/panels/detail/geometry.rs @@ -3,12 +3,17 @@ use super::info::label_badge_rect; use super::{Affine, Frame, LightcraftApp, PhotoId, Point, Pos2, Rect, Zoom, json, pos2, vec2}; /// Screen ↔ normalized-image mapping for the displayed frame. -#[derive(Clone, Copy)] +#[derive(Clone)] pub struct CanvasMap { pub(super) rect: Rect, to_norm: Affine, from_norm: Affine, k: f32, + /// The frame's lens / perspective warp (with the oriented size it works in), when it moves + /// pixels: a mask on the photo (`Mask::on_photo`) has its coordinates before it. + warp: Option>, + /// Whether `norm` / `screen` speak a mask's coordinates on the photo ([`CanvasMap::for_mask`]). + on_photo: bool, } impl CanvasMap { @@ -16,12 +21,47 @@ impl CanvasMap { let k = 8.0f32; let (w, h) = ((rect.width() * k).round().max(1.0) as usize, (rect.height() * k).round().max(1.0) as usize); let to_norm = frame.out_to_norm(w, h); - CanvasMap { rect, to_norm, from_norm: to_norm.inverse().unwrap_or(Affine::IDENTITY), k } + let warp = frame.warp.as_ref().filter(|w| w.moves_pixels()).map(|w| std::sync::Arc::new((w.clone(), frame.ow, frame.oh))); + CanvasMap { rect, to_norm, from_norm: to_norm.inverse().unwrap_or(Affine::IDENTITY), k, warp, on_photo: false } + } + /// The mapping for a mask's coordinates: on the photo before lens corrections, Upright and + /// Transform (`on_photo`, every mask made now), or an old mask's on the corrected frame. + pub(crate) fn for_mask(&self, on_photo: bool) -> CanvasMap { + CanvasMap { on_photo, ..self.clone() } + } + /// Whether `norm` / `screen` go through a lens or perspective warp (a mask's coordinates on a + /// warped photo). + pub(crate) fn warped(&self) -> bool { + self.on_photo && self.warp.is_some() + } + /// [`Self::for_mask`] for the mask `id` of `d` (none, or a new mask: on the photo). + pub(crate) fn for_mask_id(&self, d: &lightcraft_develop::DevelopSettings, id: Option) -> CanvasMap { + self.for_mask(id.and_then(|id| d.masks.iter().find(|m| m.id == id)).is_none_or(|m| m.on_photo)) } pub fn norm(&self, p: Pos2) -> Point { - self.to_norm.apply(Point::new(((p.x - self.rect.left()) * self.k) as f64, ((p.y - self.rect.top()) * self.k) as f64)) + let n = self.to_norm.apply(Point::new(((p.x - self.rect.left()) * self.k) as f64, ((p.y - self.rect.top()) * self.k) as f64)); + match self.warp.as_deref().filter(|_| self.on_photo) { + Some((w, ow, oh)) => { + let s = w.to_source(Point::new(n.x * ow, n.y * oh), 1); + Point::new(s.x / ow, s.y / oh) + } + None => n, + } } pub fn screen(&self, n: Point) -> Pos2 { + self.try_screen(n).unwrap_or_else(|| self.place(n)) + } + /// [`Self::screen`], or `None` where the warp can't be undone at `n` (a point a strong + /// warp folds away), for drawing that must not join such a point to its neighbours. + pub(crate) fn try_screen(&self, n: Point) -> Option { + let n = match self.warp.as_deref().filter(|_| self.on_photo) { + Some((w, ow, oh)) => w.from_source(Point::new(n.x * ow, n.y * oh)).map(|t| Point::new(t.x / ow, t.y / oh))?, + None => n, + }; + Some(self.place(n)) + } + /// A point on the displayed frame (normalized) on screen. + fn place(&self, n: Point) -> Pos2 { let q = self.from_norm.apply(n); pos2(self.rect.left() + q.x as f32 / self.k, self.rect.top() + q.y as f32 / self.k) } @@ -383,3 +423,96 @@ mod snap_tests { assert_eq!((bad.width(), bad.height()), (1088.0, 720.0)); } } + +#[cfg(test)] +mod mask_map_tests { + use super::*; + use lightcraft_develop::DevelopSettings; + + fn close(a: Point, b: Point) -> bool { + (a.x - b.x).abs() < 1e-4 && (a.y - b.y).abs() < 1e-4 + } + + /// Under a perspective warp, a mask's on-screen place goes into its coordinates on the photo + /// (`Mask::on_photo`) and back: the point clicked is the point the render puts the mask on, and + /// its handle draws where it was clicked. + #[test] + fn a_mask_drawn_on_a_warped_photo_lands_on_the_content_under_the_pointer() { + let mut d = DevelopSettings::default(); + d.geometry.vertical = 30.0; + d.geometry.rotate = 5.0; + let frame = Frame::new(400, 300, &d, true); + let m = CanvasMap::new(&frame, Rect::from_min_size(pos2(100.0, 50.0), vec2(400.0, 300.0))); + let q = pos2(220.0, 140.0); + let on = m.for_mask(true).norm(q); + let plain = m.for_mask(false).norm(q); + assert!(!close(on, plain), "the warp moves the photo under the frame: {on:?} {plain:?}"); + // the render maps the mask's coordinates through the warp to the same frame point + assert!(close(frame.for_mask(true).mask_to_norm(on), plain)); + assert!((m.for_mask(true).screen(on) - q).length() < 0.01, "and its handle draws there"); + // a new mask (no id) and a mask of today are on the photo; an old one isn't + let mut d = d.clone(); + d.masks.push(lightcraft_develop::Mask { id: 7, on_photo: false, ..Default::default() }); + assert!(close(m.for_mask_id(&d, None).norm(q), on)); + assert!(close(m.for_mask_id(&d, Some(7)).norm(q), plain)); + } + + /// A linear gradient's guides on a warped photo follow its bands through the warp: every + /// point drawn is on the band through the gradient's start or end (review of #3550). + #[test] + fn a_linear_gradients_guides_follow_the_warp() { + let mut d = DevelopSettings::default(); + d.geometry.vertical = 35.0; + d.optics.distortion = 50.0; + let frame = Frame::new(400, 300, &d, true); + let m = CanvasMap::new(&frame, Rect::from_min_size(pos2(100.0, 50.0), vec2(400.0, 300.0))).for_mask(true); + assert!(m.warped()); + let (start, end) = (Point::new(0.3, 0.3), Point::new(0.5, 0.6)); + // (long-edge units: the frame is 400 × 300) + let (sx, sy) = (1.0, 0.75); + let dd = ((end.x - start.x) * sx, (end.y - start.y) * sy); + let t = |q: Point| ((q.x - start.x) * sx * dd.0 + (q.y - start.y) * sy * dd.1) / (dd.0 * dd.0 + dd.1 * dd.1); + for (at, want) in [(start, 0.0), (end, 1.0)] { + let guide: Vec = super::super::masks::linear_guide(&m, start, end, at).concat(); + assert!(guide.len() > 2, "drawn in steps"); + let inside: Vec<&Pos2> = guide.iter().filter(|g| m.rect.expand(-2.0).contains(**g)).collect(); + assert!(inside.len() > 2, "the guide crosses the canvas: {}", inside.len()); + for g in inside { + let got = t(m.norm(*g)); + assert!((got - want).abs() < 1e-3, "{g:?}: band {got}, want {want}"); + } + } + } + + /// A guide is cut where a sample can't go through the warp, so no line joins a warped point + /// to an unwarped one (review of #3550). + #[test] + fn a_guide_breaks_where_the_warp_cant_be_undone() { + let (a, b, c) = (pos2(1.0, 1.0), pos2(2.0, 2.0), pos2(3.0, 3.0)); + let runs = super::super::masks::runs([Some(a), Some(b), None, Some(c), None, None, Some(a), Some(b)]); + assert_eq!(runs, vec![vec![a, b], vec![a, b]], "single points are dropped, the rest split"); + assert!(super::super::masks::runs([None, Some(a), None]).is_empty()); + // a chord far longer than the usual step (across a fold) cuts the run too + let line: Vec = (0..10).map(|i| pos2(i as f32, 0.0)).chain((0..10).map(|i| pos2(200.0 + i as f32, 0.0))).collect(); + let cut = super::super::masks::split_jumps(vec![line]); + assert_eq!(cut.len(), 2, "{cut:?}"); + assert!(cut.iter().all(|r| r.len() == 10)); + } + + /// A guide through an end far off the photo still crosses the canvas (review of #3550). + #[test] + fn a_guide_through_an_end_off_the_photo_still_crosses_it() { + let mut d = DevelopSettings::default(); + d.geometry.vertical = 35.0; + d.optics.distortion = 50.0; + let frame = Frame::new(400, 300, &d, true); + let m = CanvasMap::new(&frame, Rect::from_min_size(pos2(100.0, 50.0), vec2(400.0, 300.0))).for_mask(true); + // a gradient drawn off the photo's right side (start and end both there): its guides are + // horizontal and cross the photo from 2.5 photo widths away + let (start, end) = (Point::new(3.5, 0.4), Point::new(3.5, 0.6)); + for at in [start, end] { + let guide: Vec = super::super::masks::linear_guide(&m, start, end, at).concat(); + assert!(guide.iter().filter(|g| m.rect.expand(-2.0).contains(**g)).count() > 2, "{at:?}: the guide crosses the canvas"); + } + } +} diff --git a/crates/ui-egui/src/panels/detail/masks.rs b/crates/ui-egui/src/panels/detail/masks.rs index d8e789b7a0f..2150d513b87 100644 --- a/crates/ui-egui/src/panels/detail/masks.rs +++ b/crates/ui-egui/src/panels/detail/masks.rs @@ -324,6 +324,8 @@ pub(super) fn mask_overlay(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &eg } for m in &d.masks { let sel = Some(m.id) == active; + // (its coordinates on the photo, or an old mask's on the corrected frame) + let map = &map.for_mask(m.on_photo); // Ctrl+Shift+O (`mask_overlay_all`) shows every visible mask's region; outline each one // too, not just the selected mask. Handles and the rotation grip stay on the selected // mask so nothing else becomes draggable. The component check keeps this in step with the @@ -416,11 +418,11 @@ fn component_outline( } MaskShape::Linear { start, end } => { let (a, b) = (map.screen(*start), map.screen(*end)); - let dir = (b - a).normalized(); - let perp = vec2(-dir.y, dir.x) * 3000.0; let (a1, a2): (u8, u8) = if sel { (230, 110) } else { (170, 80) }; - for (q, alpha) in [(a, a1), (b, a2)] { - p.line_segment([q - perp, q + perp], Stroke::new(1.0, Color32::from_white_alpha(alpha))); + for (at, alpha) in [(*start, a1), (*end, a2)] { + for run in linear_guide(map, *start, *end, at) { + p.add(egui::Shape::line(run, Stroke::new(1.0, Color32::from_white_alpha(alpha)))); + } } if sel { for (i, q) in [a, b].iter().enumerate() { @@ -434,11 +436,96 @@ fn component_outline( } } +/// A linear gradient's guide through `at` (its start or end): the line at right angles to it, as +/// screen points. In a mask's coordinates on the photo, a lens or perspective warp bends and +/// turns it on screen, so it is drawn through the warp in steps; else it is a straight line. +pub(super) fn linear_guide(map: &CanvasMap, start: Point, end: Point, at: Point) -> Vec> { + let (a, b) = (map.screen(start), map.screen(end)); + if !map.warped() { + let dir = (b - a).normalized(); + let perp = vec2(-dir.y, dir.x) * 3000.0; + let q = map.screen(at); + return vec![vec![q - perp, q + perp]]; + } + // in long-edge units the perpendicular is a right angle; it spans the whole photo + let l = frame_long_norm(map); + let d = ((end.x - start.x) / l.0, (end.y - start.y) / l.1); + let n = d.0.hypot(d.1); + if !(n.is_finite() && n > 1e-12) { + return Vec::new(); + } + let perp = (-d.1 / n * l.0, d.0 / n * l.1); + // from where the line enters the photo to where it leaves it (with a margin), measured from + // `at`, so a guide whose end lies off the photo still reaches it + let pp = perp.0 * perp.0 + perp.1 * perp.1; + let ts = [(0.0, 0.0), (1.0, 0.0), (0.0, 1.0), (1.0, 1.0)].map(|(x, y)| ((x - at.x) * perp.0 + (y - at.y) * perp.1) / pp); + let (lo, hi) = ts.iter().fold((f64::INFINITY, f64::NEG_INFINITY), |(lo, hi), t| (lo.min(*t), hi.max(*t))); + let pad = 0.1 * (hi - lo); + let (lo, hi) = (lo - pad, hi + pad); + if !(lo.is_finite() && hi.is_finite() && hi > lo) { + return Vec::new(); + } + // 48 steps across about a photo's width, at most 256 + let steps = ((hi - lo) * 16.0).ceil().clamp(48.0, 256.0) as usize; + split_jumps(runs((0..=steps).map(|i| { + let t = lo + (hi - lo) * i as f64 / steps as f64; + map.try_screen(Point::new(at.x + perp.0 * t, at.y + perp.1 * t)) + }))) +} + +/// `runs` cut again where a step is far longer than the run's usual one: a strong warp can fold +/// the line, and a chord across the fold isn't part of it. +pub(super) fn split_jumps(runs: Vec>) -> Vec> { + let mut out = Vec::new(); + for run in runs { + let mut steps: Vec = run.windows(2).filter_map(|w| Some(w.first()?.distance(*w.get(1)?))).collect(); + steps.sort_by(f32::total_cmp); + let usual = steps.get(steps.len() / 2).copied().unwrap_or(0.0); + let limit = (8.0 * usual).max(2.0); + let mut cur: Vec = Vec::new(); + for q in run { + if cur.last().is_some_and(|p: &Pos2| p.distance(q) > limit) { + if cur.len() >= 2 { + out.push(std::mem::take(&mut cur)); + } + cur.clear(); + } + cur.push(q); + } + if cur.len() >= 2 { + out.push(cur); + } + } + out +} + +/// The unbroken runs (two points or more) of a sampled line whose missing samples (`None`) cut it. +pub(super) fn runs(samples: impl IntoIterator>) -> Vec> { + let mut out: Vec> = Vec::new(); + let mut cur: Vec = Vec::new(); + for s in samples { + match s { + Some(q) => cur.push(q), + None => { + if cur.len() >= 2 { + out.push(std::mem::take(&mut cur)); + } + cur.clear(); + } + } + } + if cur.len() >= 2 { + out.push(cur); + } + out +} + /// Object selections (SAM 3) of the selected mask: each click, green to include, red to exclude /// (clicks still on their way to the model included). fn object_marks(app: &LightcraftApp, p: &egui::Painter, map: &CanvasMap, d: &DevelopSettings, active: Option) { let pending = app.session.segmenter.pending_clicks().cloned(); for m in d.masks.iter().filter(|m| Some(m.id) == active) { + let map = &map.for_mask(m.on_photo); for (k, c) in m.components.iter().enumerate() { if let MaskShape::Object { hint, exclude, .. } = &c.shape { let (hint, exclude) = match pending.as_ref().filter(|q| (q.mask, q.comp) == (m.id, k)) { @@ -503,7 +590,8 @@ fn object_tool( if own_pin_at(grips, app.session.active_mask, q) { return; } - let n = map.norm(q); + // (a click goes into the selected mask, or a new one: in its coordinates) + let n = map.for_mask_id(d, app.session.active_mask).norm(q); let exclude = ui.input(|i| i.modifiers.alt); match app.run_typed("mask.objectPoint", json!({"x": n.x, "y": n.y, "exclude": exclude})) { Ok(_) => { @@ -527,6 +615,8 @@ fn brush_tool( d: &DevelopSettings, ) { let active = app.session.active_mask; + // the stroke goes into the selected mask (or a new one): in its coordinates + let map = &map.for_mask_id(d, active); let long = (map.rect.width().max(map.rect.height())) as f64; let r = (app.ui.brush_size as f64 * long) as f32; if let Some(h) = resp.hover_pos() { @@ -635,6 +725,7 @@ fn grip_gestures( let m = d.masks.iter().find(|m| Some(m.id) == active)?; // Handles take precedence; otherwise grab the selected radial component under // the press, including components after the first in compound masks. + let map = &map.for_mask(m.on_photo); let at = map.norm(q); if let Some(ci) = m.components.iter().position(|c| radial_body_contains(&c.shape, at, map)) { return Some((m.id, ci, 0)); @@ -643,18 +734,25 @@ fn grip_gestures( matches!(m.components.first()?.shape, MaskShape::Linear { .. }).then_some((m.id, 0, 0)) }); if let Some((mask, comp, handle)) = grip - && let Some(original_shape) = d.masks.iter().find(|m| m.id == mask).and_then(|m| m.components.get(comp)).map(|c| c.shape.clone()) + && d.masks.iter().find(|m| m.id == mask).and_then(|m| m.components.get(comp)).is_some() { if Some(mask) != active { let _ = app.run("mask.select", json!({"id": mask})); } let _ = app.run("develop.beginInteraction", json!({"label": "Edit Mask"})); - app.gesture = Some(Gesture::MaskHandle { mask, comp, handle, original_shape }); + // (read after it begins: an old mask is on the photo from then on, in its coordinates) + if let Some(original_shape) = current_shape(app, mask, comp) + .or_else(|| d.masks.iter().find(|m| m.id == mask).and_then(|m| m.components.get(comp)).map(|c| c.shape.clone())) + { + app.gesture = Some(Gesture::MaskHandle { mask, comp, handle, original_shape }); + } } } if resp.dragged() && let (Some(Gesture::MaskHandle { mask, comp, handle, original_shape }), Some(q)) = (app.gesture.clone(), resp.interact_pointer_pos()) { + // (the live flag: the drag's first frame began the interaction, which put an old mask on the photo) + let map = ¤t_on_photo(app, mask).map_or_else(|| map.for_mask_id(d, Some(mask)), |on| map.for_mask(on)); let n = map.norm(q); let press_origin = ui.input(|i| i.pointer.press_origin()).unwrap_or(q); let n0 = map.norm(press_origin); @@ -692,6 +790,7 @@ fn mask_keys(app: &mut LightcraftApp, ui: &mut egui::Ui, map: &CanvasMap, d: &De for &(mid, ci, handle, q) in grips { let Some(m) = d.masks.iter().find(|m| m.id == mid) else { continue }; let Some(shape) = m.components.get(ci).map(|c| &c.shape) else { continue }; + let map = &map.for_mask(m.on_photo); let at = map.norm(q); let mask_name = if m.name.trim().is_empty() { format!("{} {mid}", crate::i18n::tr("Mask")) } else { m.name.clone() }; let name = mask_handle_name(&mask_name, shape, handle); @@ -703,17 +802,37 @@ fn mask_keys(app: &mut LightcraftApp, ui: &mut egui::Ui, map: &CanvasMap, d: &De if app.session.active_mask != Some(mid) { let _ = app.run("mask.select", json!({"id": mid})); } - let to = Point::new(at.x + dx, at.y + dy); - let new_shape = moved_shape(shape, handle, Point::new(dx, dy), to, map, false); let _ = app.run("develop.beginInteraction", json!({"label": "Edit Mask"})); + // (read after it begins: an old mask is on the photo from then on, in its coordinates) + let (shape, map) = match (current_shape(app, mid, ci), current_on_photo(app, mid)) { + (Some(s), Some(on)) => (s, map.for_mask(on)), + _ => (shape.clone(), map.clone()), + }; + let at = map.norm(q); + let to = Point::new(at.x + dx, at.y + dy); + let new_shape = moved_shape(&shape, handle, Point::new(dx, dy), to, &map, false); let _ = app.run("mask.update", json!({"id": mid, "component": ci, "shape": new_shape})); let _ = app.run("develop.endInteraction", json!({})); } } +/// The shape of component `comp` of mask `mask` of the active photo as the session has it now. +fn current_shape(app: &LightcraftApp, mask: u32, comp: usize) -> Option { + let d = app.session.develop_of(app.session.active()?)?; + d.masks.iter().find(|m| m.id == mask)?.components.get(comp).map(|c| c.shape.clone()) +} + +/// Whether mask `mask` of the active photo is on the photo now (`Mask::on_photo`). +fn current_on_photo(app: &LightcraftApp, mask: u32) -> Option { + let d = app.session.develop_of(app.session.active()?)?; + d.masks.iter().find(|m| m.id == mask).map(|m| m.on_photo) +} + /// Long-edge units → normalized units for x and y. fn frame_long_norm(map: &CanvasMap) -> (f64, f64) { - // derive from the mapping: 1 normalized unit in x and y in screen points + // derive from the mapping: 1 normalized unit in x and y in screen points (of the frame's + // proportions, which a lens or perspective warp doesn't change) + let map = map.for_mask(false); let o = map.screen(Point::new(0.0, 0.0)); let x = map.screen(Point::new(1.0, 0.0)).distance(o) as f64; let y = map.screen(Point::new(0.0, 1.0)).distance(o) as f64; diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 600df0a08fc..cca721af6f8 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (LR-IMP-FORMATS: the Canon CRW decoder is the shared craft-libs crate `craft-crw`; LR-PROF-CAMERACOLOR: chart-measured matrices for the Canon EOS D60, its white balance in Kelvin; CRW imports name their camera; LR-BEHAV-ACCESS: the Flatpak may talk to the accessibility bus; LR-LIB-ALBUM: album commands leave out photos the library no longer has and record nothing when they add nothing; LR-BEHAV-DRAGDROP: a right-click on a text field while photos are carried from the grid opens no Cut / Copy / Paste menu; LR-BEHAV-DRAGDROP: a right-click while photos are carried from the grid opens no context menu; LR-LIB-VIRTUALCOPY: default numbering is preflighted across the requested batch and explicit names bypass suffix allocation; LR-BEHAV-DRAGDROP: only the primary button drags photos out of the grid and drops them; KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-LOCATION: Info GPS text is fully validated before metadata changes; LR-MAP-TRACKLOG decodes GPX character references in point fields; malformed references error; CDATA stays literal; LR-BEHAV-ACCESS: the Thumbnail size control is a slider to screen readers; LR-BEHAV-ACCESS: the Detail photo is named with its file name; LR-VIEW-PHOTOGRID: the grid's empty-view message names its shortcut as this platform writes it and as it is bound; LR-BEHAV-ACCESS: the grid's date headers are named as they read; LR-BEHAV-ACCESS: the sidebar's disclosure triangles name their row; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K Set Keyword Shortcut and ⇧K; KEYC-METADATA: ⌘⇧K / Ctrl+Shift+K Edit Keywords; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-FOLDERS: Local's built-in places (Pictures, Desktop, Downloads, Home) offer no Rename Folder… or Move Folder To…, and `folder.rename` / `folder.move` refuse the home folder and its Pictures, Desktop and Downloads; LRC-LIB-CATALOG-SWITCH: a library's catalog.snap or folder given at launch opens that library; LR-IMP-ADD-DIALOG / LR-IMP-MOVE: checked rename-sequence exhaustion; LR-IMP-ADD-DIALOG: an import asks the disk about the probes a scan left, and for each photo's sidecar, up to 16 files at a time; LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started; a refused move leaves the question on; LR-IMP-ADD-DIALOG: remembered import thumbnail size, density-aware bounded previews and one job per candidate/size bucket (#2237, part of #2056); import loupe remains open; counts unchanged; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MERGE-HDR / LR-MERGE-PANO / LR-MERGE-HDRPANO: the dialog makes a new preview each time it opens, also after a failed one, #2708; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-MISSING: `library.missing` from the control channel checks the files on a worker thread instead of the UI thread; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-CROP-AUTO: Auto straighten reads the vertical vanishing point and the horizon; LR-META-EXIF-FULL: reject extra EXIF clock components so invalid capture-time candidates fall through to valid metadata; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-XMP / LRC-MAP-TRACKLOG: malformed ISO times are not projected or matched; LR-IMP-FORMATS: JPEG ICC APP2 chunk validation; LR-BEHAV-TITLEBAR: a dialog leaves the title bar undimmed, as a macOS sheet does; LR-BEHAV-ACCESS: the bars are toolbars and the panels landmarks for screen readers; LR-BEHAV-ACCESS: every dialog and prompt is exposed as a dialog (a modal one, an alert dialog for the prompts); LR-BEHAV-ACCESS: icon-only buttons are named by their label, with the shortcut as the description; MENU-HELP-HELP: on macOS the Help menu is registered with the application only once the menu bar is installed (muda ignores the call before), so AppKit knows which menu is Help; LR-BEHAV-ACCESS: a slider's value field is named ` value`, with how to use it as its description; MENU-BAR: every shortcut the app shows on macOS lists its modifiers ⌃⌥⇧⌘, as the menu bar does; MENU-BAR: on macOS two menu rows that run the same command each get their own native row and label (File ▸ Export… and File ▸ Export with Preset ▸ Custom…; File ▸ New Album… and Photo ▸ Add to Album ▸ New Album…); LR-BEHAV-DIALOGS: a one-line prompt that is refused stays open and says why, and a New Folder on Disk says it was made; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-VIEW-HISTOGRAM: the shadow and highlight clipping buttons take their tile and chevron from the theme, so the chevron reads in every theme; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MASK-BRUSH: extreme brush segments skip the intermediate dabs; LR-MASK-BRUSH: with the mask overlay hidden, the stroke being painted no longer tints the photo) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-02 · **Change:** minor (LR-MASK-LINEAR: masks stay on the photo's content under lens corrections, Upright, Transform and Rotate; LR-IMP-FORMATS: the Canon CRW decoder is the shared craft-libs crate `craft-crw`; LR-PROF-CAMERACOLOR: chart-measured matrices for the Canon EOS D60, its white balance in Kelvin; CRW imports name their camera; LR-BEHAV-ACCESS: the Flatpak may talk to the accessibility bus; LR-LIB-ALBUM: album commands leave out photos the library no longer has and record nothing when they add nothing; LR-BEHAV-DRAGDROP: a right-click on a text field while photos are carried from the grid opens no Cut / Copy / Paste menu; LR-BEHAV-DRAGDROP: a right-click while photos are carried from the grid opens no context menu; LR-LIB-VIRTUALCOPY: default numbering is preflighted across the requested batch and explicit names bypass suffix allocation; LR-BEHAV-DRAGDROP: only the primary button drags photos out of the grid and drops them; KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-LOCATION: Info GPS text is fully validated before metadata changes; LR-MAP-TRACKLOG decodes GPX character references in point fields; malformed references error; CDATA stays literal; LR-BEHAV-ACCESS: the Thumbnail size control is a slider to screen readers; LR-BEHAV-ACCESS: the Detail photo is named with its file name; LR-VIEW-PHOTOGRID: the grid's empty-view message names its shortcut as this platform writes it and as it is bound; LR-BEHAV-ACCESS: the grid's date headers are named as they read; LR-BEHAV-ACCESS: the sidebar's disclosure triangles name their row; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌘⌥⇧K Set Keyword Shortcut and ⇧K; KEYC-METADATA: ⌘⇧K / Ctrl+Shift+K Edit Keywords; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-FOLDERS: Local's built-in places (Pictures, Desktop, Downloads, Home) offer no Rename Folder… or Move Folder To…, and `folder.rename` / `folder.move` refuse the home folder and its Pictures, Desktop and Downloads; LRC-LIB-CATALOG-SWITCH: a library's catalog.snap or folder given at launch opens that library; LR-IMP-ADD-DIALOG / LR-IMP-MOVE: checked rename-sequence exhaustion; LR-IMP-ADD-DIALOG: an import asks the disk about the probes a scan left, and for each photo's sidecar, up to 16 files at a time; LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started; a refused move leaves the question on; LR-IMP-ADD-DIALOG: remembered import thumbnail size, density-aware bounded previews and one job per candidate/size bucket (#2237, part of #2056); import loupe remains open; counts unchanged; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MERGE-HDR / LR-MERGE-PANO / LR-MERGE-HDRPANO: the dialog makes a new preview each time it opens, also after a failed one, #2708; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LRC-LIB-MISSING: `library.missing` from the control channel checks the files on a worker thread instead of the UI thread; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-CROP-AUTO: Auto straighten reads the vertical vanishing point and the horizon; LR-META-EXIF-FULL: reject extra EXIF clock components so invalid capture-time candidates fall through to valid metadata; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-META-XMP / LRC-MAP-TRACKLOG: malformed ISO times are not projected or matched; LR-IMP-FORMATS: JPEG ICC APP2 chunk validation; LR-BEHAV-TITLEBAR: a dialog leaves the title bar undimmed, as a macOS sheet does; LR-BEHAV-ACCESS: the bars are toolbars and the panels landmarks for screen readers; LR-BEHAV-ACCESS: every dialog and prompt is exposed as a dialog (a modal one, an alert dialog for the prompts); LR-BEHAV-ACCESS: icon-only buttons are named by their label, with the shortcut as the description; MENU-HELP-HELP: on macOS the Help menu is registered with the application only once the menu bar is installed (muda ignores the call before), so AppKit knows which menu is Help; LR-BEHAV-ACCESS: a slider's value field is named ` value`, with how to use it as its description; MENU-BAR: every shortcut the app shows on macOS lists its modifiers ⌃⌥⇧⌘, as the menu bar does; MENU-BAR: on macOS two menu rows that run the same command each get their own native row and label (File ▸ Export… and File ▸ Export with Preset ▸ Custom…; File ▸ New Album… and Photo ▸ Add to Album ▸ New Album…); LR-BEHAV-DIALOGS: a one-line prompt that is refused stays open and says why, and a New Folder on Disk says it was made; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-VIEW-HISTOGRAM: the shadow and highlight clipping buttons take their tile and chevron from the theme, so the chevron reads in every theme; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; LR-MASK-BRUSH: extreme brush segments skip the intermediate dabs; LR-MASK-BRUSH: with the mask overlay hidden, the stroke being painted no longer tints the photo) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -297,7 +297,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-MASK-PEOPLE | People parts | P2 | ⬜ | | shape exists (no UI): uses the photo's person / skin / hair / teeth / glasses mattes when it carries them (DNG semantic masks), else the subject heuristic | | LR-MASK-LANDSCAPE | Landscape classes | P2 | ⬜ | | shape exists, evaluates empty | | LR-MASK-BRUSH | Brush mask | P0 | 🟡 | `cmd:tool.brush`, `cmd:mask.brushStroke` (`autoMask`), `crates/pipeline/src/masks.rs`, `crates/ui-egui/src/brush_live.rs` | size/feather/flow/density/erase; Create New Mask starts a separate brush in paint mode; the stroke shows while the button is held with the committed stroke's dab spacing, feather and flow, so fast strokes have no gaps (#517); with the mask overlay hidden (O / the eye, or after a mask slider hid it) or a colour overlay at opacity 0 it is not tinted while painting either, so dodging and burning is judged on the photo, and its effect shows once the stroke is committed (#2549); coverage builds up by passes, not hold time (holding the brush still adds nothing, live or committed, #518); oversized path segments skip intermediate dabs instead of allocating a million samples; Auto Mask: dabs weighted by similarity to the colour under the dab centre, refined by a guided filter on luminance (CPU + GPU); ⇧-click draws a straight stroke from where the last stroke ended (`connect`), tapering size, feather and flow from that stroke's values when they changed; no A/B brushes; pen pressure (Brush ▸ Pen Pressure, on by default; `pressure` per point in `mask.brushStroke`) scales each dab's size (a tenth to all of it) and flow, live and committed alike, where winit reports a pen force (Windows; not macOS / Linux tablets yet); no tilt | -| LR-MASK-LINEAR | Linear gradient | P0 | ✅ | `cmd:tool.linear`, `cmd:mask.update` | | +| LR-MASK-LINEAR | Linear gradient | P0 | ✅ | `cmd:tool.linear`, `cmd:mask.update`, `crates/pipeline/src/mask_space.rs` | gradients, brushes and AI selections stay on the photo's content when lens corrections, Upright, Transform or Rotate Left / Right change (`Mask.on_photo`; CPU and GPU) | | LR-MASK-RADIAL | Radial gradient | P0 | ✅ | `cmd:tool.radial`, `cmd:mask.update`, `crates/ui-egui/src/panels/detail.rs` | drag the selected ellipse's body or centre pin to move; edge grips resize, outer grip rotates; rotated and compound radial components, hidden pins, outside hit rejection and one-step undo tested | | LR-MASK-COLORRANGE | Colour range | P1 | ✅ | `cmd:mask.add` (`colorRange`), `cmd:mask.sampleColor`, `cmd:mask.update`, `crates/pipeline/src/lib.rs` (`color_range_sample`) | Color tile → click the photo to sample (⇧-click adds, up to 5; samples taken in the space the mask compares in, respecting section eyes and the requested HDR/SDR rendition), Pick button, Refine slider; at most 64 samples (`MAX_COLOR_RANGE_SAMPLES`, render cost is pixels × samples) however the mask arrives: `mask.add` / `mask.update`, a sidecar's `lc:settings`, a preset, `develop.merge`, `render --settings` or the catalog and history keep the first 64 (issue #2556) | | LR-MASK-LUMRANGE | Luminance range | P1 | ✅ | `cmd:mask.add` (`luminanceRange`), `cmd:mask.update`, `crates/ui-egui/src/panels/masking.rs` (`range_controls`) | range bar with two handles (the pressed endpoint stays selected through fast/crossing drags; one undo step per drag), Smoothness, Show Luminance Map (B&W photo with the range tinted) |