-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconversions.cxx
65 lines (60 loc) · 1.02 KB
/
conversions.cxx
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
#include "apng.hxx"
bitDepth_t::bitDepth_t(const uint8_t depth)
{
if (depth == 1)
value = bps1;
else if (depth == 2)
value = bps2;
else if (depth == 4)
value = bps4;
else if (depth == 8)
value = bps8;
else if (depth == 16)
value = bps16;
else
throw invalidPNG_t();
}
colourType_t::colourType_t(const uint8_t type)
{
if (type == 0)
value = greyscale;
else if (type == 2)
value = rgb;
else if (type == 3)
value = palette;
else if (type == 4)
value = greyscaleAlpha;
else if (type == 6)
value = rgba;
else
throw invalidPNG_t();
}
interlace_t::interlace_t(const uint8_t type)
{
if (type == 0)
value = none;
else if (type == 1)
value = adam7;
else
throw invalidPNG_t();
}
disposeOp_t::disposeOp_t(const uint8_t op)
{
if (op == 0)
value = none;
else if (op == 1)
value = background;
else if (op == 2)
value = previous;
else
throw invalidPNG_t();
}
blendOp_t::blendOp_t(const uint8_t op)
{
if (op == 0)
value = source;
else if (op == 1)
value = over;
else
throw invalidPNG_t();
}