diff options
Diffstat (limited to 'firmware/export/screendump.h')
-rw-r--r-- | firmware/export/screendump.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/firmware/export/screendump.h b/firmware/export/screendump.h new file mode 100644 index 0000000000..515db08a70 --- /dev/null +++ b/firmware/export/screendump.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Jens Arnold | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #ifndef __SCREENDUMP_H__ | ||
23 | #define __SCREENDUMP_H__ | ||
24 | |||
25 | #include "config.h" | ||
26 | |||
27 | /* Make BMP colour map entries from R, G, B triples, without and with blending. | ||
28 | * Not within HAVE_LCD_BITMAP because it is also used for the Player sim */ | ||
29 | #define RED_CMP(c) (((c) >> 16) & 0xff) | ||
30 | #define GREEN_CMP(c) (((c) >> 8) & 0xff) | ||
31 | #define BLUE_CMP(c) ((c) & 0xff) | ||
32 | |||
33 | #define BMP_COLOR(c) BLUE_CMP(c), GREEN_CMP(c), RED_CMP(c), 0 | ||
34 | #define BMP_COLOR_MIX(c1, c2, num, den) \ | ||
35 | (BLUE_CMP(c2) - BLUE_CMP(c1)) * (num) / (den) + BLUE_CMP(c1), \ | ||
36 | (GREEN_CMP(c2) - GREEN_CMP(c1)) * (num) / (den) + GREEN_CMP(c1), \ | ||
37 | (RED_CMP(c2) - RED_CMP(c1)) * (num) / (den) + RED_CMP(c1), 0 | ||
38 | |||
39 | #define LE16_CONST(x) (x)&0xff, ((x)>>8)&0xff | ||
40 | #define LE32_CONST(x) (x)&0xff, ((x)>>8)&0xff, ((x)>>16)&0xff, ((x)>>24)&0xff | ||
41 | |||
42 | |||
43 | #ifdef BOOTLOADER | ||
44 | |||
45 | #define screen_dump() | ||
46 | #define remote_screen_dump() | ||
47 | |||
48 | #else /* !BOOTLOADER */ | ||
49 | |||
50 | #ifdef HAVE_LCD_BITMAP | ||
51 | /* Save a .BMP file containing the current screen contents. */ | ||
52 | void screen_dump(void); | ||
53 | void screen_dump_set_hook(void (*hook)(int fd)); | ||
54 | #endif | ||
55 | #ifdef HAVE_REMOTE_LCD | ||
56 | /* Save a .BMP file containing the current remote screen contents. */ | ||
57 | void remote_screen_dump(void); | ||
58 | #endif | ||
59 | |||
60 | #endif /* !BOOTLOADER */ | ||
61 | |||
62 | #endif /* __SCREENDUMP_H__ */ | ||