Library release of Simon Ford's GraphicsDisplay Display Library Base Class.

Dependents:   ese_project_copy ese_project_share Test_ColorMemLCD rIoTwear_LCD ... more

Committer:
frankvnk
Date:
Wed Jan 21 19:40:58 2015 +0000
Revision:
0:282710e02ef4
Child:
1:1cb0fcbce1bf
Initial release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frankvnk 0:282710e02ef4 1 /* mbed GraphicsDisplay Display Library Base Class
frankvnk 0:282710e02ef4 2 * Copyright (c) 2007-2009 sford
frankvnk 0:282710e02ef4 3 * Released under the MIT License: http://mbed.org/license/mit
frankvnk 0:282710e02ef4 4 *
frankvnk 0:282710e02ef4 5 * A library for providing a common base class for Graphics displays
frankvnk 0:282710e02ef4 6 * To port a new display, derive from this class and implement
frankvnk 0:282710e02ef4 7 * the constructor (setup the display), pixel (put a pixel
frankvnk 0:282710e02ef4 8 * at a location), width and height functions. Everything else
frankvnk 0:282710e02ef4 9 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
frankvnk 0:282710e02ef4 10 * will come for free. You can also provide a specialised implementation
frankvnk 0:282710e02ef4 11 * of window and putp to speed up the results
frankvnk 0:282710e02ef4 12 */
frankvnk 0:282710e02ef4 13
frankvnk 0:282710e02ef4 14 #ifndef MBED_GRAPHICSDISPLAY_H
frankvnk 0:282710e02ef4 15 #define MBED_GRAPHICSDISPLAY_H
frankvnk 0:282710e02ef4 16
frankvnk 0:282710e02ef4 17 #include "TextDisplay.h"
frankvnk 0:282710e02ef4 18
frankvnk 0:282710e02ef4 19 class GraphicsDisplay : public TextDisplay {
frankvnk 0:282710e02ef4 20
frankvnk 0:282710e02ef4 21 public:
frankvnk 0:282710e02ef4 22
frankvnk 0:282710e02ef4 23 GraphicsDisplay(const char* name);
frankvnk 0:282710e02ef4 24
frankvnk 0:282710e02ef4 25 virtual void pixel(int x, int y, int colour) = 0;
frankvnk 0:282710e02ef4 26 virtual int width() = 0;
frankvnk 0:282710e02ef4 27 virtual int height() = 0;
frankvnk 0:282710e02ef4 28
frankvnk 0:282710e02ef4 29 virtual void window(int x, int y, int w, int h);
frankvnk 0:282710e02ef4 30 virtual void putp(int colour);
frankvnk 0:282710e02ef4 31
frankvnk 0:282710e02ef4 32 virtual void cls();
frankvnk 0:282710e02ef4 33 virtual void fill(int x, int y, int w, int h, int colour);
frankvnk 0:282710e02ef4 34 virtual void blit(int x, int y, int w, int h, const int *colour);
frankvnk 0:282710e02ef4 35 virtual void blitbit(int x, int y, int w, int h, const char* colour);
frankvnk 0:282710e02ef4 36
frankvnk 0:282710e02ef4 37 virtual void character(int column, int row, int value);
frankvnk 0:282710e02ef4 38 virtual int columns();
frankvnk 0:282710e02ef4 39 virtual int rows();
frankvnk 0:282710e02ef4 40
frankvnk 0:282710e02ef4 41 protected:
frankvnk 0:282710e02ef4 42
frankvnk 0:282710e02ef4 43 // pixel location
frankvnk 0:282710e02ef4 44 short _x;
frankvnk 0:282710e02ef4 45 short _y;
frankvnk 0:282710e02ef4 46
frankvnk 0:282710e02ef4 47 // window location
frankvnk 0:282710e02ef4 48 short _x1;
frankvnk 0:282710e02ef4 49 short _x2;
frankvnk 0:282710e02ef4 50 short _y1;
frankvnk 0:282710e02ef4 51 short _y2;
frankvnk 0:282710e02ef4 52
frankvnk 0:282710e02ef4 53 };
frankvnk 0:282710e02ef4 54
frankvnk 0:282710e02ef4 55 #endif