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