00001 /* mbed GraphicsDisplay Display Library Base Class00002 * Copyright (c) 2007-2009 sford00003 * Released under the MIT License: http://mbed.org/license/mit00004 *00005 * A library for providing a common base class for Graphics displays00006 * To port a new display, derive from this class and implement00007 * the constructor (setup the display), pixel (put a pixel00008 * at a location), width and height functions. Everything else00009 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) 00010 * will come for free. You can also provide a specialised implementation00011 * of window and putp to speed up the results00012 */00013
00014 #ifndef MBED_GRAPHICSDISPLAY_H00015 #define MBED_GRAPHICSDISPLAY_H00016
00017 #include "TextDisplay.h"00018
00019 class GraphicsDisplay : public TextDisplay {
00020
00021 public:
00022
00023 GraphicsDisplay();
00024
00025 virtualvoid pixel(int x, int y, int colour) = 0;
00026 virtualint width() = 0;
00027 virtualint height() = 0;
00028
00029 virtualvoid window(int x, int y, int w, int h);
00030 virtualvoid putp(int colour);
00031
00032 virtualvoid cls();
00033 virtualvoid fill(int x, int y, int w, int h, int colour);
00034 virtualvoid blit(int x, int y, int w, int h, constint *colour);
00035 virtualvoid blitbit(int x, int y, int w, int h, constchar* colour);
00036
00037 virtualvoid character(int column, int row, int value);
00038 virtualint columns();
00039 virtualint rows();
00040
00041 protected:
00042
00043 // pixel location00044 short _x;
00045 short _y;
00046
00047 // window location00048 short _x1;
00049 short _x2;
00050 short _y1;
00051 short _y2;
00052
00053 };
00054
00055 #endif