pub enum IntensityMetricError {
ShapeMismatch {
reference: (usize, usize),
estimate: (usize, usize),
},
MaskShapeMismatch {
actual: (usize, usize),
expected: (usize, usize),
},
EmptyValidMask,
UnsupportedScalar {
input: &'static str,
},
NonFinite {
input: &'static str,
},
ZeroReferenceNormalization {
metric: &'static str,
},
ZeroVariance,
NegativeIntensity {
metric: &'static str,
},
InvalidDataRange,
InvalidEpsilon,
SsimImageTooSmall {
shape: (usize, usize),
},
NoValidSsimWindow,
}Expand description
Errors returned by intensity comparison metrics.
Variants§
ShapeMismatch
Reference and estimate have different (height, width) shapes.
Fields
MaskShapeMismatch
A validity mask does not match the image shape.
EmptyValidMask
No pixel was selected by the optional mask.
UnsupportedScalar
A generic scalar could not be represented as f64.
NonFinite
An input contains NaN or infinity.
ZeroReferenceNormalization
A relative metric has zero reference norm.
ZeroVariance
Pearson correlation is undefined because an input has zero variance.
NegativeIntensity
A square-root or Poisson metric received a negative intensity.
InvalidDataRange
PSNR or SSIM received a non-positive or non-finite data range.
InvalidEpsilon
A Poisson metric received a non-positive or non-finite numerical floor.
SsimImageTooSmall
An image is smaller than the canonical 11-by-11 SSIM window.
NoValidSsimWindow
A mask excludes every complete SSIM window.
Trait Implementations§
Source§impl Debug for IntensityMetricError
impl Debug for IntensityMetricError
Source§impl Display for IntensityMetricError
impl Display for IntensityMetricError
Source§impl Error for IntensityMetricError
impl Error for IntensityMetricError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for IntensityMetricError
impl PartialEq for IntensityMetricError
Source§fn eq(&self, other: &IntensityMetricError) -> bool
fn eq(&self, other: &IntensityMetricError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for IntensityMetricError
Auto Trait Implementations§
impl Freeze for IntensityMetricError
impl RefUnwindSafe for IntensityMetricError
impl Send for IntensityMetricError
impl Sync for IntensityMetricError
impl Unpin for IntensityMetricError
impl UnsafeUnpin for IntensityMetricError
impl UnwindSafe for IntensityMetricError
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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more