FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / firmware / export / screendump.h
blob87b32c6beef4a84155480b468d5e03dba99fe9e5
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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__
25 #include "config.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
43 #ifdef BOOTLOADER
45 #define screen_dump()
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));
55 #endif
57 #ifdef HAVE_REMOTE_LCD
58 /* Save a .BMP file containing the current remote screen contents. */
59 void remote_screen_dump(void);
60 #endif
62 #endif /* !BOOTLOADER */
64 #endif /* __SCREENDUMP_H__ */