54 #define swap(a, b) { short t = a; a = b; b = t; } 55 #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) 71 static struct color textcolor;
72 static struct color textbgcolor;
73 static unsigned short cursor_y;
74 static unsigned short cursor_x;
75 static unsigned short textsize;
76 static unsigned short wrap;
77 static unsigned short rotation;
115 short ddF_y = -2 * r;
146 unsigned char cornername,
151 short ddF_y = -2 * r;
164 if (cornername & 0x4) {
168 if (cornername & 0x2) {
172 if (cornername & 0x8) {
176 if (cornername & 0x1) {
200 unsigned char cornername,
short delta,
205 short ddF_y = -2 * r;
219 if (cornername & 0x1) {
223 if (cornername & 0x2) {
246 short steep = abs(y1 - y0) > abs(x1 - x0);
270 for (; x0<=x1; x0++) {
392 else if(x1 > b) b = x1;
394 else if(x2 > b) b = x2;
415 if(y1 == y2) last = y1;
418 for(y=y0; y<=last; y++) {
433 sa = dx12 * (y - y1);
434 sb = dx02 * (y - y0);
450 const unsigned char *bitmap,
short w,
short h,
453 short i, j, byteWidth = (w + 7) / 8;
456 for(i=0; i<w; i++ ) {
457 if(
pgm_read_byte(bitmap + j * byteWidth + i / 8) & (128 >> (i & 7))) {
466 cursor_y += textsize*8;
468 }
else if (c ==
'\r') {
470 }
else if (c ==
'\t'){
477 cursor_x += textsize*6;
478 if (wrap && (cursor_x > (
IMAGE_WIDTH - textsize*6))) {
479 cursor_y += textsize*8;
498 unsigned char size) {
502 ((x + 6 * size - 1) < 0) ||
503 ((y + 8 * size - 1) < 0))
506 for (i=0; i<6; i++ ) {
512 for ( j = 0; j<8; j++) {
548 textsize = (s > 0) ? s : 1;
554 textcolor = textbgcolor = c;
616 for (current_y = y; current_y < y + h - 1; current_y++) {
647 for (current_x = x; current_x < x + w - 1; current_x++) {
686 for (current_y = y; current_y < y + h - 1; current_y++) {
688 for (current_x = x; current_x < x + w - 1; current_x++) {
#define RENDERING_TAB_WIDTH
void rendering_drawLine(short x0, short y0, short x1, short y1, struct color color)
void rendering_drawCircle(short x0, short y0, short r, struct color color)
unsigned char rendering_getRotation(void)
void rendering_write(unsigned char c)
void rendering_setTextColor(struct color c)
void rendering_setCursor(short x, short y)
void rendering_fillCircle(short x0, short y0, short r, struct color color)
void projector_set_pixel(struct color const color, unsigned int x, unsigned int y)
Set the color of a pixel at the specified location.
void rendering_drawRect(short x, short y, short w, short h, struct color color)
void rendering_fillCircleHelper(short x0, short y0, short r, unsigned char cornername, short delta, struct color color)
bool color_equal(struct color const a, struct color const b)
Return true if a and b represent exactly the same color.
void rendering_writeString(char *str)
void rendering_setTextSize(unsigned char s)
void rendering_setTextWrap(char w)
void rendering_fillRoundRect(short x, short y, short w, short h, short r, struct color color)
void rendering_drawChar(short x, short y, unsigned char c, struct color color, struct color bg, unsigned char size)
void rendering_drawPixel(short x, short y, struct color color)
void rendering_drawFastHLine(short x, short y, short w, struct color color)
void rendering_drawCircleHelper(short x0, short y0, short r, unsigned char cornername, struct color color)
void rendering_drawFastVLine(short x, short y, short h, struct color color)
void rendering_drawBitmap(short x, short y, const unsigned char *bitmap, short w, short h, struct color color)
void rendering_setTextColor2(struct color c, struct color b)
void rendering_fillRect(short x, short y, short w, short h, struct color color)
void rendering_drawTriangle(short x0, short y0, short x1, short y1, short x2, short y2, struct color color)
void rendering_drawRoundRect(short x, short y, short w, short h, short r, struct color color)
void rendering_fillTriangle(short x0, short y0, short x1, short y1, short x2, short y2, struct color color)
#define pgm_read_byte(addr)
void rendering_drawMinimalCross(short const x, short const y, struct color const color)
Draw a 3x3 pixel cross.