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