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