From 371c86bf3f4d1708fc40db2aa7fa572eb429d0b4 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 7 Dec 2012 01:50:52 -0500 Subject: 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 --- apps/plugins/lib/grey.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'apps/plugins/lib/grey.h') 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); void grey_show(bool enable); void grey_deferred_lcd_update(void); +/* Viewports and framebuffers */ +void grey_clear_viewport(void); +void grey_set_viewport(struct viewport *vp); +void grey_viewport_set_fullscreen(struct viewport *vp, + const enum screen_type screen); +void grey_viewport_set_pos(struct viewport *vp, + int x, int y, int width, int height); +void grey_set_framebuffer(unsigned char *buffer); +void grey_framebuffer_set_pos(int x, int y, int width, int height); + /* Update functions */ void grey_update(void); void grey_update_rect(int x, int y, int width, int height); @@ -175,13 +185,23 @@ struct _grey_info unsigned char *values; /* start of greyscale pixel values */ unsigned char *phases; /* start of greyscale pixel phases */ unsigned char *buffer; /* start of chunky pixel buffer (for buffered mode) */ + unsigned char *curbuffer; /* start of current framebuffer (for buffered mode) */ + int cb_x; /* horizontal position of current framebuffer (for buffered mode) */ + int cb_y; /* vertical position of current framebuffer (for buffered mode) */ + int cb_width; /* width of current framebuffer (for buffered mode) */ + int cb_height; /* height of current framebuffer (for buffered mode) */ + int clip_l; + int clip_t; + int clip_r; + int clip_b; unsigned char gvalue[256]; /* calculated brightness -> greyvalue table */ - int fg_brightness; /* current foreground brightness */ - int bg_brightness; /* current background brightness */ - int drawmode; /* current draw mode */ - int curfont; /* current selected font */ + struct viewport *vp; /* current viewport in use */ }; +/* Stuff these here for now. LCD depth of 1 has no 'pattern' members. */ +#define _GREY_FG_BRIGHTNESS(vp) ((vp)->flags) +#define _GREY_BG_BRIGHTNESS(vp) ((vp)->line_height) + /* Global variable, defined in the plugin */ extern struct _grey_info _grey_info; -- cgit v1.2.3