-
Notifications
You must be signed in to change notification settings - Fork 0
/
palette.h
91 lines (73 loc) · 2.24 KB
/
palette.h
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
#ifndef PALETTE_H
#define PALETTE_H
#include <vector>
struct Palette {
const char *name;
Palette(const char *_name) {
name = _name;
}
virtual ~Palette() {}
virtual void setColor(const float _val, const float _scale, unsigned char *_map) = 0;
float clamp(const float _v, const float _min, const float _max);
};
struct BlackWhite: Palette {
BlackWhite() : Palette("Black White") {}
~BlackWhite() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Cool : Palette {
Cool() : Palette("Cool") {}
~Cool() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Hot : Palette {
Hot() : Palette("Hot") {}
~Hot() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Jet : Palette {
Jet() : Palette("Jet") {}
~Jet() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct PurpleBlue : Palette {
PurpleBlue() : Palette("Purple Blue") {}
~PurpleBlue() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct HotMetal : Palette {
HotMetal() : Palette("Hot Metal") {}
~HotMetal() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Autumn : Palette {
Autumn() : Palette("Autumn") {}
~Autumn() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Spring : Palette {
Spring() : Palette("Spring") {}
~Spring() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Summer : Palette {
Summer() : Palette("Summer") {}
~Summer() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct Winter : Palette {
Winter() : Palette("Winter") {}
~Winter() {}
void setColor(const float _val, const float _scale, unsigned char *_map);
};
struct PaletteList {
std::vector<Palette *> items;
unsigned char *map;
unsigned int mapSize;
PaletteList();
~PaletteList();
const char * getName(const unsigned int _index);
unsigned int getCount(void);
unsigned char *generate(const char *_name, const unsigned int _depth);
};
#endif // PALETTE_H