From 58d6844dadee792e0d6ad845987b17c6ac8855ce Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Mon, 16 Nov 2026 01:58:21 +0100 Subject: [PATCH] raw: carry the linearization table through DngImage views Main's writer (#1745) reads linearized/linearization_table from the image; the borrowed view needs the same fields so the merge compiles. --- crates/raw/src/dngwrite.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/raw/src/dngwrite.rs b/crates/raw/src/dngwrite.rs index b2eba18a3..2b8061949 100644 --- a/crates/raw/src/dngwrite.rs +++ b/crates/raw/src/dngwrite.rs @@ -173,6 +173,11 @@ pub struct DngImage<'a> { pub cinema: &'a crate::CinemaTags, /// Optional application-supplied UniqueCameraModel fallback when make/model are absent. pub unknown_camera_model: Option<&'a str>, + /// Whether `data` has already been mapped through `linearization_table` (see + /// [`RawImage::linearized`]). + pub linearized: bool, + /// A LinearizationTable still to be applied by the reader; written only when `linearized` is false. + pub linearization_table: Option<&'a [u16]>, } impl<'a> From<&'a RawImage> for DngImage<'a> { @@ -197,6 +202,8 @@ impl<'a> From<&'a RawImage> for DngImage<'a> { unique_model: raw.camera.unique_model.as_deref(), cinema: &raw.cinema, unknown_camera_model: None, + linearized: raw.linearized, + linearization_table: raw.linearization_table.as_deref(), } } } @@ -338,7 +345,7 @@ fn write_image(raw: &DngImage<'_>, opts: &DngWriteOptions, lossy: Option