1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2009 by Jens Arnold
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef __SCREENDUMP_H__
23 #define __SCREENDUMP_H__
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)
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
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
46 #define remote_screen_dump()
48 #else /* !BOOTLOADER */
50 /* Save a .BMP file containing the current screen contents. */
51 void screen_dump(void);
53 #ifdef HAVE_LCD_BITMAP
54 void screen_dump_set_hook(void (*hook
)(int fd
));
57 #ifdef HAVE_REMOTE_LCD
58 /* Save a .BMP file containing the current remote screen contents. */
59 void remote_screen_dump(void);
62 #endif /* !BOOTLOADER */
64 #endif /* __SCREENDUMP_H__ */