[go: up one dir, main page]

ravif 0.12.0

rav1e-based pure Rust library for encoding images in AVIF format (powers the `cavif` tool)
Documentation
use quick_error::quick_error;

#[derive(Debug)]
#[doc(hidden)]
pub struct EncodingErrorDetail; // maybe later

quick_error! {
    /// Failures enum
    #[derive(Debug)]
    #[non_exhaustive]
    pub enum Error {
        /// Slices given to `encode_raw_planes` must be `width * height` large.
        TooFewPixels {
            display("Provided buffer is smaller than width * height")
        }
        Unsupported(msg: &'static str) {
            display("Not supported: {}", msg)
        }
        EncodingError(e: EncodingErrorDetail) {
            display("Encoding error reported by rav1e")
            from(_e: rav1e::InvalidConfig) -> (EncodingErrorDetail)
            from(_e: rav1e::EncoderStatus) -> (EncodingErrorDetail)
        }
    }
}