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