summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/gray.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/gray.h')
-rw-r--r--apps/plugins/lib/gray.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/apps/plugins/lib/gray.h b/apps/plugins/lib/gray.h
new file mode 100644
index 0000000000..64bc4dd8a5
--- /dev/null
+++ b/apps/plugins/lib/gray.h
@@ -0,0 +1,80 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Grayscale framework
11*
12* Copyright (C) 2004 Jens Arnold
13*
14* All files in this archive are subject to the GNU General Public License.
15* See the file COPYING in the source tree root for full license agreement.
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 __GRAY_H__
23#define __GRAY_H__
24
25#ifndef SIMULATOR /* not for simulator by now */
26#include "plugin.h"
27
28#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
29
30/* This is a generic framework to use grayscale display within rockbox
31 * plugins. It obviously does not work for the player.
32 */
33
34/* every framework needs such a function, and it has to be called as
35 * the very first one */
36void gray_init(struct plugin_api* newrb);
37
38/* general functions */
39int gray_init_buffer(unsigned char *gbuf, int gbuf_size, int width,
40 int bheight, int depth);
41void gray_release_buffer(void);
42void gray_position_display(int x, int by);
43void gray_show_display(bool enable);
44
45/* functions affecting the whole display */
46void gray_clear_display(void);
47void gray_black_display(void);
48void gray_deferred_update(void);
49
50/* scrolling functions */
51void gray_scroll_left(int count, bool black_border);
52void gray_scroll_right(int count, bool black_border);
53void gray_scroll_up8(bool black_border);
54void gray_scroll_down8(bool black_border);
55void gray_scroll_up(int count, bool black_border);
56void gray_scroll_down(int count, bool black_border);
57
58/* pixel functions */
59void gray_drawpixel(int x, int y, int brightness);
60void gray_invertpixel(int x, int y);
61
62/* line functions */
63void gray_drawline(int x1, int y1, int x2, int y2, int brightness);
64void gray_invertline(int x1, int y1, int x2, int y2);
65
66/* rectangle functions */
67void gray_drawrect(int x1, int y1, int x2, int y2, int brightness);
68void gray_fillrect(int x1, int y1, int x2, int y2, int brightness);
69void gray_invertrect(int x1, int y1, int x2, int y2);
70
71/* bitmap functions */
72void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny,
73 int stride);
74void gray_drawbitmap(unsigned char *src, int x, int y, int nx, int ny,
75 int stride, bool draw_bg, int fg_brightness,
76 int bg_brightness);
77
78#endif /* HAVE_LCD_BITMAP */
79#endif /* SIMULATOR */
80#endif /* __GRAY_H__ */