pub enum PixelFormat {
Nv12,
P010,
I420,
I010,
}Expand description
The pixel layout of a DecodedFrame — the four surface formats the
platform decoders emit for 4:2:0 content.
Variants§
Nv12
8-bit 4:2:0, biplanar: full-size Y plane + half-size interleaved CbCr plane.
P010
10..16-bit 4:2:0, biplanar: like Nv12 but 16-bit
little-endian words with the sample value in the most significant
bits (the VideoToolbox / DXGI P010 convention).
I420
8-bit 4:2:0, planar: full-size Y plane + half-size Cb and Cr planes.
I010
10..16-bit 4:2:0, planar: like I420 but 16-bit
little-endian words with the sample value in the least significant
bits.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn plane_count(self) -> usize
pub fn plane_count(self) -> usize
The number of planes this format carries (2 for biplanar NV12/P010, 3 for planar I420/I010).
Sourcepub fn bytes_per_sample(self) -> usize
pub fn bytes_per_sample(self) -> usize
The storage size of one sample in bytes (1 for the 8-bit formats, 2 for the 16-bit-word formats).
Sourcepub fn supports_bit_depth(self, bit_depth: u8) -> bool
pub fn supports_bit_depth(self, bit_depth: u8) -> bool
Whether bit_depth is representable in this format: exactly 8 for the
8-bit formats, 9..=16 for the 16-bit-word formats.