pub enum ChromaSubsampling {
Yuv420,
Yuv422,
Yuv444,
Monochrome,
}Expand description
Specifies the chroma subsampling for a YUV frame.
Variants§
Yuv420
Chroma at half width, half height
Yuv422
Chroma at half width, full height
Yuv444
Chroma at full resolution
Monochrome
No chroma planes
Implementations§
Source§impl ChromaSubsampling
impl ChromaSubsampling
Sourcepub fn has_chroma(&self) -> bool
pub fn has_chroma(&self) -> bool
Whether the specified chroma subsampling has chroma planes.
Sourcepub fn chroma_dimensions(
&self,
luma_width: usize,
luma_height: usize,
) -> Option<(usize, usize)>
pub fn chroma_dimensions( &self, luma_width: usize, luma_height: usize, ) -> Option<(usize, usize)>
Computes the dimensions for a chroma plane with the current subsampling for the given luma dimensions.
Returns None if the subsampling has no chroma planes,
or if the subsampling is invalid for the luma dimensions
(e.g. odd resolution for YUV420).
Sourcepub fn subsample_ratio(&self) -> Option<(NonZeroU8, NonZeroU8)>
pub fn subsample_ratio(&self) -> Option<(NonZeroU8, NonZeroU8)>
Returns the divisor for the chroma dimensions for the given subsampling.
Trait Implementations§
Source§impl Clone for ChromaSubsampling
impl Clone for ChromaSubsampling
Source§fn clone(&self) -> ChromaSubsampling
fn clone(&self) -> ChromaSubsampling
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChromaSubsampling
impl Debug for ChromaSubsampling
Source§impl PartialEq for ChromaSubsampling
impl PartialEq for ChromaSubsampling
impl Copy for ChromaSubsampling
impl Eq for ChromaSubsampling
impl StructuralPartialEq for ChromaSubsampling
Auto Trait Implementations§
impl Freeze for ChromaSubsampling
impl RefUnwindSafe for ChromaSubsampling
impl Send for ChromaSubsampling
impl Sync for ChromaSubsampling
impl Unpin for ChromaSubsampling
impl UnwindSafe for ChromaSubsampling
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