#[non_exhaustive]#[repr(u8)]pub enum Subsampling {
S444 = 0,
S422 = 1,
S420 = 2,
S411 = 3,
}Expand description
Chroma subsampling ratio.
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.
S444 = 0
4:4:4 — no subsampling, full resolution chroma.
S422 = 1
4:2:2 — horizontal half resolution chroma.
S420 = 2
4:2:0 — both horizontal and vertical half resolution chroma.
S411 = 3
4:1:1 — quarter horizontal resolution chroma.
Implementations§
Source§impl Subsampling
impl Subsampling
Sourcepub const fn h_factor(self) -> u8
pub const fn h_factor(self) -> u8
Horizontal subsampling factor (1 = full, 2 = half, 4 = quarter).
Sourcepub const fn from_factors(h: u8, v: u8) -> Option<Subsampling>
pub const fn from_factors(h: u8, v: u8) -> Option<Subsampling>
Map horizontal and vertical subsampling factors to a named pattern.
Returns None for factor combinations that don’t match a standard
subsampling pattern.
Trait Implementations§
Source§impl Clone for Subsampling
impl Clone for Subsampling
Source§fn clone(&self) -> Subsampling
fn clone(&self) -> Subsampling
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 Subsampling
Source§impl Debug for Subsampling
impl Debug for Subsampling
Source§impl Default for Subsampling
impl Default for Subsampling
Source§fn default() -> Subsampling
fn default() -> Subsampling
Returns the “default value” for a type. Read more
Source§impl Display for Subsampling
impl Display for Subsampling
impl Eq for Subsampling
Source§impl Hash for Subsampling
impl Hash for Subsampling
Source§impl PartialEq for Subsampling
impl PartialEq for Subsampling
impl StructuralPartialEq for Subsampling
Auto Trait Implementations§
impl Freeze for Subsampling
impl RefUnwindSafe for Subsampling
impl Send for Subsampling
impl Sync for Subsampling
impl Unpin for Subsampling
impl UnsafeUnpin for Subsampling
impl UnwindSafe for Subsampling
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