9 #include "LcdDisplay.h"
11 #define NUM_LCD_ROWS 96
12 #define NUM_LCD_COL_BYTES ( 12 )
13 #define MAX_FONT_ROWS ( 19 )
16 void DrawLcdLineBresenham(u8t xstart, u8t ystart, u8t xend, u8t yend)
18 int x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
23 incx = (dx >= 0) ? 1 : -1;
24 incy = (dy >= 0) ? 1 : -1;
44 lcd_set_pixel(x, y, TRUE);
46 for (t = 0; t < el; ++t) {
56 lcd_set_pixel(x, y, TRUE);
60 void DrawLcdLineBresenhamWW(u8t xstart, u8t ystart, u8t xend, u8t yend, u8t thickness)
62 int i, x, y, t, dx, dy, incx, incy, pdx, pdy, ddx, ddy, es, el, err;
67 incx = (dx >= 0) ? 1 : -1;
68 incy = (dy >= 0) ? 1 : -1;
88 lcd_set_pixel(x, y, TRUE);
89 for (i=1; i<thickness; i++) {
90 lcd_set_pixel(x-i, y, TRUE);
91 lcd_set_pixel(x+i, y, TRUE);
92 lcd_set_pixel(x, y-i, TRUE);
93 lcd_set_pixel(x, y+i, TRUE);
96 for (t = 0; t < el; ++t) {
106 lcd_set_pixel(x, y, TRUE);
107 for (i=1; i<thickness; i++) {
108 lcd_set_pixel(x-i, y, TRUE);
109 lcd_set_pixel(x+i, y, TRUE);
110 lcd_set_pixel(x, y-i, TRUE);
111 lcd_set_pixel(x, y+i, TRUE);
117 u8t WriteLcdCharacter(u8t x, u8t y, u8t Character)
119 u8t CharacterHeight = GetCharacterHeight();
120 u8t CharacterWidth = GetCharacterWidth(Character);
121 unsigned int bitmap[MAX_FONT_ROWS];
124 GetCharacterBitmap(Character,(unsigned int*)&bitmap);
126 // printf("cw=%d ch=%d\n", CharacterWidth, CharacterHeight);
127 for (ly=0; ly<CharacterHeight; ly++) {
128 for (lx=0; lx<CharacterWidth; lx++) {
129 if (bitmap[ly] & (1<<lx)) {
130 lcd_set_pixel(lx+x, ly+y, TRUE);
133 lcd_set_pixel(lx+x, ly+y, FALSE);
140 return CharacterWidth + GetFontSpacing();
143 void WriteLcdString(u8t x, u8t y, u8t *str)
147 if (str == NULL || strlen(str)==0)
151 for (i=0; i<strlen(str); i++) {
152 lx += WriteLcdCharacter(lx, y, str[i]);