use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum FrameError {
UnsupportedBitDepth {
found: u8,
},
DataTypeMismatch,
UnsupportedResolution,
}
impl fmt::Display for FrameError {
#[expect(clippy::missing_inline_in_public_items)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::UnsupportedBitDepth { found } => write!(
f,
"only 8-16 bit frame data is supported, tried to create {found} bit frame"
),
Self::DataTypeMismatch => {
write!(f, "bit depth did not match requested data type")
}
Self::UnsupportedResolution => write!(
f,
"selected chroma subsampling does not support odd resolutions"
),
}
}
}
impl core::error::Error for FrameError {}