pub struct MetricConfig {
pub dssim: bool,
pub ssimulacra2: bool,
pub butteraugli: bool,
pub psnr: bool,
pub xyb_roundtrip: bool,
}Expand description
Configuration for which metrics to calculate.
Fields§
§dssim: boolCalculate DSSIM (structural dissimilarity).
ssimulacra2: boolCalculate SSIMULACRA2 (perceptual similarity, higher is better).
butteraugli: boolCalculate Butteraugli (perceptual difference, lower is better).
psnr: boolCalculate PSNR (peak signal-to-noise ratio). NOT RECOMMENDED.
xyb_roundtrip: boolRoundtrip reference through XYB color space before comparing.
When enabled, the reference image is converted RGB → XYB → u8 → XYB → RGB before computing metrics. This isolates true compression error from color space conversion error.
Recommended for codecs that operate in XYB color space (e.g., jpegli).
Implementations§
Source§impl MetricConfig
impl MetricConfig
Sourcepub fn perceptual() -> Self
pub fn perceptual() -> Self
Perceptual metrics only (DSSIM, SSIMULACRA2, Butteraugli). RECOMMENDED.
Sourcepub fn perceptual_xyb() -> Self
pub fn perceptual_xyb() -> Self
Perceptual metrics with XYB roundtrip. RECOMMENDED for XYB codecs.
Same as perceptual() but with XYB roundtrip enabled.
This gives fairer comparisons for codecs that operate in XYB color space
(like jpegli) by isolating compression error from color space conversion error.
Sourcepub fn ssimulacra2_only() -> Self
pub fn ssimulacra2_only() -> Self
SSIMULACRA2 only - good balance of speed and accuracy.
Sourcepub fn with_xyb_roundtrip(self) -> Self
pub fn with_xyb_roundtrip(self) -> Self
Enable XYB roundtrip on this config.
Trait Implementations§
Source§impl Clone for MetricConfig
impl Clone for MetricConfig
Source§fn clone(&self) -> MetricConfig
fn clone(&self) -> MetricConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetricConfig
impl Debug for MetricConfig
Source§impl Default for MetricConfig
impl Default for MetricConfig
Source§fn default() -> MetricConfig
fn default() -> MetricConfig
Source§impl<'de> Deserialize<'de> for MetricConfig
impl<'de> Deserialize<'de> for MetricConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MetricConfig
impl RefUnwindSafe for MetricConfig
impl Send for MetricConfig
impl Sync for MetricConfig
impl Unpin for MetricConfig
impl UnwindSafe for MetricConfig
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
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>
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>
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