EasyGUI  Version v1.0
Drawing process

LCD Drawing operations. More...

Modules

 Colors
 List of default GUI colors for fast development.
 

Data Structures

struct  gui_draw_text_t
 Structure for drawing strings on widgets. More...
 
struct  gui_draw_rect_ex_t
 Extended rectangle structure. 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_FLAG_DRAW_GRAD_VER   0x01
 
#define GUI_FLAG_DRAW_GRAD_HOR   0x02
 
#define GUI_FLAG_DRAW_FILLED   0x04
 

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_text_init (gui_draw_text_t *f)
 Initialize gui_draw_text_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_dim_t x, gui_dim_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_dim_t x, gui_dim_t y)
 Get pixel color at X and Y location. More...
 
void gui_draw_vline (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t length, gui_color_t color)
 Draw vertical line to LCD. More...
 
void gui_draw_hline (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t length, gui_color_t color)
 Draw horizontal line to LCD. More...
 
void gui_draw_line (const gui_display_t *disp, gui_dim_t x1, gui_dim_t y1, gui_dim_t x2, gui_dim_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_dim_t x, gui_dim_t y, gui_dim_t width, gui_dim_t height, gui_color_t color)
 Draw rectangle. More...
 
void gui_draw_rectangle_ex (const gui_display_t *disp, gui_draw_rect_ex_t *rect)
 Draw rectangle extended function. More...
 
void gui_draw_filledrectangle (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t width, gui_dim_t height, gui_color_t color)
 Draw filled rectangle. More...
 
void gui_draw_roundedrectangle (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t width, gui_dim_t height, gui_dim_t r, gui_color_t color)
 Draw rectangle with rounded corners. More...
 
void gui_draw_filledroundedrectangle (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t width, gui_dim_t height, gui_dim_t r, gui_color_t color)
 Draw filled rectangle with rounded corners. More...
 
void gui_draw_circle (const gui_display_t *disp, gui_dim_t x0, gui_dim_t y0, gui_dim_t r, gui_color_t color)
 Draw circle. More...
 
void gui_draw_filledcircle (const gui_display_t *disp, gui_dim_t x0, gui_dim_t y0, gui_dim_t r, gui_color_t color)
 Draw filled circle. More...
 
void gui_draw_circlecorner (const gui_display_t *disp, gui_dim_t x0, gui_dim_t y0, gui_dim_t r, uint8_t c, gui_color_t color)
 Draw circle corner, selected with parameter. More...
 
void gui_draw_filledcirclecorner (const gui_display_t *disp, gui_dim_t x0, gui_dim_t y0, gui_dim_t r, uint8_t c, uint32_t color)
 Draw filled circle corner, selected with parameter. More...
 
void gui_draw_triangle (const gui_display_t *disp, gui_dim_t x1, gui_dim_t y1, gui_dim_t x2, gui_dim_t y2, gui_dim_t x3, gui_dim_t y3, gui_color_t color)
 Draw triangle. More...
 
void gui_draw_filledtriangle (const gui_display_t *disp, gui_dim_t x1, gui_dim_t y1, gui_dim_t x2, gui_dim_t y2, gui_dim_t x3, gui_dim_t y3, gui_color_t color)
 Draw filled triangle. More...
 
void gui_draw_image (gui_display_t *disp, gui_dim_t x, gui_dim_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_text_t *draw)
 Write text to screen. More...
 
void gui_draw_rectangle3d (const gui_display_t *disp, gui_dim_t x, gui_dim_t y, gui_dim_t width, gui_dim_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

◆ GUI_DRAW_CIRCLE_BL

#define GUI_DRAW_CIRCLE_BL   0x08

Draw bottom right part of circle

◆ GUI_DRAW_CIRCLE_BR

#define GUI_DRAW_CIRCLE_BR   0x04

Draw bottom left part of circle

◆ GUI_DRAW_CIRCLE_TL

#define GUI_DRAW_CIRCLE_TL   0x01

Draw top left part of circle

◆ GUI_DRAW_CIRCLE_TR

#define GUI_DRAW_CIRCLE_TR   0x02

Draw top right part of circle

Enumeration Type Documentation

◆ gui_draw_3d_state_t

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

◆ gui_draw_sb_dir_t

Scroll bar direction enumeration.

Enumerator
GUI_DRAW_SB_DIR_VERTICAL 

Vertical slider

GUI_DRAW_SB_DIR_HORIZONTAL 

Horizontal slider

Function Documentation

◆ gui_draw_circle()

void gui_draw_circle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_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
See also
gui_draw_filledcircle, gui_draw_circlecorner, gui_draw_filledcirclecorner

◆ gui_draw_circlecorner()

void gui_draw_circlecorner ( const gui_display_t disp,
gui_dim_t  x0,
gui_dim_t  y0,
gui_dim_t  r,
uint8_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
See also
gui_draw_circle, gui_draw_filledcircle, gui_draw_filledcirclecorner

◆ gui_draw_filledcircle()

void gui_draw_filledcircle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_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
See also
gui_draw_circle, gui_draw_circlecorner, gui_draw_filledcirclecorner

◆ gui_draw_filledcirclecorner()

void gui_draw_filledcirclecorner ( const gui_display_t disp,
gui_dim_t  x0,
gui_dim_t  y0,
gui_dim_t  r,
uint8_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
See also
gui_draw_circle, gui_draw_filledcircle, gui_draw_circlecorner

◆ gui_draw_filledrectangle()

void gui_draw_filledrectangle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_t  width,
gui_dim_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
See also
gui_draw_rectangle, gui_draw_roundedrectangle, gui_draw_filledroundedrectangle

◆ gui_draw_filledroundedrectangle()

void gui_draw_filledroundedrectangle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_t  width,
gui_dim_t  height,
gui_dim_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
See also
gui_draw_rectangle, gui_draw_filledrectangle, gui_draw_roundedrectangle

◆ gui_draw_filledtriangle()

void gui_draw_filledtriangle ( const gui_display_t disp,
gui_dim_t  x1,
gui_dim_t  y1,
gui_dim_t  x2,
gui_dim_t  y2,
gui_dim_t  x3,
gui_dim_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
See also
gui_draw_triangle

◆ gui_draw_fillscreen()

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

◆ gui_draw_getpixel()

gui_color_t gui_draw_getpixel ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_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
Returns
Pixel color at desired position
See also
gui_draw_setpixel

◆ gui_draw_hline()

void gui_draw_hline ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_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
See also
gui_draw_vline, gui_draw_line

◆ gui_draw_image()

void gui_draw_image ( gui_display_t disp,
gui_dim_t  x,
gui_dim_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

◆ gui_draw_line()

void gui_draw_line ( const gui_display_t disp,
gui_dim_t  x1,
gui_dim_t  y1,
gui_dim_t  x2,
gui_dim_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
See also
gui_draw_vline, gui_draw_hline

◆ gui_draw_poly()

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

◆ gui_draw_rectangle()

void gui_draw_rectangle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_t  width,
gui_dim_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
See also
gui_draw_filledrectangle, gui_draw_roundedrectangle, gui_draw_filledroundedrectangle

◆ gui_draw_rectangle3d()

void gui_draw_rectangle3d ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_t  width,
gui_dim_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

◆ gui_draw_rectangle_ex()

void gui_draw_rectangle_ex ( const gui_display_t disp,
gui_draw_rect_ex_t rect 
)

Draw rectangle extended function.

Parameters
[in,out]dispPointer to gui_display_t structure for display operations
[in]rectRectangle data

◆ gui_draw_roundedrectangle()

void gui_draw_roundedrectangle ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_t  width,
gui_dim_t  height,
gui_dim_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
See also
gui_draw_rectangle, gui_draw_filledrectangle, gui_draw_filledroundedrectangle

◆ gui_draw_scrollbar()

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

◆ gui_draw_scrollbar_init()

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

◆ gui_draw_setpixel()

void gui_draw_setpixel ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_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
See also
gui_draw_getpixel

◆ gui_draw_text_init()

void gui_draw_text_init ( gui_draw_text_t f)

Initialize gui_draw_text_t structure for further usage.

Parameters
[in,out]fPointer to empty gui_draw_text_t structure

◆ gui_draw_triangle()

void gui_draw_triangle ( const gui_display_t disp,
gui_dim_t  x1,
gui_dim_t  y1,
gui_dim_t  x2,
gui_dim_t  y2,
gui_dim_t  x3,
gui_dim_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
See also
gui_draw_filledtriangle

◆ gui_draw_vline()

void gui_draw_vline ( const gui_display_t disp,
gui_dim_t  x,
gui_dim_t  y,
gui_dim_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
See also
gui_draw_hline, gui_draw_line

◆ gui_draw_writetext()

void gui_draw_writetext ( const gui_display_t disp,
const gui_font_t font,
const gui_char str,
gui_draw_text_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_text_t structure with specifications about drawing style