NiboRoboLib 3.6 - NIBO Library
NIBO_GFX.h
gehe zur Dokumentation dieser Datei
1 /*
2  NIBO2 library for ARDUINO
3  License: BSD-License
4  (c) 2013 by Nils Springob, nicai-systems
5 */
6 
14 #ifndef __NIBO_GFX_H__
15 #define __NIBO_GFX_H__
16 
17 #ifdef ARDUINO
18 #include <Print.h>
19 #else
20 class Print {
21  virtual size_t write(uint8_t) {return 0;}
22  virtual size_t write(const uint8_t *buffer, size_t size) {return 0;}
23 };
24 #endif
25 
26 
27 enum {
28  GFX_JAM1 = 0,
29  GFX_JAM2 = 1,
30  GFX_COMP = 2,
31  GFX_JAM1_INV = 4,
32  GFX_JAM2_INV = 5,
33  GFX_COMP_INV = 6
34 };
35 
36 enum {
37  GFX_TYPE_NONE = 0,
38  GFX_TYPE_DEM12064 = 2,
39  GFX_TYPE_RG12064 = 3
40 };
41 
42 
43 class GFX_term: public Print {
44  public:
48  virtual size_t write(uint8_t);
49 
55  virtual size_t write(const uint8_t *buffer, size_t size);
56 
60  void clear();
61 
65  void clearLine();
66 
70  void home();
71 
77  void cursor(unsigned char col, unsigned char row);
78 
84  void cursorRel(signed char col, signed char row);
85 
90  void cursorCol(unsigned char col);
91 
96  void cursorRow(unsigned char row);
97 
102  void scroll(unsigned char lines);
103 };
104 
105 class GFX_class: public Print {
106  public:
107  GFX_term term;
108 
109  GFX_class();
110 
114  void begin(unsigned char type = GFX_TYPE_RG12064);
115 
119  virtual size_t write(uint8_t);
120 
126  virtual size_t write(const uint8_t *buffer, size_t size);
127 
131  unsigned char get_x();
132 
136  unsigned char get_y();
137 
143  void move(unsigned char x, unsigned char y);
144 
149  void draw_mode(unsigned char mode);
150 
155  void fill(unsigned char val);
156 
162  unsigned char char_width(char ch);
163 
169  unsigned char text_width(const char *txt);
170 
176  //unsigned char text_width_P(PGM_P txt);
177 
182  void print_char(char c);
183 
188  void print_text(const char *txt);
189 
194  //void print_text_P(PGM_P txt);
195 
202  void draw_xbm(unsigned char width, unsigned char height, unsigned char * data);
203 
210  //void draw_xbm_P(unsigned char width, unsigned char height, PGM_P data);
211 
216  void set_proportional(unsigned char prop);
217 
222  unsigned char get_proportional(void);
223 
228  void hline(unsigned char length);
229 
234  void vline(unsigned char length);
235 
241  void box(unsigned char width, unsigned char height);
242 
248  void lineTo(unsigned char x, unsigned char y);
249 
254  void pixel(unsigned char value);
255 
256 };
257 
258 
259 extern GFX_class GFX;
260 
261 
262 
263 #endif
264 
265 
void clearLine()
unsigned char text_width(const char *txt)
void cursorCol(unsigned char col)
void cursorRel(signed char col, signed char row)
void clear()
unsigned char get_y()
Definition: NIBO_GFX.h:43
void draw_mode(unsigned char mode)
void cursor(unsigned char col, unsigned char row)
void draw_xbm(unsigned char width, unsigned char height, unsigned char *data)
void print_text(const char *txt)
void print_char(char c)
Definition: NIBO_GFX.h:20
void lineTo(unsigned char x, unsigned char y)
void vline(unsigned char length)
unsigned char get_x()
virtual size_t write(uint8_t)
void box(unsigned char width, unsigned char height)
virtual size_t write(uint8_t)
void begin(unsigned char type=GFX_TYPE_RG12064)
void cursorRow(unsigned char row)
void hline(unsigned char length)
void home()
void pixel(unsigned char value)
void fill(unsigned char val)
unsigned char get_proportional(void)
Definition: NIBO_GFX.h:105
void move(unsigned char x, unsigned char y)
void scroll(unsigned char lines)
unsigned char char_width(char ch)
void set_proportional(unsigned char prop)