1#![allow(dead_code)]
3#![allow(non_upper_case_globals)]
4
5pub type ChunkType = [u8; 4];
6
7pub const IHDR: ChunkType = [b'I', b'H', b'D', b'R'];
11pub const PLTE: ChunkType = [b'P', b'L', b'T', b'E'];
13pub const IDAT: ChunkType = [b'I', b'D', b'A', b'T'];
15pub const IEND: ChunkType = [b'I', b'E', b'N', b'D'];
17
18pub const tRNS: ChunkType = [b't', b'R', b'N', b'S'];
22pub const bKGD: ChunkType = [b'b', b'K', b'G', b'D'];
24pub const tIME: ChunkType = [b't', b'I', b'M', b'E'];
26pub const pHYs: ChunkType = [b'p', b'H', b'Y', b's'];
28
29pub const acTL: ChunkType = [b'a', b'c', b'T', b'L'];
33pub const fcTL: ChunkType = [b'f', b'c', b'T', b'L'];
35pub const fdAT: ChunkType = [b'f', b'd', b'A', b'T'];
37
38pub fn is_critical(type_: ChunkType) -> bool {
42 type_[0] & 32 == 0
43}
44
45pub fn is_private(type_: ChunkType) -> bool {
47 type_[1] & 32 != 0
48}
49
50pub fn reserved_set(type_: ChunkType) -> bool {
53 type_[2] & 32 != 0
54}
55
56pub fn safe_to_copy(type_: ChunkType) -> bool {
58 type_[3] & 32 != 0
59}