diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-05-19 08:18:25 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-05-19 08:18:25 +0000 |
commit | a05c41377469f52fc8c76494c1e9d8d5a2094f9a (patch) | |
tree | 96e5189563588ad66253913999c80b2ac5591f87 /apps/plugins/lib/gray.h | |
parent | f4b52b82eaa29ddddf52474cdc995af24080f933 (diff) | |
download | rockbox-a05c41377469f52fc8c76494c1e9d8d5a2094f9a.tar.gz rockbox-a05c41377469f52fc8c76494c1e9d8d5a2094f9a.zip |
First real library version of the grayscale framework
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4641 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/lib/gray.h')
-rw-r--r-- | apps/plugins/lib/gray.h | 80 |
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 */ | ||
36 | void gray_init(struct plugin_api* newrb); | ||
37 | |||
38 | /* general functions */ | ||
39 | int gray_init_buffer(unsigned char *gbuf, int gbuf_size, int width, | ||
40 | int bheight, int depth); | ||
41 | void gray_release_buffer(void); | ||
42 | void gray_position_display(int x, int by); | ||
43 | void gray_show_display(bool enable); | ||
44 | |||
45 | /* functions affecting the whole display */ | ||
46 | void gray_clear_display(void); | ||
47 | void gray_black_display(void); | ||
48 | void gray_deferred_update(void); | ||
49 | |||
50 | /* scrolling functions */ | ||
51 | void gray_scroll_left(int count, bool black_border); | ||
52 | void gray_scroll_right(int count, bool black_border); | ||
53 | void gray_scroll_up8(bool black_border); | ||
54 | void gray_scroll_down8(bool black_border); | ||
55 | void gray_scroll_up(int count, bool black_border); | ||
56 | void gray_scroll_down(int count, bool black_border); | ||
57 | |||
58 | /* pixel functions */ | ||
59 | void gray_drawpixel(int x, int y, int brightness); | ||
60 | void gray_invertpixel(int x, int y); | ||
61 | |||
62 | /* line functions */ | ||
63 | void gray_drawline(int x1, int y1, int x2, int y2, int brightness); | ||
64 | void gray_invertline(int x1, int y1, int x2, int y2); | ||
65 | |||
66 | /* rectangle functions */ | ||
67 | void gray_drawrect(int x1, int y1, int x2, int y2, int brightness); | ||
68 | void gray_fillrect(int x1, int y1, int x2, int y2, int brightness); | ||
69 | void gray_invertrect(int x1, int y1, int x2, int y2); | ||
70 | |||
71 | /* bitmap functions */ | ||
72 | void gray_drawgraymap(unsigned char *src, int x, int y, int nx, int ny, | ||
73 | int stride); | ||
74 | void 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__ */ | ||