Skip to content

Commit

Permalink
more clarifying comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Oct 10, 2024
1 parent d99241e commit cfe85fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crates/store/re_types/src/datatypes/pixel_format_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
3 changes: 3 additions & 0 deletions crates/viewer/re_viewer_context/src/tensor/image_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit cfe85fd

Please sign in to comment.