pub struct SamplingFactors {
pub max_h: u8,
pub max_v: u8,
/* private fields */
}Expand description
Per-component (H, V) sampling factors, stored in declaration order.
Fields§
§max_h: u8max(H_i) across components — MCU width in data units.
max_v: u8max(V_i) across components — MCU height in data units.
Implementations§
Source§impl SamplingFactors
impl SamplingFactors
Sourcepub fn from_components(
components: &[(u8, u8)],
) -> Result<Self, SamplingFactorsError>
pub fn from_components( components: &[(u8, u8)], ) -> Result<Self, SamplingFactorsError>
Build sampling metadata from component (H, V) factors.
§Errors
Returns SamplingFactorsError when no components are supplied, more
than four components are supplied, or any sampling factor is outside
the JPEG legal range 1..=4.
Sourcepub fn component(&self, index: usize) -> Option<(u8, u8)>
pub fn component(&self, index: usize) -> Option<(u8, u8)>
Sampling factors for a component by declaration index.
Sourcepub fn components(&self) -> &[(u8, u8)]
pub fn components(&self) -> &[(u8, u8)]
Sampling factors in component declaration order.
Trait Implementations§
Source§impl Clone for SamplingFactors
impl Clone for SamplingFactors
Source§fn clone(&self) -> SamplingFactors
fn clone(&self) -> SamplingFactors
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 SamplingFactors
Source§impl Debug for SamplingFactors
impl Debug for SamplingFactors
impl Eq for SamplingFactors
Source§impl PartialEq for SamplingFactors
impl PartialEq for SamplingFactors
impl StructuralPartialEq for SamplingFactors
Auto Trait Implementations§
impl Freeze for SamplingFactors
impl RefUnwindSafe for SamplingFactors
impl Send for SamplingFactors
impl Sync for SamplingFactors
impl Unpin for SamplingFactors
impl UnsafeUnpin for SamplingFactors
impl UnwindSafe for SamplingFactors
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more