Skip to main content

cursive_image/image/
format.rs

1//
2// ImageFormat
3//
4
5/// Natively supported image format.
6#[derive(Clone, Copy, Debug, Eq, PartialEq)]
7pub enum ImageFormat {
8    /// PNG.
9    PNG,
10
11    /// RGB (24 bits per pixel).
12    RGB,
13
14    /// RGBA (32 bits per pixel).
15    RGBA,
16}
17
18impl ImageFormat {
19    /// Whether it's a raw stream of pixels.
20    pub fn is_raw(&self) -> bool {
21        matches!(self, Self::RGB | Self::RGBA)
22    }
23}