1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// // 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) } }