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