EasyGUI  v0.1
Platform independent GUI Library
Drawing process

LCD Drawing operations. More...

Modules

 Colors
 List of default GUI colors for fast development.
 

Data Structures

struct  GUI_DRAW_FONT_t
 Structure for drawing strings on widgets. More...
 
struct  GUI_DRAW_SB_t
 Scroll bar structure. More...
 
struct  GUI_DRAW_Poly_t
 Poly line object coordinates. More...
 

Macros

#define GUI_DRAW_CIRCLE_TL   0x01
 
#define GUI_DRAW_CIRCLE_TR   0x02
 
#define GUI_DRAW_CIRCLE_BR   0x04
 
#define GUI_DRAW_CIRCLE_BL   0x08
 
#define GUI_HALIGN_LEFT   0x01
 
#define GUI_HALIGN_CENTER   0x02
 
#define GUI_HALIGN_RIGHT   0x04
 
#define GUI_VALIGN_TOP   0x08
 
#define GUI_VALIGN_CENTER   0x10
 
#define GUI_VALIGN_BOTTOM   0x20
 

Enumerations

enum  GUI_DRAW_SB_DIR_t { GUI_DRAW_SB_DIR_VERTICAL = 0x00, GUI_DRAW_SB_DIR_HORIZONTAL = 0x00 }
 Scroll bar direction enumeration. More...
 
enum  GUI_DRAW_3D_State_t { GUI_DRAW_3D_State_Raised = 0x00, GUI_DRAW_3D_State_Lowered = 0x01 }
 3D states enumeration More...
 

Functions

void gui_draw_font_init (GUI_DRAW_FONT_t *f)
 Initialize GUI_DRAW_FONT_t structure for further usage. More...
 
void gui_draw_fillscreen (const GUI_Display_t *disp, GUI_Color_t color)
 Fill screen with color. More...
 
void gui_draw_setpixel (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_Color_t color)
 Set single pixel at X and Y location. More...
 
GUI_Color_t gui_draw_getpixel (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y)
 Get pixel color at X and Y location. More...
 
void gui_draw_vline (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t length, GUI_Color_t color)
 Draw vertical line to LCD. More...
 
void gui_draw_hline (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t length, GUI_Color_t color)
 Draw horizontal line to LCD. More...
 
void gui_draw_line (const GUI_Display_t *disp, GUI_iDim_t x1, GUI_iDim_t y1, GUI_iDim_t x2, GUI_iDim_t y2, GUI_Color_t color)
 Draw line from point 1 to point 2. More...
 
void gui_draw_rectangle (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t width, GUI_iDim_t height, GUI_Color_t color)
 Draw rectangle. More...
 
void gui_draw_filledrectangle (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t width, GUI_iDim_t height, GUI_Color_t color)
 Draw filled rectangle. More...
 
void gui_draw_roundedrectangle (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t width, GUI_iDim_t height, GUI_iDim_t r, GUI_Color_t color)
 Draw rectangle with rounded corners. More...
 
void gui_draw_filledroundedrectangle (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t width, GUI_iDim_t height, GUI_iDim_t r, GUI_Color_t color)
 Draw filled rectangle with rounded corners. More...
 
void gui_draw_circle (const GUI_Display_t *disp, GUI_iDim_t x0, GUI_iDim_t y0, GUI_iDim_t r, GUI_Color_t color)
 Draw circle. More...
 
void gui_draw_filledcircle (const GUI_Display_t *disp, GUI_iDim_t x0, GUI_iDim_t y0, GUI_iDim_t r, GUI_Color_t color)
 Draw filled circle. More...
 
void gui_draw_circlecorner (const GUI_Display_t *disp, GUI_iDim_t x0, GUI_iDim_t y0, GUI_iDim_t r, GUI_Byte_t c, GUI_Color_t color)
 Draw circle corner, selected with parameter. More...
 
void gui_draw_filledcirclecorner (const GUI_Display_t *disp, GUI_iDim_t x0, GUI_iDim_t y0, GUI_iDim_t r, GUI_Byte_t c, uint32_t color)
 Draw filled circle corner, selected with parameter. More...
 
void gui_draw_triangle (const GUI_Display_t *disp, GUI_iDim_t x1, GUI_iDim_t y1, GUI_iDim_t x2, GUI_iDim_t y2, GUI_iDim_t x3, GUI_iDim_t y3, GUI_Color_t color)
 Draw triangle. More...
 
void gui_draw_filledtriangle (const GUI_Display_t *disp, GUI_iDim_t x1, GUI_iDim_t y1, GUI_iDim_t x2, GUI_iDim_t y2, GUI_iDim_t x3, GUI_iDim_t y3, GUI_Color_t color)
 Draw filled triangle. More...
 
void gui_draw_image (GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, const GUI_IMAGE_DESC_t *img)
 Draw image to display of any depth and size. More...
 
void gui_draw_writetext (const GUI_Display_t *disp, const GUI_FONT_t *font, const GUI_Char *str, GUI_DRAW_FONT_t *draw)
 Write text to screen. More...
 
void gui_draw_rectangle3d (const GUI_Display_t *disp, GUI_iDim_t x, GUI_iDim_t y, GUI_iDim_t width, GUI_iDim_t height, GUI_DRAW_3D_State_t state)
 Draw rectangle with 3D view. More...
 
void gui_draw_poly (const GUI_Display_t *disp, const GUI_DRAW_Poly_t *points, size_t len, GUI_Color_t color)
 Draw polygon lines. More...
 
void gui_draw_scrollbar_init (GUI_DRAW_SB_t *sb)
 Initializes GUI_DRAW_SB_t structure for drawing operations. More...
 
void gui_draw_scrollbar (const GUI_Display_t *disp, GUI_DRAW_SB_t *sb)
 Draw scroll bar to screen. More...
 

Detailed Description

LCD Drawing operations.

Macro Definition Documentation

#define GUI_DRAW_CIRCLE_BL   0x08

Draw bottom right part of circle

#define GUI_DRAW_CIRCLE_BR   0x04

Draw bottom left part of circle

#define GUI_DRAW_CIRCLE_TL   0x01

Draw top left part of circle

#define GUI_DRAW_CIRCLE_TR   0x02

Draw top right part of circle

#define GUI_HALIGN_CENTER   0x02

Horizontal align is center

#define GUI_HALIGN_LEFT   0x01

Horizontal align is left

#define GUI_HALIGN_RIGHT   0x04

Horizontal align is right

#define GUI_VALIGN_BOTTOM   0x20

Vertical align is bottom

#define GUI_VALIGN_CENTER   0x10

Vertical align is center

#define GUI_VALIGN_TOP   0x08

Vertical align is top

Enumeration Type Documentation

3D states enumeration

See also
gui_draw_rectangle3d
Enumerator
GUI_DRAW_3D_State_Raised 

Raised 3D style

GUI_DRAW_3D_State_Lowered 

Lowered 3D style

Scroll bar direction enumeration.

Enumerator
GUI_DRAW_SB_DIR_VERTICAL 

Vertical slider

GUI_DRAW_SB_DIR_HORIZONTAL 

Horizontal slider

Function Documentation

void gui_draw_circle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  r,
GUI_Color_t  color 
)

Draw circle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xX position of circle center
[in]yX position of circle center
[in]rCircle radius
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_filledcircle, gui_draw_circlecorner, gui_draw_filledcirclecorner
void gui_draw_circlecorner ( const GUI_Display_t disp,
GUI_iDim_t  x0,
GUI_iDim_t  y0,
GUI_iDim_t  r,
GUI_Byte_t  c,
GUI_Color_t  color 
)

Draw circle corner, selected with parameter.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]x0X position of corner origin
[in]y0Y position of corner origin
[in]rCircle radius
[in]cList of corners to draw. Use BITWISE OR with these values to specify corner:
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_circle, gui_draw_filledcircle, gui_draw_filledcirclecorner
void gui_draw_filledcircle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  r,
GUI_Color_t  color 
)

Draw filled circle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xX position of circle center
[in]yX position of circle center
[in]rCircle radius
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_circle, gui_draw_circlecorner, gui_draw_filledcirclecorner
void gui_draw_filledcirclecorner ( const GUI_Display_t disp,
GUI_iDim_t  x0,
GUI_iDim_t  y0,
GUI_iDim_t  r,
GUI_Byte_t  c,
GUI_Color_t  color 
)

Draw filled circle corner, selected with parameter.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]x0X position of corner origin
[in]y0Y position of corner origin
[in]rCircle radius
[in]cList of corners to draw. Use BITWISE OR with these values to specify corner:
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_circle, gui_draw_filledcircle, gui_draw_circlecorner
void gui_draw_filledrectangle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  width,
GUI_iDim_t  height,
GUI_Color_t  color 
)

Draw filled rectangle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]widthRectangle width
[in]heightRectangle height
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_rectangle, gui_draw_roundedrectangle, gui_draw_filledroundedrectangle
void gui_draw_filledroundedrectangle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  width,
GUI_iDim_t  height,
GUI_iDim_t  r,
GUI_Color_t  color 
)

Draw filled rectangle with rounded corners.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]widthRectangle width
[in]heightRectangle height
[in]rCorner radius, max value can be r = MIN(width, height) / 2
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_rectangle, gui_draw_filledrectangle, gui_draw_roundedrectangle
void gui_draw_filledtriangle ( const GUI_Display_t disp,
GUI_iDim_t  x1,
GUI_iDim_t  y1,
GUI_iDim_t  x2,
GUI_iDim_t  y2,
GUI_iDim_t  x3,
GUI_iDim_t  y3,
GUI_Color_t  color 
)

Draw filled triangle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]x1Triangle point 1 X position
[in]y1Triangle point 1 Y position
[in]x2Triangle point 2 X position
[in]y2Triangle point 2 Y position
[in]x3Triangle point 3 X position
[in]y3Triangle point 3 Y position
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_triangle
void gui_draw_fillscreen ( const GUI_Display_t disp,
GUI_Color_t  color 
)

Fill screen with color.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]colorColor to use for filling screen
Return values
None
void gui_draw_font_init ( GUI_DRAW_FONT_t f)

Initialize GUI_DRAW_FONT_t structure for further usage.

Parameters
[in,out]*fPointer to empty GUI_DRAW_FONT_t structure
Return values
None
GUI_Color_t gui_draw_getpixel ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y 
)

Get pixel color at X and Y location.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xX position on LCD
[in]yY position on LCD
Return values
Pixelcolor at desired position
See also
gui_draw_setpixel
void gui_draw_hline ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  length,
GUI_Color_t  color 
)

Draw horizontal line to LCD.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xLine left X position
[in]yLine left Y position
[in]lengthLength of horizontal line
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_vline, gui_draw_line
void gui_draw_image ( GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
const GUI_IMAGE_DESC_t img 
)

Draw image to display of any depth and size.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]*imgPointer to GUI_IMAGE_DESC_t structure with image description
Return values
None
void gui_draw_line ( const GUI_Display_t disp,
GUI_iDim_t  x1,
GUI_iDim_t  y1,
GUI_iDim_t  x2,
GUI_iDim_t  y2,
GUI_Color_t  color 
)

Draw line from point 1 to point 2.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]x1Line start X position
[in]y1Line start Y position
[in]x2Line end X position
[in]y2Line end Y position
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_vline, gui_draw_hline
void gui_draw_poly ( const GUI_Display_t disp,
const GUI_DRAW_Poly_t points,
size_t  len,
GUI_Color_t  color 
)

Draw polygon lines.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]*pointsPointer to array of GUI_DRAW_Poly_t points to draw lines between
[in]lenNumber of points in array. There must be at least 2 points
[in]colorColor to use for drawing
Return values
None
void gui_draw_rectangle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  width,
GUI_iDim_t  height,
GUI_Color_t  color 
)

Draw rectangle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]widthRectangle width
[in]heightRectangle height
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_filledrectangle, gui_draw_roundedrectangle, gui_draw_filledroundedrectangle
void gui_draw_rectangle3d ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  width,
GUI_iDim_t  height,
GUI_DRAW_3D_State_t  state 
)

Draw rectangle with 3D view.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]widthRectangle width
[in]heightRectangle height
[in]state3D state. This parameter can be a value of GUI_DRAW_3D_State_t enumeration
Return values
None
void gui_draw_roundedrectangle ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  width,
GUI_iDim_t  height,
GUI_iDim_t  r,
GUI_Color_t  color 
)

Draw rectangle with rounded corners.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xTop left X position
[in]yTop left Y position
[in]widthRectangle width
[in]heightRectangle height
[in]rCorner radius, max value can be r = MIN(width, height) / 2
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_rectangle, gui_draw_filledrectangle, gui_draw_filledroundedrectangle
void gui_draw_scrollbar ( const GUI_Display_t disp,
GUI_DRAW_SB_t sb 
)

Draw scroll bar to screen.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]*sbPointer to GUI_DRAW_SB_t parameters for scroll bar
Return values
None
void gui_draw_scrollbar_init ( GUI_DRAW_SB_t sb)

Initializes GUI_DRAW_SB_t structure for drawing operations.

Parameters
[in]*sbPointer to GUI_DRAW_SB_t to initialize to default values
Return values
None
void gui_draw_setpixel ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_Color_t  color 
)

Set single pixel at X and Y location.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xX position on LCD
[in]yY position on LCD
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_getpixel
void gui_draw_triangle ( const GUI_Display_t disp,
GUI_iDim_t  x1,
GUI_iDim_t  y1,
GUI_iDim_t  x2,
GUI_iDim_t  y2,
GUI_iDim_t  x3,
GUI_iDim_t  y3,
GUI_Color_t  color 
)

Draw triangle.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]x1Triangle point 1 X position
[in]y1Triangle point 1 Y position
[in]x2Triangle point 2 X position
[in]y2Triangle point 2 Y position
[in]x3Triangle point 3 X position
[in]y3Triangle point 3 Y position
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_filledtriangle
void gui_draw_vline ( const GUI_Display_t disp,
GUI_iDim_t  x,
GUI_iDim_t  y,
GUI_iDim_t  length,
GUI_Color_t  color 
)

Draw vertical line to LCD.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]xLine top X position
[in]yLine top Y position
[in]lengthLength of vertical line
[in]colorColor used for drawing operation
Return values
None
See also
gui_draw_hline, gui_draw_line
void gui_draw_writetext ( const GUI_Display_t disp,
const GUI_FONT_t font,
const GUI_Char str,
GUI_DRAW_FONT_t draw 
)

Write text to screen.

Parameters
[in,out]*dispPointer to GUI_Display_t structure for display operations
[in]*fontPointer to GUI_FONT_t structure with font to use
[in]*strPointer to string to draw on screen
[in]*drawPointer to GUI_DRAW_FONT_t structure with specifications about drawing style
Return values
None

Check Y start value in case of edit mode = allow always on bottom