1#[derive(thiserror::Error, Debug)]
3pub enum ImageError {
4 #[error("Incompatible pixel types")]
6 IncompatiblePixelTypes,
7
8 #[error("Image data is not initialized")]
10 ImageDataNotInitialized,
11
12 #[error("Image data is not contiguous")]
14 ImageDataNotContiguous,
15
16 #[error(transparent)]
18 InvalidImageShape(#[from] kornia_tensor::TensorError),
19
20 #[error("Invalid image size ({0}, {1}) mismatch ({2}, {3})")]
22 InvalidImageSize(usize, usize, usize, usize),
23
24 #[error("Data length ({0}) does not match the image size ({1})")]
26 InvalidChannelShape(usize, usize),
27
28 #[error("Failed to cast image data")]
30 CastError,
31
32 #[error("Channel index {0} is out of bounds {1}")]
34 ChannelIndexOutOfBounds(usize, usize),
35
36 #[error("Pixel coordinate ({0}, {1}) is out of bounds ({2}, {3})")]
38 PixelIndexOutOfBounds(usize, usize, usize, usize),
39
40 #[error("Invalid number of bins {0}")]
42 InvalidHistogramBins(usize),
43
44 #[error("Cannot compute the determinant: matrix is singular")]
46 CannotComputeDeterminant,
47
48 #[error("Invalid kernel length {0} and {1}")]
50 InvalidKernelLength(usize, usize),
51
52 #[error("Invalid sigma values {0} and {1}")]
54 InvalidSigmaValue(f32, f32),
55
56 #[error("Unsupported channel count {0}")]
58 UnsupportedChannelCount(usize),
59}