#[derive(thiserror::Error, Debug)]
pub enum ImageError {
#[error("Incompatible pixel types")]
IncompatiblePixelTypes,
#[error("Image data is not initialized")]
ImageDataNotInitialized,
#[error("Image data is not contiguous")]
ImageDataNotContiguous,
#[error(transparent)]
InvalidImageShape(#[from] kornia_tensor::TensorError),
#[error("Invalid image size ({0}, {1}) mismatch ({2}, {3})")]
InvalidImageSize(usize, usize, usize, usize),
#[error("Data length ({0}) does not match the image size ({1})")]
InvalidChannelShape(usize, usize),
#[error("Failed to cast image data")]
CastError,
#[error("Channel index {0} is out of bounds {1}")]
ChannelIndexOutOfBounds(usize, usize),
#[error("Pixel coordinate ({0}, {1}) is out of bounds ({2}, {3})")]
PixelIndexOutOfBounds(usize, usize, usize, usize),
#[error("Invalid number of bins {0}")]
InvalidHistogramBins(usize),
#[error("Cannot compute the determinant: matrix is singular")]
CannotComputeDeterminant,
#[error("Invalid kernel length {0} and {1}")]
InvalidKernelLength(usize, usize),
#[error("Invalid sigma values {0} and {1}")]
InvalidSigmaValue(f32, f32),
#[error("Unsupported channel count {0}")]
UnsupportedChannelCount(usize),
}