diff --git a/crates/store/re_types/src/datatypes/pixel_format_ext.rs b/crates/store/re_types/src/datatypes/pixel_format_ext.rs index 98b19e49ee56..55b12e01888b 100644 --- a/crates/store/re_types/src/datatypes/pixel_format_ext.rs +++ b/crates/store/re_types/src/datatypes/pixel_format_ext.rs @@ -74,7 +74,14 @@ impl PixelFormat { | Self::NV12 | Self::YUY2 => ColorModel::RGB, - // TODO(andreas): This shouldn't be ColorModel::RGB, but our YUV converter can't do anything else right now. + // TODO(andreas): This shouldn't be ColorModel::RGB, but our YUV converter can't do anything else right now: + // The converter doesn't *have* to always output RGB, but having it sometimes output R(8) specifically for the + // YUV converter requires me to do more bookkeeping (needs a new renderpipeline and I expect other ripples). + // + // As of writing, having this color_model "incorrectly" be RGB mostly affects hovering logic which will continue to show RGB rather than L. + // + // Note that this does not affect the memory Y8 needs. It just implies that we use more GPU memory than we should. + // However, we typically (see image cache) hold the converted GPU textures only as long as we actually draw with them. Self::Y8_LimitedRange | Self::Y8_FullRange => ColorModel::RGB, } } diff --git a/crates/viewer/re_viewer_context/src/tensor/image_stats.rs b/crates/viewer/re_viewer_context/src/tensor/image_stats.rs index 62b88947f9ec..7b453babf0a1 100644 --- a/crates/viewer/re_viewer_context/src/tensor/image_stats.rs +++ b/crates/viewer/re_viewer_context/src/tensor/image_stats.rs @@ -123,6 +123,9 @@ impl ImageStats { let datatype = match image.format.pixel_format { Some(_) => { // We do the lazy thing here since we convert everything to RGB8 right now anyways. + // Note that this range is all about the format we're converting _to_. + // It would be nice if we can distininguish this better in the future: + // E.g. limited range YUV should have the correct limited range. return Self { range: Some((0.0, 255.0)), finite_range: (0.0, 255.0),