1 #ifndef LIBG15RENDER_H_ 2 #define LIBG15RENDER_H_ 17 #include FT_FREETYPE_H 22 #define G15_BUFFER_LEN 1048 23 #define G15_LCD_OFFSET 32 24 #define G15_LCD_HEIGHT 43 25 #define G15_LCD_WIDTH 160 26 #define G15_COLOR_WHITE 0 27 #define G15_COLOR_BLACK 1 28 #define G15_TEXT_SMALL 0 29 #define G15_TEXT_MED 1 30 #define G15_TEXT_LARGE 2 31 #define G15_PIXEL_NOFILL 0 32 #define G15_PIXEL_FILL 1 33 #define G15_MAX_FACE 5 55 int y2,
int fill,
int color);
58 int height,
short colormap[]);
64 int color,
int thick,
int fill);
73 int color,
int num,
int max,
int type);
79 void g15r_drawSprite(
g15canvas *canvas,
char *buf,
int my_x,
int my_y,
int width,
int height,
int start_x,
int start_y,
int total_width);
83 void g15r_drawBigNum (
g15canvas * canvas,
unsigned int x1,
unsigned int y1,
unsigned int x2,
unsigned int y2,
int color,
int num);
104 unsigned char character,
unsigned int sx,
108 unsigned char character,
unsigned int sx,
112 unsigned char character,
unsigned int sx,
116 int row,
int size,
unsigned int sx,
125 int face_num,
int color,
int center,
void g15r_renderCharacterSmall(g15canvas *canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)
Renders a character in the small font at (x, y)
int g15r_getPixel(g15canvas *canvas, unsigned int x, unsigned int y)
Gets the value of the pixel at (x, y)
void g15r_drawBigNum(g15canvas *canvas, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, int color, int num)
Draw a large number.
void g15r_pixelOverlay(g15canvas *canvas, int x1, int y1, int width, int height, short colormap[])
Overlays a bitmap of size width x height starting at (x1, y1)
void g15r_ttfPrint(g15canvas *canvas, int x, int y, int fontsize, int face_num, int color, int center, char *print_string)
Prints a string in a given font.
unsigned char fontdata_6x4[]
Font data for the small (6x4) font.
int ttf_fontsize[G15_MAX_FACE]
unsigned char buffer[G15_BUFFER_LEN]
int g15r_loadWbmpSplash(g15canvas *canvas, char *filename)
Draw a splash screen from 160x43 wbmp file.
void g15r_renderString(g15canvas *canvas, unsigned char stringOut[], int row, int size, unsigned int sx, unsigned int sy)
Renders a string with font size in row.
void g15r_drawIcon(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height)
Draw an icon to the screen from a wbmp buffer.
void g15r_renderCharacterLarge(g15canvas *canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)
Renders a character in the large font at (x, y)
struct g15canvas g15canvas
This structure holds the data need to render objects to the LCD screen.
void g15r_initCanvas(g15canvas *canvas)
Clears the canvas and resets the mode switches.
void g15r_setPixel(g15canvas *canvas, unsigned int x, unsigned int y, int val)
Sets the value of the pixel at (x, y)
void g15r_pixelReverseFill(g15canvas *canvas, int x1, int y1, int x2, int y2, int fill, int color)
Fills an area bounded by (x1, y1) and (x2, y2)
FT_Face ttf_face[G15_MAX_FACE][sizeof(FT_Face)]
void g15r_drawBar(g15canvas *canvas, int x1, int y1, int x2, int y2, int color, int num, int max, int type)
Draws a completion bar.
char * g15r_loadWbmpToBuf(char *filename, int *img_width, int *img_height)
Load a wbmp file into a buffer.
void g15r_drawLine(g15canvas *canvas, int px1, int py1, int px2, int py2, const int color)
Draws a line from (px1, py1) to (px2, py2)
void g15r_drawSprite(g15canvas *canvas, char *buf, int my_x, int my_y, int width, int height, int start_x, int start_y, int total_width)
Draw a sprite to the screen from a wbmp buffer.
void g15r_clearScreen(g15canvas *canvas, int color)
Fills the screen with pixels of color.
This structure holds the data need to render objects to the LCD screen.
void g15r_pixelBox(g15canvas *canvas, int x1, int y1, int x2, int y2, int color, int thick, int fill)
Draws a box bounded by (x1, y1) and (x2, y2)
void g15r_renderCharacterMedium(g15canvas *canvas, int x, int y, unsigned char character, unsigned int sx, unsigned int sy)
Renders a character in the meduim font at (x, y)
void g15r_drawRoundBox(g15canvas *canvas, int x1, int y1, int x2, int y2, int fill, int color)
Draws a box with rounded corners bounded by (x1, y1) and (x2, y2)
void g15r_drawCircle(g15canvas *canvas, int x, int y, int r, int fill, int color)
Draws a circle centered at (x, y) with a radius of r.
unsigned char fontdata_8x8[]
Font data for the large (8x8) font.
unsigned char fontdata_7x5[]
Font data for the medium (7x5) font.
void g15r_ttfLoad(g15canvas *canvas, char *fontname, int fontsize, int face_num)
Loads a font through the FreeType2 library.