Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
GraphicsDisplay.h@0:f0bb7332032f, 2018-11-15 (annotated)
- Committer:
- martwerl
- Date:
- Thu Nov 15 18:04:45 2018 +0000
- Revision:
- 0:f0bb7332032f
mbedAnalogIn
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| martwerl | 0:f0bb7332032f | 1 | /* mbed GraphicsDisplay Display Library Base Class |
| martwerl | 0:f0bb7332032f | 2 | * Copyright (c) 2007-2009 sford |
| martwerl | 0:f0bb7332032f | 3 | * Released under the MIT License: http://mbed.org/license/mit |
| martwerl | 0:f0bb7332032f | 4 | * |
| martwerl | 0:f0bb7332032f | 5 | * A library for providing a common base class for Graphics displays |
| martwerl | 0:f0bb7332032f | 6 | * To port a new display, derive from this class and implement |
| martwerl | 0:f0bb7332032f | 7 | * the constructor (setup the display), pixel (put a pixel |
| martwerl | 0:f0bb7332032f | 8 | * at a location), width and height functions. Everything else |
| martwerl | 0:f0bb7332032f | 9 | * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) |
| martwerl | 0:f0bb7332032f | 10 | * will come for free. You can also provide a specialised implementation |
| martwerl | 0:f0bb7332032f | 11 | * of window and putp to speed up the results |
| martwerl | 0:f0bb7332032f | 12 | */ |
| martwerl | 0:f0bb7332032f | 13 | |
| martwerl | 0:f0bb7332032f | 14 | #ifndef MBED_GRAPHICSDISPLAY_H |
| martwerl | 0:f0bb7332032f | 15 | #define MBED_GRAPHICSDISPLAY_H |
| martwerl | 0:f0bb7332032f | 16 | |
| martwerl | 0:f0bb7332032f | 17 | #include "TextDisplay.h" |
| martwerl | 0:f0bb7332032f | 18 | |
| martwerl | 0:f0bb7332032f | 19 | class GraphicsDisplay : public TextDisplay { |
| martwerl | 0:f0bb7332032f | 20 | |
| martwerl | 0:f0bb7332032f | 21 | public: |
| martwerl | 0:f0bb7332032f | 22 | |
| martwerl | 0:f0bb7332032f | 23 | GraphicsDisplay(const char* name); |
| martwerl | 0:f0bb7332032f | 24 | |
| martwerl | 0:f0bb7332032f | 25 | virtual void pixel(int x, int y, int colour) = 0; |
| martwerl | 0:f0bb7332032f | 26 | virtual int width() = 0; |
| martwerl | 0:f0bb7332032f | 27 | virtual int height() = 0; |
| martwerl | 0:f0bb7332032f | 28 | |
| martwerl | 0:f0bb7332032f | 29 | virtual void window(int x, int y, int w, int h); |
| martwerl | 0:f0bb7332032f | 30 | virtual void putp(int colour); |
| martwerl | 0:f0bb7332032f | 31 | |
| martwerl | 0:f0bb7332032f | 32 | virtual void cls(); |
| martwerl | 0:f0bb7332032f | 33 | virtual void fill(int x, int y, int w, int h, int colour); |
| martwerl | 0:f0bb7332032f | 34 | virtual void blit(int x, int y, int w, int h, const int *colour); |
| martwerl | 0:f0bb7332032f | 35 | virtual void blitbit(int x, int y, int w, int h, const char* colour); |
| martwerl | 0:f0bb7332032f | 36 | |
| martwerl | 0:f0bb7332032f | 37 | virtual void character(int column, int row, int value); |
| martwerl | 0:f0bb7332032f | 38 | virtual int columns(); |
| martwerl | 0:f0bb7332032f | 39 | virtual int rows(); |
| martwerl | 0:f0bb7332032f | 40 | |
| martwerl | 0:f0bb7332032f | 41 | protected: |
| martwerl | 0:f0bb7332032f | 42 | |
| martwerl | 0:f0bb7332032f | 43 | // pixel location |
| martwerl | 0:f0bb7332032f | 44 | short _x; |
| martwerl | 0:f0bb7332032f | 45 | short _y; |
| martwerl | 0:f0bb7332032f | 46 | |
| martwerl | 0:f0bb7332032f | 47 | // window location |
| martwerl | 0:f0bb7332032f | 48 | short _x1; |
| martwerl | 0:f0bb7332032f | 49 | short _x2; |
| martwerl | 0:f0bb7332032f | 50 | short _y1; |
| martwerl | 0:f0bb7332032f | 51 | short _y2; |
| martwerl | 0:f0bb7332032f | 52 | |
| martwerl | 0:f0bb7332032f | 53 | }; |
| martwerl | 0:f0bb7332032f | 54 | |
| martwerl | 0:f0bb7332032f | 55 | #endif |