Add unique stream-end marker (7 zeros and one 1)

This commit is contained in:
Ivan Smirnov 2021-12-29 16:07:54 +03:00
commit 6640bc571a
3 changed files with 10 additions and 8 deletions

View file

@ -20,7 +20,9 @@ pub const QOI_MASK_3: u8 = 0xe0; // (111)00000
pub const QOI_MASK_4: u8 = 0xf0; // (1111)0000
pub const QOI_HEADER_SIZE: usize = 14;
pub const QOI_PADDING: usize = 4;
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;
pub const QOI_MAGIC: u32 =
(b'q' as u32) << 24 | (b'o' as u32) << 16 | (b'i' as u32) << 8 | (b'f' as u32);