Skip to content

Commit 165ae52

Browse files
authored
Fix size check for NV12 & YUY2 formats in C++ and Rust (#9890)
1 parent b6135b3 commit 165ae52

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/store/re_types/src/datatypes/pixel_format_ext.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ impl PixelFormat {
4646
Self::Y_U_V24_FullRange | Self::Y_U_V24_LimitedRange => num_pixels * 4,
4747

4848
// 422 formats.
49-
Self::Y_U_V16_FullRange | Self::Y_U_V16_LimitedRange | Self::NV12 => {
49+
Self::Y_U_V16_FullRange | Self::Y_U_V16_LimitedRange | Self::YUY2 => {
5050
16 * num_pixels / 8
5151
}
5252

5353
// 420 formats.
54-
Self::Y_U_V12_FullRange | Self::Y_U_V12_LimitedRange | Self::YUY2 => {
54+
Self::Y_U_V12_FullRange | Self::Y_U_V12_LimitedRange | Self::NV12 => {
5555
12 * num_pixels / 8
5656
}
5757

rerun_cpp/src/rerun/image_utils.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ namespace rerun {
165165
// 422 formats.
166166
case datatypes::PixelFormat::Y_U_V16_FullRange:
167167
case datatypes::PixelFormat::Y_U_V16_LimitedRange:
168-
case datatypes::PixelFormat::NV12:
168+
case datatypes::PixelFormat::YUY2:
169169
return 16 * num_pixels / 8;
170170

171171
// 420 formats.
172172
case datatypes::PixelFormat::Y_U_V12_FullRange:
173173
case datatypes::PixelFormat::Y_U_V12_LimitedRange:
174-
case datatypes::PixelFormat::YUY2:
174+
case datatypes::PixelFormat::NV12:
175175
return 12 * num_pixels / 8;
176176

177177
// Monochrome formats.

0 commit comments

Comments
 (0)