#[non_exhaustive]pub enum Quality {
Traditional(f32),
Distance(f32),
}Expand description
Quality representation that can be either traditional (1-100) or butteraugli distance.
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.
Traditional(f32)
Traditional JPEG quality (1-100, where 100 is best)
Distance(f32)
Butteraugli distance (0.0 = lossless, higher = more compression) Typical values: 0.5 = very high quality, 1.0 = high, 2.0 = medium
Implementations§
Source§impl Quality
impl Quality
Sourcepub fn from_quality(q: f32) -> Self
pub fn from_quality(q: f32) -> Self
Creates a quality setting from traditional JPEG quality (1-100).
Sourcepub fn from_distance(d: f32) -> Self
pub fn from_distance(d: f32) -> Self
Creates a quality setting from butteraugli distance.
Sourcepub fn to_distance(self) -> f32
pub fn to_distance(self) -> f32
Converts to butteraugli distance.
Sourcepub fn to_quality(self) -> f32
pub fn to_quality(self) -> f32
Converts to traditional quality (approximate).
Trait Implementations§
impl Copy for Quality
impl StructuralPartialEq for Quality
Auto Trait Implementations§
impl Freeze for Quality
impl RefUnwindSafe for Quality
impl Send for Quality
impl Sync for Quality
impl Unpin for Quality
impl UnwindSafe for Quality
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