forked from D4NNYH/C12832_MBED6
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicsDisplay.h
More file actions
55 lines (41 loc) · 1.71 KB
/
GraphicsDisplay.h
File metadata and controls
55 lines (41 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* mbed GraphicsDisplay Display Library Base Class
* Copyright (c) 2007-2009 sford
* Released under the MIT License: http://mbed.org/license/mit
*
* A library for providing a common base class for Graphics displays
* To port a new display, derive from this class and implement
* the constructor (setup the display), pixel (put a pixel
* at a location), width and height functions. Everything else
* (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
* will come for free. You can also provide a specialised implementation
* of window and putp to speed up the results
*/
#ifndef MBED_GRAPHICSDISPLAY_H
#define MBED_GRAPHICSDISPLAY_H
#include "TextDisplay.h"
class GraphicsDisplay : public TextDisplay {
public:
GraphicsDisplay(const char* name);
virtual void pixel(unsigned int x, unsigned int y, int colour) = 0;
virtual unsigned int width() = 0;
virtual unsigned int height() = 0;
virtual void window(unsigned int x, unsigned int y, unsigned int w, unsigned int h);
virtual void putp(int colour);
virtual void cls();
virtual void fill(unsigned int x, unsigned int y, unsigned int w, unsigned int h, int colour);
virtual void blit(unsigned int x, unsigned int y, unsigned int w, unsigned int h, const int *colour);
virtual void blitbit(unsigned int x, unsigned int y, unsigned int w, unsigned int h, const char* colour);
virtual void character(unsigned int column, unsigned int row, int value);
virtual unsigned int columns();
virtual unsigned int rows();
protected:
// pixel location
short _x;
short _y;
// window location
short _x1;
short _x2;
short _y1;
short _y2;
};
#endif