#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Format {
R8,
RG8,
RGB8,
RGBA8,
BC1 = 256,
BC2,
BC3,
BC4,
BC5,
BC6,
BC7,
}
impl Format {
pub const fn block_width(&self) -> u16 {
match self {
Format::R8 | Format::RG8 | Format::RGB8 | Format::RGBA8 => 1,
Format::BC1
| Format::BC2
| Format::BC3
| Format::BC4
| Format::BC5
| Format::BC6
| Format::BC7 => 4,
}
}
pub const fn block_height(&self) -> u16 {
match self {
Format::R8 | Format::RG8 | Format::RGB8 | Format::RGBA8 => 1,
Format::BC1
| Format::BC2
| Format::BC3
| Format::BC4
| Format::BC5
| Format::BC6
| Format::BC7 => 4,
}
}
}