1 2 3 4 5 6 7 8 9 10 11 12 13 14
#[derive(Debug)] pub enum Format { UNKNOWN, RGB8, RGBA8, } fn pixel_length(f: Format) -> u32 { match f { Format::UNKNOWN => logf!("UNKNOWN pixel format."), Format::RGB8 => 3, Format::RGBA8 => 4, } }