lib/unigraphic/GraphicsDisplay.h

Tue, 07 Sep 2021 00:16:10 +0200

author
David Douard <david.douard@sdf3.org>
date
Tue, 07 Sep 2021 00:16:10 +0200
changeset 61
42c4e1ea9a77
parent 45
2da50a3d4e9f
child 66
48f29a1d43d6
permissions
-rw-r--r--

Formatting

5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
1 /* mbed GraphicsDisplay Display Library Base Class
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
2 * Copyright (c) 2007-2009 sford
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
3 * Released under the MIT License: http://mbed.org/license/mit
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
4 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
5 * A library for providing a common base class for Graphics displays
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
6 * To port a new display, derive from this class and implement
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
7 * the constructor (setup the display), pixel (put a pixel
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
8 * at a location), width and height functions. Everything else
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
9 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
10 * will come for free. You can also provide a specialised implementation
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
11 * of window and putp to speed up the results
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
12 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
13
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
14 #ifndef MBED_GRAPHICSDISPLAY_H
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
15 #define MBED_GRAPHICSDISPLAY_H
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
16
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
17 #include "TextDisplay.h"
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
18 #include "Terminal6x8.h"
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
19
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
20
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
21
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
22 /* some RGB color definitions */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
23 #define Black 0x0000 /* 0, 0, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
24 #define Navy 0x000F /* 0, 0, 128 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
25 #define DarkGreen 0x03E0 /* 0, 128, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
26 #define DarkCyan 0x03EF /* 0, 128, 128 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
27 #define Maroon 0x7800 /* 128, 0, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
28 #define Purple 0x780F /* 128, 0, 128 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
29 #define Olive 0x7BE0 /* 128, 128, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
30 #define LightGrey 0xC618 /* 192, 192, 192 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
31 #define DarkGrey 0x7BEF /* 128, 128, 128 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
32 #define Blue 0x001F /* 0, 0, 255 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
33 #define Green 0x07E0 /* 0, 255, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
34 #define Cyan 0x07FF /* 0, 255, 255 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
35 #define Red 0xF800 /* 255, 0, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
36 #define Magenta 0xF81F /* 255, 0, 255 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
37 #define Yellow 0xFFE0 /* 255, 255, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
38 #define White 0xFFFF /* 255, 255, 255 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
39 #define Orange 0xFD20 /* 255, 165, 0 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
40 #define GreenYellow 0xAFE5 /* 173, 255, 47 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
41
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
42 /** Bitmap
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
43 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
44 struct Bitmap_s{
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
45 int xSize;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
46 int ySize;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
47 int Byte_in_Line;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
48 char* data;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
49 };
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
50
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
51 /** A common base class for Graphics displays
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
52 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
53 class GraphicsDisplay : public TextDisplay {
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
54
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
55 public:
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
56
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
57 /** Create a GraphicsDisplay interface
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
58 * @param name The name used by the parent class to access the interface
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
59 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
60 GraphicsDisplay(const char* name);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
61
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
62 ////// functions needing implementation in derived implementation class ///////////////////////////////////////
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
63 ////// ---------------------------------------------------------------- ///////////////////////////////////////
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
64
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
65 /** Draw a pixel in the specified color.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
66 * @note this method must be supported in the derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
67 * @param x is the horizontal offset to this pixel.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
68 * @param y is the vertical offset to this pixel.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
69 * @param color defines the color for the pixel.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
70 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
71 virtual void pixel(int x, int y, unsigned short color) = 0;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
72
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
73 /** Set the window, which controls where items are written to the screen.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
74 * When something hits the window width, it wraps back to the left side
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
75 * and down a row. If the initial write is outside the window, it will
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
76 * be captured into the window when it crosses a boundary.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
77 * @param x is the left edge in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
78 * @param y is the top edge in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
79 * @param w is the window width in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
80 * @param h is the window height in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
81 * @note this method must be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
82 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
83 virtual void window(int x, int y, int w, int h) = 0;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
84
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
85 /** Push a single pixel into the window and increment position.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
86 * You may first call window() then push pixels in loop.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
87 * @param color is the pixel color.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
88 * @note this method must be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
89 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
90 virtual void window_pushpixel(unsigned short color) = 0;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
91
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
92 /** Push some pixels of the same color into the window and increment position.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
93 * You must first call window() then push pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
94 * @param color is the pixel color.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
95 * @param count: how many
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
96 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
97 virtual void window_pushpixel(unsigned short color, unsigned int count) = 0;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
98
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
99 /** Push array of pixel colors into the window and increment position.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
100 * You must first call window() then push pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
101 * @param color is the pixel color.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
102 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
103 virtual void window_pushpixelbuf(unsigned short* color, unsigned int lenght) = 0;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
104
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
105 /** If framebuffer is used, it needs to be sent to LCD from time to time
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
106 @note this method must be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
107 @note real function for LCD, dummy for TFT
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
108 */
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
109 virtual void copy_to_lcd() = 0;
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
110
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
111 /////// functions that come for free, but can be overwritten///////////////////////////////////////////////////
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
112 /////// ----------------------------------------------------///////////////////////////////////////////////////
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
113
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
114 /** Set window to max possible size
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
115 * May be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
116 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
117 virtual void WindowMax(void);
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
118
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
119 /** clear the entire screen
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
120 * Basically it sets windomax then fill with background color
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
121 * May be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
122 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
123 virtual void cls();
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
124
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
125 /** draw a circle
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
126 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
127 * @param x0,y0 center
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
128 * @param r radius
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
129 * @param color 16 bit color *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
130 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
131 */
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
132 virtual void circle(int x, int y, int r, unsigned short color);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
133
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
134 /** draw a filled circle
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
135 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
136 * @param x0,y0 center
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
137 * @param r radius
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
138 * @param color 16 bit color *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
139 */
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
140 virtual void fillcircle(int x, int y, int r, unsigned short color);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
141
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
142
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
143 /** draw a 1 pixel line
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
144 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
145 * @param x0,y0 start point
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
146 * @param x1,y1 stop point
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
147 * @param color 16 bit color
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
148 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
149 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
150 virtual void line(int x0, int y0, int x1, int y1, unsigned short color);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
151
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
152 /** draw a horizontal line
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
153 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
154 * @param x0 horizontal start
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
155 * @param x1 horizontal stop
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
156 * @param y vertical position
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
157 * @param color 16 bit color
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
158 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
159 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
160 void hline(int x0, int x1, int y, unsigned short color);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
161
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
162 /** draw a vertical line
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
163 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
164 * @param x horizontal position
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
165 * @param y0 vertical start
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
166 * @param y1 vertical stop
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
167 * @param color 16 bit color
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
168 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
169 void vline(int y0, int y1, int x, unsigned short color);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
170
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
171 /** draw a rect
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
172 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
173 * @param x0,y0 top left corner
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
174 * @param x1,y1 down right corner
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
175 * @param color 16 bit color
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
176 * *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
177 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
178 virtual void rect(int x0, int y0, int x1, int y1, unsigned short color);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
179
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
180 /** draw a filled rect
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
181 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
182 * @param x0,y0 top left corner
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
183 * @param x1,y1 down right corner
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
184 * @param color 16 bit color
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
185 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
186 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
187 virtual void fillrect(int x0, int y0, int x1, int y1, unsigned short color);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
188
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
189 /** setup cursor position for text
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
190 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
191 * @param x x-position (top left)
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
192 * @param y y-position
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
193 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
194 virtual void locate(int x, int y);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
195
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
196 /** put a char on the screen
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
197 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
198 * @param value char to print
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
199 * @returns printed char
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
200 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
201 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
202 virtual int _putc(int value);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
203
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
204 /** draw a character on current position out of the active font to the TFT
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
205 *
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
206 * @param c char to print
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
207 *
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
208 */
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
209 virtual void character(int c);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
210
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
211 /** draw a character on given position out of the active font to the TFT
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
212 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
213 * @param x x-position of char (top left)
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
214 * @param y y-position
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
215 * @param c char to print
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
216 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
217 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
218 virtual void character(int x, int y, int c);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
219
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
220 /** return the actual width of a character out of the active font to the TFT
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
221 *
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
222 * @param c char to print
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
223 * @param move_location wether to move current poisition or not
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
224 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
225 */
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
226 virtual uint8_t char_width(char c, bool move_location=false);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
227
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
228 /** paint a bitmap on the TFT
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
229 *
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
230 * @param x,y : upper left corner
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
231 * @param w width of bitmap
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
232 * @param h high of bitmap
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
233 * @param *bitmap pointer to the bitmap data
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
234 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
235 * bitmap format: 16 bit R5 G6 B5
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
236 *
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
237 * use Gimp to create / load , save as BMP, option 16 bit R5 G6 B5
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
238 * use winhex to load this file and mark data stating at offset 0x46 to end
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
239 * use edit -> copy block -> C Source to export C array
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
240 * paste this array into your program
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
241 *
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
242 * define the array as static const unsigned char to put it into flash memory
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
243 * cast the pointer to (unsigned char *) :
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
244 * tft.Bitmap(10,40,309,50,(unsigned char *)scala);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
245 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
246 void Bitmap(int x, int y, int w, int h,unsigned char *bitmap);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
247
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
248 /** paint monochrome bitmap to screen
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
249 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
250 * @param bm Bitmap in flash
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
251 * @param x x start
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
252 * @param y y start
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
253 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
254 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
255 void Bitmap_BW(Bitmap_s bm, int x, int y);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
256
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
257 /** paint a 16 bit BMP from filesytem on the TFT (slow)
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
258 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
259 * @param x,y : position of upper left corner
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
260 * @param *Name_BMP name of the BMP file with drive: "/local/test.bmp"
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
261 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
262 * @returns 1 if bmp file was found and painted
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
263 * @returns 0 if bmp file was found not found
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
264 * @returns -1 if file is no bmp
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
265 * @returns -2 if bmp file is no 16 bit bmp
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
266 * @returns -3 if bmp file is to big for screen
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
267 * @returns -4 if buffer malloc go wrong
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
268 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
269 * bitmap format: 16 bit R5 G6 B5
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
270 *
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
271 * use Gimp to create / load , save as BMP, option 16 bit R5 G6 B5
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
272 * copy to internal file system or SD card
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
273 */
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
274 int BMP_16(int x, int y, const char *Name_BMP);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
275
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
276
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
277
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
278 /** select the font to use
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
279 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
280 * @param f pointer to font array
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
281 * @param firstascii first ascii code present in font array, default 32 (space)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
282 * @param lastascii last ascii code present in font array, default 127 (DEL)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
283 * @param proportional enable/disable variable font width (default enabled)
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
284 *
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
285 * font array can created with GLCD Font Creator from http://www.mikroe.com
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
286 * you have to add 4 parameter at the beginning of the font array to use:
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
287 * - the number of byte / char (not used in this revision, set to whatever)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
288 * - the vertial size in pixel
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
289 * - the horizontal size in pixel
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
290 * - the number of byte per vertical line (not used in this revision, set to whatever)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
291 * you also have to change the array to cont unsigned char[] and __align(2)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
292 *
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
293 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
294 void set_font(unsigned char* f, unsigned char firstascii=32, unsigned char lastascii=127, bool proportional = true);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
295
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
296 /** Zoom fount
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
297 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
298 * @param x_mul horizontal size multiplier
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
299 * @param y_mul vertical size multiplier
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
300 */
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
301 void set_font_zoom(unsigned char x_mul, unsigned char y_mul);
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
302
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
303 /** Get the number of columns based on the currently active font.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
304 * @returns number of columns.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
305 * @note this method may be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
306 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
307 virtual int columns();
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
308
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
309 /** Get the number of rows based on the currently active font.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
310 * @returns number of rows.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
311 * @note this method may be overridden in a derived class.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
312 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
313 virtual int rows();
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
314
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
315 /** get the current oriented screen width in pixels
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
316 * @returns screen width in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
317 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
318 int width();
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
319
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
320 /** get the current oriented screen height in pixels
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
321 * @returns screen height in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
322 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
323 int height();
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
324
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
325 /** set the current oriented screen width in pixels
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
326 * @param width screen width in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
327 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
328 void set_width(int width);
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
329
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
330 /** set the current oriented screen height in pixels
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
331 * @param height screen height in pixels.
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
332 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
333 void set_height(int height);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
334
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
335 /** setup auto update of screen
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
336 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
337 * @param up 1 = on , 0 = off
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
338 * if switched off the program has to call copy_to_lcd()
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
339 * to update screen from framebuffer
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
340 */
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
341 void set_auto_up(bool up);
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
342
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
343 /** get status of the auto update function
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
344 *
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
345 * @returns if auto update is on
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
346 */
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
347 bool get_auto_up(void);
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
348
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
349
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
350
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
351 private:
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
352
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
353 unsigned char* font;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
354 // display width and height related to current orientation
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
355 int oriented_width;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
356 int oriented_height;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
357
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
358 // text char location
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
359 int char_x;
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
360 int char_y;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
361
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
362 int fontoffset;// bytes / char (short)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
363 int fonthor; // hor size of font (char)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
364 int fontvert; // ver size of font (char)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
365 int fontbpl; // bytes per line (char)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
366 int fontzoomver; // size multiplier
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
367 int fontzoomhor; // size multiplier
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
368 unsigned char firstch; // first ascii code present in font array (usually 32)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
369 unsigned char lastch; // last ascii code present in font array (usually 127)
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
370 bool auto_up; // autoupdate flag for LCD
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
371 bool fontprop;
45
2da50a3d4e9f Adjust font rendering
David Douard <david.douard@sdf3.org>
parents: 5
diff changeset
372
5
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
373
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
374 };
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
375
f1c85c2500f2 several improvements
David Douard <david.douard@logilab.fr>
parents:
diff changeset
376 #endif

mercurial