#[non_exhaustive]pub enum ValidationError {
Show 14 variants
DistanceOutOfRange {
value: f32,
valid: RangeInclusive<f32>,
},
DistanceNotFinite {
value: f32,
},
EffortOutOfRange {
value: u8,
valid: RangeInclusive<u8>,
},
IterCountOutOfRange {
name: &'static str,
value: u32,
valid: RangeInclusive<u32>,
},
QualityLoopMutuallyExclusive {
first: &'static str,
second: &'static str,
},
FineGrainedStepOutOfRange {
value: u8,
valid: RangeInclusive<u8>,
},
KInfoLossMulBaseInvalid {
value: f32,
},
KAcQuantInvalid {
value: f32,
},
NbRctsToTryOutOfRange {
value: u8,
valid: RangeInclusive<u8>,
},
WpNumParamSetsOutOfRange {
value: u8,
valid: RangeInclusive<u8>,
},
TreeMaxBucketsZero,
TreeNumPropertiesOutOfRange {
value: u8,
valid: RangeInclusive<u8>,
},
TreeThresholdBaseInvalid {
value: f32,
},
TreeSampleFractionOutOfRange {
value: f32,
valid: RangeInclusive<f32>,
},
}Expand description
Errors produced by validate() on the public config types.
#[non_exhaustive] so new variants can land additively as we discover
further invariants worth surfacing.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DistanceOutOfRange
Butteraugli distance is outside the libjxl-supported range.
libjxl rejects distances <= 0.0 (for lossy) and clamps the upper
end to 25.0. 0.0 is mathematically lossless and is not
accepted on LossyConfig; use LosslessConfig instead.
DistanceNotFinite
Distance was non-finite (NaN or infinity).
EffortOutOfRange
Effort level outside 1..=10.
(EffortProfile::lossy / lossless clamp internally; this surfaces
the violation up front instead of silently coercing.)
IterCountOutOfRange
A quality-loop iteration count exceeds the encoder’s reasonable cap. libjxl uses up to 4 butteraugli iterations at kTortoise; we accept up to 16 across all loops to leave headroom for the tuning harness.
QualityLoopMutuallyExclusive
Two or more quality loops are simultaneously requested. The lossy encoder runs at most one quality loop per encode (butteraugli, ssim2, or zensim) — picking which is the caller’s choice. Stacking is not a supported configuration.
FineGrainedStepOutOfRange
fine_grained_step outside 1..=8. 0 would cause the AC strategy
search loop’s step_by(0) to panic.
KInfoLossMulBaseInvalid
k_info_loss_mul_base is non-finite or non-positive. The encoder
multiplies pixel-domain error terms by this; non-positive values
invert the cost model.
KAcQuantInvalid
k_ac_quant is non-finite or non-positive. Used as the
quantization-cost constant when materializing the initial quant field;
non-positive values produce a zero/negative initial quant.
NbRctsToTryOutOfRange
nb_rcts_to_try exceeds libjxl’s documented kTortoise schedule (19).
WpNumParamSetsOutOfRange
wp_num_param_sets exceeds the maximum number of WP modes the
encoder iterates over (5).
TreeMaxBucketsZero
tree_max_buckets is zero — the histogram quantizer needs at least
one bucket per property.
TreeNumPropertiesOutOfRange
tree_num_properties exceeds the property-order length (16, the size
of PROP_ORDER_NO_SQUEEZE / PROP_ORDER_SQUEEZE in
src/modular/tree_learn.rs).
TreeThresholdBaseInvalid
tree_threshold_base is non-finite or negative. libjxl’s formula is
75 + 14 * speed_tier; negative thresholds would accept every split.
TreeSampleFractionOutOfRange
tree_sample_fraction is non-finite or outside 0.0..=1.0. It is a
pixel-fraction sampler ratio.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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<E> ErrorAtExt for Ewhere
E: Error,
impl<E> ErrorAtExt for Ewhere
E: Error,
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