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