diff options
Diffstat (limited to 'apps/misc.h')
-rw-r--r-- | apps/misc.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/misc.h b/apps/misc.h index 22ae4849a4..99e709c2c8 100644 --- a/apps/misc.h +++ b/apps/misc.h | |||
@@ -93,6 +93,18 @@ void screen_dump(void); | |||
93 | void screen_dump_set_hook(void (*hook)(int fh)); | 93 | void screen_dump_set_hook(void (*hook)(int fh)); |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | /* Make BMP colour map entries from R, G, B triples, without and with blending. | ||
97 | * Not within HAVE_LCD_BITMAP because it is also used for the Player sim */ | ||
98 | #define RED_CMP(c) (((c) >> 16) & 0xff) | ||
99 | #define GREEN_CMP(c) (((c) >> 8) & 0xff) | ||
100 | #define BLUE_CMP(c) ((c) & 0xff) | ||
101 | |||
102 | #define BMP_COLOR(c) BLUE_CMP(c), GREEN_CMP(c), RED_CMP(c), 0 | ||
103 | #define BMP_COLOR_MIX(c1, c2, num, den) \ | ||
104 | (BLUE_CMP(c2) - BLUE_CMP(c1)) * (num) / (den) + BLUE_CMP(c1), \ | ||
105 | (GREEN_CMP(c2) - GREEN_CMP(c1)) * (num) / (den) + GREEN_CMP(c1), \ | ||
106 | (RED_CMP(c2) - RED_CMP(c1)) * (num) / (den) + RED_CMP(c1), 0 | ||
107 | |||
96 | bool settings_parseline(char* line, char** name, char** value); | 108 | bool settings_parseline(char* line, char** name, char** value); |
97 | long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); | 109 | long default_event_handler_ex(long event, void (*callback)(void *), void *parameter); |
98 | long default_event_handler(long event); | 110 | long default_event_handler(long event); |