#[non_exhaustive]pub enum PixelFormat {
Show 31 variants
Yuv420P,
Yuv422P,
Yuv444P,
Rgb24,
Rgba,
Gray8,
Pal8,
Bgr24,
Bgra,
Argb,
Abgr,
Rgb48Le,
Rgba64Le,
Gray16Le,
Gray10Le,
Gray12Le,
Yuv420P10Le,
Yuv422P10Le,
Yuv444P10Le,
Yuv420P12Le,
YuvJ420P,
YuvJ422P,
YuvJ444P,
Nv12,
Nv21,
Ya8,
Yuva420P,
MonoBlack,
MonoWhite,
Yuyv422,
Uyvy422,
}Expand description
Video pixel format.
The first six variants (Yuv420P through Gray8) are the original
formats produced by the early codec crates. Everything beyond that is
additional surface handled by oxideav-pixfmt and the still-image
codecs (PNG, GIF, still-JPEG). The enum is #[non_exhaustive] so new
variants can land without breaking downstream crates — consumers that
match must include a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Yuv420P
8-bit YUV 4:2:0, planar (Y, U, V).
Yuv422P
8-bit YUV 4:2:2, planar.
Yuv444P
8-bit YUV 4:4:4, planar.
Rgb24
Packed 8-bit RGB, 3 bytes/pixel.
Rgba
Packed 8-bit RGBA, 4 bytes/pixel.
Gray8
Packed 8-bit grayscale.
Pal8
8-bit palette indices — companion palette carried out of band.
Bgr24
Packed 8-bit BGR, 3 bytes/pixel.
Bgra
Packed 8-bit BGRA, 4 bytes/pixel.
Argb
Packed 8-bit ARGB, 4 bytes/pixel (alpha first).
Abgr
Packed 8-bit ABGR, 4 bytes/pixel.
Rgb48Le
Packed 16-bit-per-channel RGB, little-endian, 6 bytes/pixel.
Rgba64Le
Packed 16-bit-per-channel RGBA, little-endian, 8 bytes/pixel.
Gray16Le
16-bit little-endian grayscale.
Gray10Le
10-bit grayscale in a 16-bit little-endian word.
Gray12Le
12-bit grayscale in a 16-bit little-endian word.
Yuv420P10Le
10-bit YUV 4:2:0 planar, little-endian 16-bit storage.
Yuv422P10Le
10-bit YUV 4:2:2 planar, little-endian 16-bit storage.
Yuv444P10Le
10-bit YUV 4:4:4 planar, little-endian 16-bit storage.
Yuv420P12Le
12-bit YUV 4:2:0 planar, little-endian 16-bit storage.
YuvJ420P
JPEG/full-range YUV 4:2:0 planar.
YuvJ422P
JPEG/full-range YUV 4:2:2 planar.
YuvJ444P
JPEG/full-range YUV 4:4:4 planar.
Nv12
YUV 4:2:0, planar Y + interleaved UV (NV12).
Nv21
YUV 4:2:0, planar Y + interleaved VU (NV21).
Ya8
Packed grayscale + alpha, 2 bytes/pixel (Y, A).
Yuva420P
Yuv420P with an additional full-resolution alpha plane.
MonoBlack
1 bit per pixel, packed MSB-first, 0 = black.
MonoWhite
1 bit per pixel, packed MSB-first, 0 = white.
Yuyv422
Packed 4:2:2, byte order Y0 U0 Y1 V0.
Uyvy422
Packed 4:2:2, byte order U0 Y0 V0 Y1.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn is_palette(&self) -> bool
pub fn is_palette(&self) -> bool
True if the format is a palette index format (Pal8).
Sourcepub fn plane_count(&self) -> usize
pub fn plane_count(&self) -> usize
Number of planes in the stored layout. Packed and palette formats return 1; NV12/NV21 return 2; planar YUV without alpha returns 3; YuvA variants return 4.
Sourcepub fn bits_per_pixel_approx(&self) -> u32
pub fn bits_per_pixel_approx(&self) -> u32
Rough bits-per-pixel estimate, useful for buffer sizing. Not exact for chroma-subsampled YUV — intended for worst-case preallocation rather than wire-accurate accounting.
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more