Generic Trace Generator (GTG) 0.1
GTGColor.h
Go to the documentation of this file.
1
9#ifndef _GTGCOLOR_H_
10#define _GTGCOLOR_H_
11
12#include <stdint.h>
13
18typedef uint32_t gtg_rgb_color_t;
19
31typedef struct gtg_color* gtg_color_t;
32
33/* In a 4-byte value, the first byte corresponds to blue,
34 * the second to green, the third to red. The 4th byte is
35 * unused (for now). ie. a color is represented as follows:
36 * 0x00rrggbb
37 */
38#define GTG_COLOR_BLUE_POS 0
39#define GTG_COLOR_GREEN_POS 8
40#define GTG_COLOR_RED_POS 16
41
42#define GTG_COLOR_BLUE_MASK (0x000000ff << GTG_COLOR_BLUE_POS)
43#define GTG_COLOR_GREEN_MASK (0x000000ff << GTG_COLOR_GREEN_POS)
44#define GTG_COLOR_RED_MASK (0x000000ff << GTG_COLOR_RED_POS)
45
51static inline uint8_t
56
62static inline uint8_t
67
73static inline uint8_t
78
79
85static inline gtg_rgb_color_t
86GTG_COLOR_SET_COLOR(uint8_t r, uint8_t g, uint8_t b)
87{
88 return ((r << GTG_COLOR_RED_POS) |
89 (g << GTG_COLOR_GREEN_POS) |
90 (b << GTG_COLOR_BLUE_POS));
91}
92
93
100
106extern gtg_color_t GTG_RED;
107
114
120extern gtg_color_t GTG_BLUE;
121
128
134extern gtg_color_t GTG_TEAL;
135
142
149
156
163
170
177
183extern gtg_color_t GTG_PINK;
184
191
198
204extern gtg_color_t GTG_KAKI;
205
212
219
226
233
240
247
250
251gtg_color_t gtg_color_create( const char *name, uint8_t r, uint8_t g, uint8_t b);
253
254#endif /* _GTGCOLOR_H_ */
static gtg_rgb_color_t GTG_COLOR_SET_COLOR(uint8_t r, uint8_t g, uint8_t b)
Definition GTGColor.h:86
static uint8_t GTG_COLOR_GET_BLUE(gtg_rgb_color_t rgb)
Definition GTGColor.h:52
static uint8_t GTG_COLOR_GET_RED(gtg_rgb_color_t rgb)
Definition GTGColor.h:74
gtg_color_t GTG_PURPLE
gtg_color_t GTG_RED
static uint8_t GTG_COLOR_GET_GREEN(gtg_rgb_color_t rgb)
Definition GTGColor.h:63
gtg_color_t GTG_ORANGE
gtg_color_t GTG_WHITE
#define GTG_COLOR_GREEN_MASK
Definition GTGColor.h:43
#define GTG_COLOR_BLUE_POS
Definition GTGColor.h:38
void gtg_color_exit()
gtg_color_t GTG_YELLOW
gtg_color_t GTG_DARKGREY
#define GTG_COLOR_BLUE_MASK
Definition GTGColor.h:42
gtg_color_t GTG_DARKBLUE
gtg_color_t GTG_SEABLUE
struct gtg_color * gtg_color_t
Definition GTGColor.h:31
gtg_color_t GTG_BLACK
gtg_color_t GTG_BROWN
gtg_color_t GTG_PINK
uint32_t gtg_rgb_color_t
Definition GTGColor.h:18
gtg_color_t GTG_LIGHTGREY
gtg_color_t GTG_GRENAT
gtg_color_t gtg_color_create(const char *name, uint8_t r, uint8_t g, uint8_t b)
gtg_color_t GTG_LIGHTBROWN
#define GTG_COLOR_RED_MASK
Definition GTGColor.h:44
void gtg_color_free(gtg_color_t color)
#define GTG_COLOR_RED_POS
Definition GTGColor.h:40
gtg_color_t GTG_BLUE
gtg_color_t GTG_DARKPINK
void gtg_color_init()
gtg_color_t GTG_GREEN
gtg_color_t GTG_LIGHTPINK
gtg_color_t GTG_MAUVE
gtg_color_t GTG_TEAL
gtg_color_t GTG_REDBLOOD
#define GTG_COLOR_GREEN_POS
Definition GTGColor.h:39
gtg_color_t GTG_KAKI
This structure defines a color that can be used by GTG.
Definition GTGColor.h:25
gtg_rgb_color_t rgb
Definition GTGColor.h:28
char * color_name
Definition GTGColor.h:27