use thiserror::Error;
#[derive(Debug, Error, PartialEq)]
pub enum Error {
#[cfg(feature = "image")]
#[error("NDArray had an error during initializaiton of shape: {0}")]
NDArray(#[from] ndarray::ShapeError),
#[error("Image could not be constructed from ndarray.")]
ImageConstructFailed,
#[error(
"Image could not be constructed from ndarray because output does not match input channel count."
)]
ChannelMismatch,
#[error("Only 2d and 3d arrays are supported.")]
Dimensions,
}
#[cfg(feature = "image")]
pub type Result<T> = core::result::Result<T, Error>;