Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
121 Kevin 1
#ifndef ADAFRUIT_GFX_H
2
#define	ADAFRUIT_GFX_H
3
 
122 Kevin 4
#define GFX_LCD_BUFFER_SIZE     129 // # of chars + null
5
#define GFX_STRING_BUFFER_SIZE  32
121 Kevin 6
 
7
typedef struct __GFX_DATA {
8
    unsigned char buffer[GFX_STRING_BUFFER_SIZE];
122 Kevin 9
    unsigned char lcd_buffer[GFX_LCD_BUFFER_SIZE];
121 Kevin 10
    int WIDTH, HEIGHT; // raw display size
11
    int _width, _height; // size depending on rotation
12
    int cursor_x, cursor_y;
13
    unsigned int textcolor, textbgcolor;
14
    unsigned char textsize;
15
    unsigned char rotation;
16
    unsigned char wrap; // If set, wrap text at right side
17
} GFX_DATA;
18
 
19
int GFX_Abs(int i);
20
void GFX_Swap(int *a, int *b);
21
 
22
void GFX_Init(int w, int h);
23
void GFX_drawLine(int x0, int y0, int x1, int y1, unsigned int color);
24
void GFX_drawFastVLine(int x, int y, int h, unsigned int color);
25
void GFX_drawFastHLine(int x, int y, int w, unsigned int color);
26
void GFX_drawRect(int x, int y, int w, int h, unsigned int color);
27
void GFX_fillRect(int x, int y, int w, int h, unsigned int color);
28
void GFX_fillScreen(unsigned int color);
29
void GFX_clearScreen(void);
30
 
31
void GFX_drawCircle(int x0, int y0, int r, unsigned int color);
32
void GFX_drawCircleHelper(int x0, int y0, int r, unsigned char cornername, unsigned int color);
33
void GFX_fillCircle(int x0, int y0, int r, unsigned int color);
34
void GFX_fillCircleHelper(int x0, int y0, int r, unsigned char cornername, int delta, unsigned int color);
35
 
36
void GFX_drawTriangle(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color);
37
void GFX_fillTriangle(int x0, int y0, int x1, int y1, int x2, int y2, unsigned int color);
38
void GFX_drawRoundRect(int x0, int y0, int w, int h, int radius, unsigned int color);
39
void GFX_fillRoundRect(int x0, int y0, int w, int h, int radius, unsigned int color);
40
 
41
void GFX_drawBitmap(int x, int y, const unsigned char *bitmap, int w, int h, unsigned int color);
42
void GFX_drawChar(int x, int y, unsigned char c, unsigned int color, unsigned int bg, unsigned char size);
43
 
44
void GFX_write(unsigned char c);
45
void GFX_writeString(const rom char *fmt, ...);
122 Kevin 46
void GFX_appendString(const rom char *fmt, ...);
121 Kevin 47
 
48
void GFX_setCursor(int x, int y);
49
void GFX_setTextColor(unsigned int c);
50
void GFX_setTextColorBG(unsigned int c, unsigned int bg);
51
void GFX_setTextSize(unsigned char s);
52
void GFX_setTextWrap(unsigned char w);
53
 
54
void GFX_setRotation(unsigned char r);
55
unsigned char GFX_getRotation(void);
56
 
57
int GFX_height(void);
58
int GFX_width(void);
59
 
60
#endif	/* ADAFRUIT_GFX_H */
61