#[non_exhaustive]pub enum ChromaSubsampling {
Cs444,
Cs422,
Cs420,
Cs400,
}Expand description
Chroma subsampling of the coded planes (AV1 subsampling_x / subsampling_y, §5.5.2).
#[non_exhaustive]: models the AV1 layouts today; other codecs may add layouts (e.g. TIFF’s
4:1:1) later.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Cs444
4:4:4 — full-resolution chroma (subsampling_x = subsampling_y = 0). Required for identity.
Cs422
4:2:2 — horizontally halved chroma (M2).
Cs420
4:2:0 — halved in both directions (M2).
Cs400
4:0:0 — monochrome, no chroma planes (M2).
Implementations§
Source§impl ChromaSubsampling
impl ChromaSubsampling
Sourcepub fn subsampling(self) -> (u8, u8)
pub fn subsampling(self) -> (u8, u8)
Returns (subsampling_x, subsampling_y) as the AV1 sequence-header flags. Monochrome is
signalled by mono_chrome, which fixes both flags to 1 (AV1 §6.4.2), not by a subsampling
combination of its own.
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 (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 ChromaSubsampling
Source§impl Debug for ChromaSubsampling
impl Debug for ChromaSubsampling
impl Eq for ChromaSubsampling
Source§impl Hash for ChromaSubsampling
impl Hash for ChromaSubsampling
Source§impl PartialEq for ChromaSubsampling
impl PartialEq 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 UnsafeUnpin 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