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