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