cursive-image 0.0.6

Image view for the Cursive TUI library
Documentation
//
// ImageFormat
//

/// Natively supported image format.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ImageFormat {
    /// PNG.
    PNG,

    /// RGB (24 bits per pixel).
    RGB,

    /// RGBA (32 bits per pixel).
    RGBA,
}

impl ImageFormat {
    /// Whether it's a raw stream of pixels.
    pub fn is_raw(&self) -> bool {
        matches!(self, Self::RGB | Self::RGBA)
    }
}