Enum ChromaSampling
#[repr(C)]
pub enum ChromaSampling
Chroma subsampling format
Variants
-
Cs420 Both vertically and horizontally subsampled.
-
Cs422 Horizontally subsampled.
-
Cs444 Not subsampled.
-
Cs400 Monochrome.
Implementations
impl ChromaSampling
const fn get_decimation(self) -> Option<(usize, usize)>Provides the amount to right shift the luma plane dimensions to get the chroma plane dimensions. Only values 0 or 1 are ever returned. The plane dimensions must also be rounded up to accommodate odd luma plane sizes. Cs400 returns None, as there are no chroma planes.
const fn get_chroma_dimensions(self, luma_width: usize, luma_height: usize) -> (usize, usize)Calculates the size of a chroma plane for this sampling type, given the luma plane dimensions.
Trait Implementations
impl Clone for ChromaSampling
fn clone(&self) -> ChromaSampling
impl Copy for ChromaSampling
impl Debug for ChromaSampling
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for ChromaSampling
fn default() -> ChromaSampling
impl Display for ChromaSampling
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>
impl Eq for ChromaSampling
impl FromPrimitive for ChromaSampling
fn from_i64(n: i64) -> Option<Self>fn from_u64(n: u64) -> Option<Self>
impl PartialEq for ChromaSampling
fn eq(&self, other: &ChromaSampling) -> bool
impl StructuralPartialEq for ChromaSampling
Auto Trait Implementations
impl Freeze for ChromaSampling
impl RefUnwindSafe for ChromaSampling
impl Send for ChromaSampling
impl Sync for ChromaSampling
impl Unpin for ChromaSampling
impl UnsafeUnpin for ChromaSampling
impl UnwindSafe for ChromaSampling
Blanket Implementations
impl<T> Any for ChromaSampling
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ChromaSampling
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ChromaSampling
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ChromaSampling
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for ChromaSampling
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for ChromaSampling
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for ChromaSampling
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for ChromaSampling
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ChromaSampling
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for ChromaSampling
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>