35 unsigned int byte_offset = pixel_offset /
BYTE_SIZE;
36 unsigned int bit_offset = 7 - (pixel_offset %
BYTE_SIZE);
38 return (canvas->
buffer[byte_offset] & (1 << bit_offset)) >> bit_offset;
56 unsigned int byte_offset = pixel_offset /
BYTE_SIZE;
57 unsigned int bit_offset = 7 - (pixel_offset %
BYTE_SIZE);
65 canvas->
buffer[byte_offset] =
66 canvas->
buffer[byte_offset] | 1 << bit_offset;
68 canvas->
buffer[byte_offset] =
69 canvas->
buffer[byte_offset] & ~(1 << bit_offset);
98 if (FT_Init_FreeType (&canvas->
ftLib))
99 printf (
"Freetype couldnt initialise\n");
void g15r_setPixel(g15canvas *canvas, unsigned int x, unsigned int y, int val)
Sets the value of the pixel at (x, y)
void g15r_clearScreen(g15canvas *canvas, int color)
Fills the screen with pixels of color.
void g15r_initCanvas(g15canvas *canvas)
Clears the canvas and resets the mode switches.
int g15r_getPixel(g15canvas *canvas, unsigned int x, unsigned int y)
Gets the value of the pixel at (x, y)
This structure holds the data need to render objects to the LCD screen.
unsigned char buffer[G15_BUFFER_LEN]