2021-12-29 19:41:39 +00:00
|
|
|
pub const QOI_OP_INDEX: u8 = 0x00; // 00xxxxxx
|
|
|
|
pub const QOI_OP_DIFF: u8 = 0x40; // 01xxxxxx
|
|
|
|
pub const QOI_OP_LUMA: u8 = 0x80; // 10xxxxxx
|
|
|
|
pub const QOI_OP_RUN: u8 = 0xc0; // 11xxxxxx
|
|
|
|
pub const QOI_OP_RGB: u8 = 0xfe; // 11111110
|
|
|
|
pub const QOI_OP_RGBA: u8 = 0xff; // 11111111
|
2021-11-28 12:36:12 +00:00
|
|
|
|
2021-11-29 13:58:11 +00:00
|
|
|
pub const QOI_MASK_2: u8 = 0xc0; // (11)000000
|
2021-11-28 12:36:12 +00:00
|
|
|
|
|
|
|
pub const QOI_HEADER_SIZE: usize = 14;
|
2021-12-29 13:07:54 +00:00
|
|
|
|
|
|
|
pub const QOI_PADDING: [u8; 8] = [0, 0, 0, 0, 0, 0, 0, 0x01]; // 7 zeros and one 0x01 marker
|
|
|
|
pub const QOI_PADDING_SIZE: usize = 8;
|
2021-11-28 12:36:12 +00:00
|
|
|
|
2021-11-29 22:38:09 +00:00
|
|
|
pub const QOI_MAGIC: u32 =
|
|
|
|
(b'q' as u32) << 24 | (b'o' as u32) << 16 | (b'i' as u32) << 8 | (b'f' as u32);
|
2021-12-29 13:00:16 +00:00
|
|
|
|
|
|
|
pub const QOI_PIXELS_MAX: usize = 400_000_000;
|