pub enum PixelFormat {
UYVY422,
I420,
BGRA,
}Expand description
Pixel format: layout of pixels in memory, defining the number/meaning of planes including the size of each sample in bits.
YUV color ranges (e.g. full/JPEG vs limited/MPEG) are not defined here.
Variants§
UYVY422
UYVY.
Matches ffmpeg’s AV_PIX_FMT_UYVY422: “packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1”.
For odd-width images, the width is rounded up to the next multiple of 2,
with the final Y as a don’t-care byte, and the final chroma values not
subsampled.
I420
I420.
Matches ffmpeg’s AV_PIX_FMT_YUV420P: “planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)”.
For odd-width and odd-height images, the final pixel is not subsampled.
BGRA
BGRA.
Matches ffmpeg’s AV_PIX_FMT_BGRA: “packed BGRA 8:8:8:8, 32bpp, BGRABGRA…”.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn num_planes(self) -> usize
pub fn num_planes(self) -> usize
Returns the number of planes for this format.
Sourcepub fn min_plane_dims(
self,
width: usize,
height: usize,
) -> impl Iterator<Item = PlaneDims>
pub fn min_plane_dims( self, width: usize, height: usize, ) -> impl Iterator<Item = PlaneDims>
Returns the plane dimensions at minimum stride (no extra bytes for padding).
Sourcepub fn plane_names(self) -> &'static [&'static str]
pub fn plane_names(self) -> &'static [&'static str]
Returns human-readable names of the planes for this format.
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