GLCD Library
A C Library for Embedded Applications
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
Graphics

Graphics specific functions such as drawing lines, circles, rectangles etc. More...

Functions

void glcd_draw_bitmap (const unsigned char *data)
 Draw bitmap to screen buffer. More...
 
void glcd_draw_circle (uint8_t x0, uint8_t y0, uint8_t r, uint8_t color)
 Draw circle but do not fill. More...
 
void glcd_draw_line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color)
 Draw line. More...
 
void glcd_draw_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
 Draw rectangle but do not fill. More...
 
void glcd_draw_rect_shadow (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
 Draw rectangle but do not fill. More...
 
void glcd_draw_rect_thick (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t tx, uint8_t ty, uint8_t color)
 Draw rectangle but do not fill. More...
 
void glcd_fill_circle (uint8_t x0, uint8_t y0, uint8_t r, uint8_t color)
 Draw circle and fill. More...
 
void glcd_fill_rect (uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t color)
 Draw rectangle and fill with colour. More...
 
uint8_t glcd_get_pixel (uint8_t x, uint8_t y)
 Get state of pixel from specified location. More...
 
void glcd_invert_area (uint8_t x, uint8_t y, uint8_t w, uint8_t h)
 Invert pixels in a retangular area. More...
 
void glcd_invert_pixel (uint8_t x, uint8_t y)
 Invert state of pixel of specified location. More...
 
void glcd_set_pixel (uint8_t x, uint8_t y, uint8_t color)
 Set pixel to specified colour. More...
 

Detailed Description

Graphics specific functions such as drawing lines, circles, rectangles etc.

Function Documentation

void glcd_draw_bitmap ( const unsigned char *  data)

Draw bitmap to screen buffer.

Note this will draw to the entire buffer, its not yet possible to draw partially to the LCD. Not yet supported with AVR pgmspace.

Parameters
dataPointer to bitmap data.

Definition at line 279 of file graphics.c.

Referenced by glcd_test_bitmap_128x64().

void glcd_draw_circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  r,
uint8_t  color 
)

Draw circle but do not fill.

The border of the rectangle is the same as fill colour

Parameters
x0Centre x-coordinate (left-most)
y0Centre y-coordinate (top-most)
rRadius
colorColour of border
See Also
ColourConstants

Definition at line 190 of file graphics.c.

void glcd_draw_line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  color 
)

Draw line.

Parameters
x0Start x-coordinate
y0Start y-coordinate
x1End x-coordinate
y1End y-coordinate
colorColour to set pixels
See Also
ColourConstants

Definition at line 85 of file graphics.c.

Referenced by glcd_draw_rect_shadow(), and glcd_scrolling_bar_graph().

void glcd_draw_rect ( uint8_t  x,
uint8_t  y,
uint8_t  w,
uint8_t  h,
uint8_t  color 
)

Draw rectangle but do not fill.

The border of the rectangle is the same as fill colour

Parameters
xStart x-coordinate (left-most)
yStart y-coordinate (top-most)
wWidth
hHeight
colorColour of border
See Also
ColourConstants

Definition at line 140 of file graphics.c.

Referenced by glcd_bar_graph_horizontal(), glcd_bar_graph_vertical(), glcd_draw_rect_shadow(), glcd_scrolling_bar_graph(), and glcd_test_rectangles().

void glcd_draw_rect_shadow ( uint8_t  x,
uint8_t  y,
uint8_t  w,
uint8_t  h,
uint8_t  color 
)

Draw rectangle but do not fill.

Place a shadow line on the bottom-right of the window. The border of the rectangle is the same as fill colour

Parameters
xStart x-coordinate (left-most)
yStart y-coordinate (top-most)
wWidth
hHeight
colorColour of border
See Also
ColourConstants

Definition at line 183 of file graphics.c.

Referenced by glcd_test_rectangles().

void glcd_draw_rect_thick ( uint8_t  x,
uint8_t  y,
uint8_t  w,
uint8_t  h,
uint8_t  tx,
uint8_t  ty,
uint8_t  color 
)

Draw rectangle but do not fill.

User specified thickness. The border of the rectangle is the same as fill colour

Parameters
xStart x-coordinate (left-most)
yStart y-coordinate (top-most)
wWidth (outermost pixels)
hHeight
txThickness of horizontal border along X axis
tyThickness of vertical border along Y axis
colorColour of border
See Also
ColourConstants

Definition at line 154 of file graphics.c.

Referenced by glcd_test_rectangles().

void glcd_fill_circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  r,
uint8_t  color 
)

Draw circle and fill.

The border of the rectangle is the same as fill colour

Parameters
x0Centre x-coordinate (left-most)
y0Centre y-coordinate (top-most)
rRadius
colorColour of border
See Also
ColourConstants

Definition at line 229 of file graphics.c.

Referenced by glcd_test_circles().

void glcd_fill_rect ( uint8_t  x,
uint8_t  y,
uint8_t  w,
uint8_t  h,
uint8_t  color 
)

Draw rectangle and fill with colour.

The border of the rectangle is the same as fill colour

Parameters
xStart x-coordinate (left-most)
yStart y-coordinate (top-most)
wWidth
hHeight
colorColour to fill with
See Also
ColourConstants

Definition at line 128 of file graphics.c.

Referenced by glcd_bar_graph_horizontal(), glcd_bar_graph_horizontal_no_border(), glcd_bar_graph_vertical(), and glcd_bar_graph_vertical_no_border().

uint8_t glcd_get_pixel ( uint8_t  x,
uint8_t  y 
)

Get state of pixel from specified location.

Parameters
xX-coordinate
yY-coordinate
Returns
Colour

Definition at line 64 of file graphics.c.

Referenced by glcd_scrolling_bar_graph().

void glcd_invert_area ( uint8_t  x,
uint8_t  y,
uint8_t  w,
uint8_t  h 
)

Invert pixels in a retangular area.

Parameters
xStart x-coordinate (left-most)
yStart y-coordinate (top-most)
wWidth
hHeight

Definition at line 267 of file graphics.c.

Referenced by glcd_tiny_invert_line().

void glcd_invert_pixel ( uint8_t  x,
uint8_t  y 
)

Invert state of pixel of specified location.

Parameters
xX-coordinate
yY-coordinate

Definition at line 76 of file graphics.c.

Referenced by glcd_invert_area().

void glcd_set_pixel ( uint8_t  x,
uint8_t  y,
uint8_t  color 
)

Set pixel to specified colour.

Parameters
xX-coordinate
yY-coordinate
colorColour to set pixel
See Also
ColourConstants

Definition at line 46 of file graphics.c.

Referenced by glcd_draw_char_xy(), glcd_draw_circle(), glcd_draw_line(), glcd_draw_rect(), glcd_draw_rect_thick(), glcd_fill_circle(), glcd_fill_rect(), glcd_scrolling_bar_graph(), and glcd_tiny_draw_char_xy().