pub enum PixelFormat {
Bgra8888,
Rgba8888,
Rgb888,
Nv12,
I420,
}Expand description
Pixel layout of VideoFrame::data.
All backends deliver Bgra8888 natively and can swizzle to Rgba8888;
the remaining formats exist for future zero-copy paths.
Variants§
Bgra8888
8-bit B, G, R, A byte order — the native format everywhere.
Rgba8888
8-bit R, G, B, A byte order (CPU swizzle from BGRA).
Rgb888
24-bit packed RGB, no alpha.
Nv12
Biplanar 4:2:0 YCbCr (Y plane + interleaved CbCr).
I420
Planar 4:2:0 YCbCr.
Implementations§
Source§impl PixelFormat
impl PixelFormat
Sourcepub fn bytes_per_pixel(self) -> Option<usize>
pub fn bytes_per_pixel(self) -> Option<usize>
Bytes per pixel for packed RGB/RGBA formats.
None for the planar/biplanar YUV formats, where a single
width * bytes_per_pixel row size doesn’t apply (each plane has its
own stride and subsampling).
Trait Implementations§
Source§impl Clone for PixelFormat
impl Clone for PixelFormat
Source§fn clone(&self) -> PixelFormat
fn clone(&self) -> PixelFormat
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PixelFormat
Source§impl Debug for PixelFormat
impl Debug for PixelFormat
impl Eq for PixelFormat
Source§impl PartialEq for PixelFormat
impl PartialEq for PixelFormat
Source§fn eq(&self, other: &PixelFormat) -> bool
fn eq(&self, other: &PixelFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PixelFormat
Auto Trait Implementations§
impl Freeze for PixelFormat
impl RefUnwindSafe for PixelFormat
impl Send for PixelFormat
impl Sync for PixelFormat
impl Unpin for PixelFormat
impl UnsafeUnpin for PixelFormat
impl UnwindSafe for PixelFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more