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