aboutsummaryrefslogtreecommitdiffstats
path: root/drv_generic_graphic.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-27 06:14:46 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-02-27 06:14:46 +0000
commit99aac994aa825db8f1bac31e1c748049b45c3b8b (patch)
treea25268ffaeb5bc6340b8c520954fc0e1c8946346 /drv_generic_graphic.c
parentf5ca09365013ad01f33db2d2f58b222d6391b38d (diff)
downloadlcd4linux-99aac994aa825db8f1bac31e1c748049b45c3b8b.tar.gz
[lcd4linux @ 2006-02-27 06:14:46 by reinelt]
graphic bug resulting in all black pixels solved git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@648 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'drv_generic_graphic.c')
-rw-r--r--drv_generic_graphic.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drv_generic_graphic.c b/drv_generic_graphic.c
index 8609bef..ca04ab2 100644
--- a/drv_generic_graphic.c
+++ b/drv_generic_graphic.c
@@ -23,6 +23,9 @@
*
*
* $Log: drv_generic_graphic.c,v $
+ * Revision 1.23 2006/02/27 06:14:46 reinelt
+ * graphic bug resulting in all black pixels solved
+ *
* Revision 1.22 2006/02/24 13:07:10 geronet
* hollow bars for graphic lcd's
*
@@ -167,8 +170,8 @@ int DROWS, DCOLS; /* display size (pixels!) */
int XRES, YRES; /* pixels of one char cell */
/* pixel colors */
-RGBA FG_COL = { R: 0xff, G: 0xff, B: 0xff, A:0xff };
-RGBA BG_COL = { R: 0x00, G: 0x00, B: 0x00, A:0xff };
+RGBA FG_COL = { R: 0x00, G: 0x00, B: 0x00, A:0xff };
+RGBA BG_COL = { R: 0xff, G: 0xff, B: 0xff, A:0xff };
RGBA BL_COL = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
RGBA NO_COL = { R: 0x00, G: 0x00, B: 0x00, A:0x00 };
@@ -633,7 +636,7 @@ int drv_generic_graphic_init(const char *section, const char *driver)
if (color)
free(color);
- color = cfg_get(Section, "basecolor", "000000ff");
+ color = cfg_get(Section, "basecolor", "00000000");
if (color2RGBA(color, &BL_COL) < 0) {
error("%s: ignoring illegal color '%s'", Driver, color);
}
@@ -660,6 +663,9 @@ int drv_generic_graphic_init(const char *section, const char *driver)
wc.draw = drv_generic_graphic_image_draw;
widget_register(&wc);
+ /* clear framebuffer */
+ drv_generic_graphic_clear();
+
return 0;
}
@@ -669,9 +675,9 @@ int drv_generic_graphic_clear(void)
int i, l;
for (i = 0; i < LCOLS * LROWS; i++)
- drv_generic_graphic_FB[0][i] = BG_COL;
+ drv_generic_graphic_FB[LAYERS-1][i] = BG_COL;
- for (l = 1; l < LAYERS; l++)
+ for (l = 0; l < LAYERS-1; l++)
for (i = 0; i < LCOLS * LROWS; i++)
drv_generic_graphic_FB[l][i] = NO_COL;
@@ -681,6 +687,12 @@ int drv_generic_graphic_clear(void)
}
+RGBA drv_generic_graphic_rgb(const int row, const int col)
+{
+ return drv_generic_graphic_blend(row, col);
+}
+
+
unsigned char drv_generic_graphic_gray(const int row, const int col)
{
RGBA p = drv_generic_graphic_blend(row, col);
@@ -688,9 +700,13 @@ unsigned char drv_generic_graphic_gray(const int row, const int col)
}
-RGBA drv_generic_graphic_rgb(const int row, const int col)
+unsigned char drv_generic_graphic_black(const int row, const int col)
{
- return drv_generic_graphic_blend(row, col);
+ RGBA p = drv_generic_graphic_blend(row, col);
+ if (p.R > 127 || p.G > 127 || p.B > 127) {
+ return 0;
+ }
+ return 1;
}