-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathimage.rs
109 lines (99 loc) · 1.89 KB
/
image.rs
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#[macro_use] extern crate enum_primitive;
mod gif {
enum_from_primitive! {
/// Known block types
enum Block {
Image = 0x2C,
Extension = 0x21,
Trailer = 0x3B
}
}
enum_from_primitive! {
/// Known GIF extensions
enum Extension {
Text = 0x01,
Control = 0xF9,
Comment = 0xFE,
Application = 0xFF
}
}
enum_from_primitive! {
/// Method to dispose the image
enum DisposalMethod {
Undefined = 0,
None = 1,
Previous = 2,
Background = 3
}
}
}
mod png {
enum_from_primitive! {
#[derive(Clone, Copy, Debug, PartialEq)]
enum InterlaceMethod {
None = 0,
Adam7 = 1
}
}
enum_from_primitive! {
#[derive(Debug)]
pub enum FilterType {
NoFilter = 0,
Sub = 1,
Up = 2,
Avg = 3,
Paeth = 4
}
}
}
mod tiff {
enum_from_primitive! {
#[derive(Clone, Copy, Debug, PartialEq)]
enum PhotometricInterpretation {
WhiteIsZero = 0,
BlackIsZero = 1,
RGB = 2,
RGBPalette = 3,
TransparencyMask = 4,
CMYK = 5,
YCbCr = 6,
CIELab = 8,
}
}
enum_from_primitive! {
#[derive(Clone, Copy, Debug)]
enum CompressionMethod {
None = 1,
Huffman = 2,
Fax3 = 3,
Fax4 = 4,
LZW = 5,
JPEG = 6,
PackBits = 32773
}
}
enum_from_primitive! {
#[derive(Clone, Copy, Debug)]
enum PlanarConfiguration {
Chunky = 1,
Planar = 2
}
}
enum_from_primitive! {
#[derive(Clone, Copy, Debug)]
enum Predictor {
None = 1,
Horizontal = 2
}
}
enum_from_primitive! {
#[derive(Clone, Copy, Debug)]
pub enum Type {
BYTE = 1,
ASCII = 2,
SHORT = 3,
LONG = 4,
RATIONAL = 5,
}
}
}