-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpalettes.cpp
100 lines (96 loc) · 1.61 KB
/
palettes.cpp
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
#include "palettes.hpp"
// TODO: these should be read from a file
// TODO: support nonlinear interpolations
// clang-format off
PaletteDef const palettes[] = {
{ 5, true, {
{ 0, 31,
{0, 0, 0},
{0, 0, 63},
},
{32, 63,
{0, 0, 63},
{0, 0, 0},
},
{64, 95,
{0, 0, 0},
{63, 0, 0},
},
{96, 127,
{63, 0, 0},
{0, 0, 0},
},
{128, 255,
{0, 0, 0},
{63, 63, 0},
},
}},
{ 5, true, {
{0, 31,
{0, 0, 0},
{21, 39, 23},
},
{32, 63,
{21, 39, 23},
{63, 19, 0},
},
{64, 95,
{63, 19, 0},
{32, 33, 27},
},
{96, 127,
{32, 33, 27},
{26, 5, 18},
},
{128, 255,
{26, 5, 18},
{63, 63, 0},
},
}},
{ 5, true, {
{0, 31,
{0, 0, 0},
{21, 33, 40},
},
{32, 63,
{21, 33, 40},
{12, 12, 20},
},
{64, 110,
{12, 12, 20},
{43, 33, 38},
},
{111, 127,
{43, 33, 38},
{63, 17, 3},
},
{128, 255,
{63, 17, 3},
{54, 46, 30},
},
}},
{ 5, false, {
{0, 31,
{0, 0, 0},
{57, 57, 63},
},
{32, 63,
{57, 57, 63},
{0, 0, 0},
},
{64, 110,
{0, 0, 0},
{63, 63, 63},
},
{111, 127,
{63, 63, 63},
{0, 0, 0},
},
{128, 255,
{0, 0, 0},
{63, 63, 63},
},
}}
};
// clang-format on
int const NUM_PALETTES = sizeof(palettes) / sizeof(PaletteDef);