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