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