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