summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/grey.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-12-07 01:50:52 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-12-18 19:16:26 -0500
commit371c86bf3f4d1708fc40db2aa7fa572eb429d0b4 (patch)
treebe339c62eac616ac6938c2929349b72377c10ee2 /apps/plugins/lib/grey.h
parentf668c3624184fedc14d34f87ad7b5f1e43bc87a1 (diff)
downloadrockbox-371c86bf3f4d1708fc40db2aa7fa572eb429d0b4.tar.gz
rockbox-371c86bf3f4d1708fc40db2aa7fa572eb429d0b4.zip
Adapt OSD in plugin lib to be greylib compatible.
Requires addition of viewports and alternate framebuffers to greylib which are essentially similar to the core implementation except that the framebuffer can be any size and relationship to a viewport. Drawing is always fully clipped to the intersecting area. Adapt oscilloscope.c to the API change. FFT will use the new features (later update). Get rid of silly and wrong lcd_bmp_part use in OSD. Remove it from plugin API (must be made incompatible now). Change-Id: Iafa5e2174148fb8ad11db6b9d4add0dcabc5c563
Diffstat (limited to 'apps/plugins/lib/grey.h')
-rw-r--r--apps/plugins/lib/grey.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/apps/plugins/lib/grey.h b/apps/plugins/lib/grey.h
index 7c990ad792..d63d19ee4a 100644
--- a/apps/plugins/lib/grey.h
+++ b/apps/plugins/lib/grey.h
@@ -60,6 +60,16 @@ void grey_release(void);
60void grey_show(bool enable); 60void grey_show(bool enable);
61void grey_deferred_lcd_update(void); 61void grey_deferred_lcd_update(void);
62 62
63/* Viewports and framebuffers */
64void grey_clear_viewport(void);
65void grey_set_viewport(struct viewport *vp);
66void grey_viewport_set_fullscreen(struct viewport *vp,
67 const enum screen_type screen);
68void grey_viewport_set_pos(struct viewport *vp,
69 int x, int y, int width, int height);
70void grey_set_framebuffer(unsigned char *buffer);
71void grey_framebuffer_set_pos(int x, int y, int width, int height);
72
63/* Update functions */ 73/* Update functions */
64void grey_update(void); 74void grey_update(void);
65void grey_update_rect(int x, int y, int width, int height); 75void grey_update_rect(int x, int y, int width, int height);
@@ -175,13 +185,23 @@ struct _grey_info
175 unsigned char *values; /* start of greyscale pixel values */ 185 unsigned char *values; /* start of greyscale pixel values */
176 unsigned char *phases; /* start of greyscale pixel phases */ 186 unsigned char *phases; /* start of greyscale pixel phases */
177 unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */ 187 unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */
188 unsigned char *curbuffer; /* start of current framebuffer (for buffered mode) */
189 int cb_x; /* horizontal position of current framebuffer (for buffered mode) */
190 int cb_y; /* vertical position of current framebuffer (for buffered mode) */
191 int cb_width; /* width of current framebuffer (for buffered mode) */
192 int cb_height; /* height of current framebuffer (for buffered mode) */
193 int clip_l;
194 int clip_t;
195 int clip_r;
196 int clip_b;
178 unsigned char gvalue[256]; /* calculated brightness -> greyvalue table */ 197 unsigned char gvalue[256]; /* calculated brightness -> greyvalue table */
179 int fg_brightness; /* current foreground brightness */ 198 struct viewport *vp; /* current viewport in use */
180 int bg_brightness; /* current background brightness */
181 int drawmode; /* current draw mode */
182 int curfont; /* current selected font */
183}; 199};
184 200
201/* Stuff these here for now. LCD depth of 1 has no 'pattern' members. */
202#define _GREY_FG_BRIGHTNESS(vp) ((vp)->flags)
203#define _GREY_BG_BRIGHTNESS(vp) ((vp)->line_height)
204
185/* Global variable, defined in the plugin */ 205/* Global variable, defined in the plugin */
186extern struct _grey_info _grey_info; 206extern struct _grey_info _grey_info;
187 207