-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New planar pixel formats: Y_U_V24
/Y_U_V16
/Y_U_V12
- _LimitedRange
/FullRange
#7666
Changes from 14 commits
7157262
d75562c
d83bbdc
200163a
b6266d4
886a5b6
2ce1a58
f0b7e16
649348b
a2eb9ae
97a2091
b97e9a5
dc5418e
f296688
d99241e
cfe85fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ _deps | |
# Python build artifacts: | ||
__pycache__ | ||
*.pyc | ||
*.pyd | ||
*.so | ||
**/.pytest_cache | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
namespace rerun.datatypes; | ||
|
||
// TODO(andreas): Clarify relationship to color primaries. Right now there's some hardcoded differences between formats. | ||
// See `image_to_gpu.rs` | ||
// Suggestion: guides heuristic but doesn't specify it unless noted. | ||
|
||
/// Specifieds a particular format of an [archetypes.Image]. | ||
/// | ||
/// Most images can be described by a [datatypes.ColorModel] and a [datatypes.ChannelDatatype], | ||
|
@@ -24,13 +28,82 @@ enum PixelFormat: ubyte { | |
// this organization and subsequently reduce the chance we may find ourselves wanting to | ||
// change the values in the future. | ||
|
||
/// `NV12` (aka `Y_UV12`) is a YUV 4:2:0 chroma downsampled format with 12 bits per pixel and 8 bits per channel. | ||
/// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`. | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240]. | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes. | ||
Y_U_V24_LimitedRange = 39, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the ordering in respect to the numbers in here is rather dubious |
||
|
||
/// `Y_U_V24` is a YUV 4:4:4 fully planar YUV format without chroma downsampling, also known as `I444`. | ||
/// | ||
/// This uses full range YUV with all components ranging from 0 to 255 | ||
/// (as opposed to "limited range" YUV as used e.g. in NV12). | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes. | ||
Y_U_V24_FullRange = 40, | ||
|
||
/// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`. | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240]. | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half | ||
/// the horizontal resolution of the Y plane. | ||
Y_U_V16_LimitedRange = 49, // Ocean doesn't have a short codes for this | ||
|
||
/// `Y_U_V16` is a YUV 4:2:2 fully planar YUV format without chroma downsampling, also known as `I422`. | ||
/// | ||
/// This uses full range YUV with all components ranging from 0 to 255 | ||
/// (as opposed to "limited range" YUV as used e.g. in NV12). | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half | ||
/// the horizontal resolution of the Y plane. | ||
Y_U_V16_FullRange = 50, // Ocean doesn't have a short codes for this | ||
|
||
/// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`. | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240]. | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half | ||
/// the resolution of the Y plane. | ||
Y_U_V12_LimitedRange = 20, | ||
|
||
/// `Y_U_V12` is a YUV 4:2:0 fully planar YUV format without chroma downsampling, also known as `I420`. | ||
/// | ||
/// This uses full range YUV with all components ranging from 0 to 255 | ||
/// (as opposed to "limited range" YUV as used e.g. in NV12). | ||
/// | ||
/// First comes entire image in Y in one plane, followed by the U and V planes, which each only have half | ||
/// the resolution of the Y plane. | ||
Y_U_V12_FullRange = 44, | ||
|
||
/// Monochrome Y plane only, essentially a YUV 4:0:0 planar format. | ||
/// | ||
/// Also known as just "gray". | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235]. | ||
/// If not for this range limitation/remapping, this is almost identical to 8bit luminace/grayscale (see [datatypes.ColorModel]). | ||
Y8_LimitedRange = 41, | ||
|
||
/// Monochrome Y plane only, essentially a YUV 4:0:0 planar format. | ||
/// | ||
/// Also known as just "gray". This is virtually identical to a 8bit luminance/grayscale (see [datatypes.ColorModel]). | ||
/// | ||
/// This uses entire range YUV, i.e. Y is expected to be within [0, 255]. | ||
/// (as opposed to "limited range" YUV as used e.g. in NV12). | ||
Y8_FullRange = 30, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At some point it would be nice if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah... maybe. See PR description 😄 |
||
|
||
/// `NV12` (aka `Y_UV12`) is a YUV 4:2:0 chroma downsampled form at with 12 bits per pixel and 8 bits per channel. | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240]. | ||
/// | ||
/// First comes entire image in Y in one plane, | ||
/// followed by a plane with interleaved lines ordered as U0, V0, U1, V1, etc. | ||
NV12 = 26 (default), // _something_ has to be the default 🤷♀️ | ||
|
||
/// `YUY2` (aka `YUYV` or `YUYV16`), is a YUV 4:2:2 chroma downsampled format with 16 bits per pixel and 8 bits per channel. | ||
/// `YUY2` (aka `YUYV`, `YUYV16` or `NV21`), is a YUV 4:2:2 chroma downsampled format with 16 bits per pixel and 8 bits per channel. | ||
/// | ||
/// This uses limited range YUV, i.e. Y is expected to be within [16, 235] and U/V within [16, 240]. | ||
/// | ||
/// The order of the channels is Y0, U0, Y1, V0, all in the same plane. | ||
YUY2 = 27, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why this didn't come up before, but while working on this I accidentally pushed a .pyd file which wasn't on the ignore list. better safe than sorry (again), so I added this here