From 10ab31fa86dbf9875b5f6baa6ac59fefaaf86be3 Mon Sep 17 00:00:00 2001 From: andreas 'randy' weinberger Date: Sun, 21 Feb 2010 19:58:27 +0100 Subject: initial git upload, based on graphlcd-base-0.1.5 --- glcddrivers/driver.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 glcddrivers/driver.c (limited to 'glcddrivers/driver.c') diff --git a/glcddrivers/driver.c b/glcddrivers/driver.c new file mode 100644 index 0000000..b1b6286 --- /dev/null +++ b/glcddrivers/driver.c @@ -0,0 +1,54 @@ +/* + * GraphLCD driver library + * + * driver.c - driver base class + * + * parts were taken from graphlcd plugin for the Video Disc Recorder + * (c) 2001-2004 Carsten Siebholz + * + * This file is released under the GNU General Public License. Refer + * to the COPYING file distributed with this package. + * + * (c) 2004 Andreas Regel + */ + +#include "common.h" +#include "driver.h" + + +namespace GLCD +{ + +cDriver::cDriver() +: width(0), + height(0) +{ +} + +void cDriver::SetScreen(const unsigned char * data, int wid, int hgt, int lineSize) +{ + int x, y; + + if (wid > width) + wid = width; + if (hgt > height) + hgt = height; + + Clear(); + if (data) + { + for (y = 0; y < hgt; y++) + { + for (x = 0; x < (wid / 8); x++) + { + Set8Pixels(x * 8, y, data[y * lineSize + x]); + } + if (width % 8) + { + Set8Pixels((wid / 8) * 8, y, data[y * lineSize + wid / 8] & bitmaskl[wid % 8 - 1]); + } + } + } +} + +} // end of namespace -- cgit v1.2.3