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