pub struct ButteraugliParams { /* private fields */ }Expand description
Butteraugli parameters (from butteraugli).
Configure intensity target, HF asymmetry, and other parameters. Butteraugli comparison parameters.
Use the builder pattern to construct:
use butteraugli::ButteraugliParams;
let params = ButteraugliParams::new()
.with_intensity_target(250.0) // HDR display
.with_hf_asymmetry(1.5) // Penalize new artifacts more
.with_compute_diffmap(true); // Generate per-pixel difference mapImplementations§
Source§impl ButteraugliParams
impl ButteraugliParams
Sourcepub fn new() -> ButteraugliParams
pub fn new() -> ButteraugliParams
Creates a new ButteraugliParams with default values.
Sourcepub fn with_intensity_target(self, intensity_target: f32) -> ButteraugliParams
pub fn with_intensity_target(self, intensity_target: f32) -> ButteraugliParams
Sets the intensity target (display brightness in nits).
Sourcepub fn with_hf_asymmetry(self, hf_asymmetry: f32) -> ButteraugliParams
pub fn with_hf_asymmetry(self, hf_asymmetry: f32) -> ButteraugliParams
Sets the HF asymmetry multiplier. Values > 1.0 penalize new high-frequency artifacts more than blurring.
Sourcepub fn with_xmul(self, xmul: f32) -> ButteraugliParams
pub fn with_xmul(self, xmul: f32) -> ButteraugliParams
Sets the X channel multiplier.
Sourcepub fn with_compute_diffmap(self, compute_diffmap: bool) -> ButteraugliParams
pub fn with_compute_diffmap(self, compute_diffmap: bool) -> ButteraugliParams
Sets whether to compute the per-pixel difference map.
When true, the result will include an ImgVec<f32> difference map.
When false (default), the diffmap field will be None, which is faster.
Sourcepub fn hf_asymmetry(&self) -> f32
pub fn hf_asymmetry(&self) -> f32
Returns the HF asymmetry multiplier.
Sourcepub fn intensity_target(&self) -> f32
pub fn intensity_target(&self) -> f32
Returns the intensity target in nits.
Sourcepub fn compute_diffmap(&self) -> bool
pub fn compute_diffmap(&self) -> bool
Returns whether to compute the per-pixel difference map.
Sourcepub fn with_single_resolution(
self,
single_resolution: bool,
) -> ButteraugliParams
pub fn with_single_resolution( self, single_resolution: bool, ) -> ButteraugliParams
Skip the half-resolution pass for faster approximate results.
The half-resolution pass contributes ~15% weight to the final diffmap. Skipping it saves ~25% of computation. Useful for encoder tuning loops where precise scores aren’t needed.
Sourcepub fn single_resolution(&self) -> bool
pub fn single_resolution(&self) -> bool
Returns whether single-resolution mode is enabled.
Sourcepub fn validate(&self) -> Result<(), ButteraugliError>
pub fn validate(&self) -> Result<(), ButteraugliError>
Validates that all parameter values are in acceptable ranges.
Called automatically by all public entry points. Returns an error if any parameter would cause division by zero, NaN propagation, or garbage results.
§Errors
Returns ButteraugliError::InvalidParameter if:
hf_asymmetryis not finite or not positiveintensity_targetis not finite or not positivexmulis not finite or is negative
Trait Implementations§
Source§impl Clone for ButteraugliParams
impl Clone for ButteraugliParams
Source§fn clone(&self) -> ButteraugliParams
fn clone(&self) -> ButteraugliParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ButteraugliParams
impl Debug for ButteraugliParams
Source§impl Default for ButteraugliParams
impl Default for ButteraugliParams
Source§fn default() -> ButteraugliParams
fn default() -> ButteraugliParams
Auto Trait Implementations§
impl Freeze for ButteraugliParams
impl RefUnwindSafe for ButteraugliParams
impl Send for ButteraugliParams
impl Sync for ButteraugliParams
impl Unpin for ButteraugliParams
impl UnsafeUnpin for ButteraugliParams
impl UnwindSafe for ButteraugliParams
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