lv_draw_vector.h API reference for lv_draw_vector.h
See Also: Private Header This header has a companion private implementation with internal data structures. lv_draw_vector_private.h
Setters (26) Functions that modify object properties
Getters (2) Functions that read object properties
Other (27) Constructors, destructors, and utilities
Set blend mode for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this blend mode.
void lv_draw_vector_dsc_set_blend_mode ( lv_draw_vector_dsc_t * dsc , lv_vector_blend_t blend ) Parameters Set the fill color for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this color.
void lv_draw_vector_dsc_set_fill_color32 ( lv_draw_vector_dsc_t * dsc , lv_color32_t color ) Parameters Set fill color for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this color.
void lv_draw_vector_dsc_set_fill_color ( lv_draw_vector_dsc_t * dsc , lv_color_t color ) Parameters Set fill opacity for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this opacity.
void lv_draw_vector_dsc_set_fill_opa ( lv_draw_vector_dsc_t * dsc , lv_opa_t opa ) Parameters Set fill rule for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this fill rule.
void lv_draw_vector_dsc_set_fill_rule ( lv_draw_vector_dsc_t * dsc , lv_vector_fill_t rule ) Parameters Set the fill units for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this fill units.
void lv_draw_vector_dsc_set_fill_units ( lv_draw_vector_dsc_t * dsc , const lv_vector_fill_units_t units ) Parameters
The units can be either relative to the object bounding box or absolute in user space. This API specifically affects the drawing position of the fill image and does not impact other elements.
Set fill image for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this fill image.
void lv_draw_vector_dsc_set_fill_image ( lv_draw_vector_dsc_t * dsc , const lv_draw_image_dsc_t * img_dsc ) Parameters Set fill linear gradient for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient.
void lv_draw_vector_dsc_set_fill_linear_gradient ( lv_draw_vector_dsc_t * dsc , float x1 , float y1 , float x2 , float y2 ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor x1floatthe x for start point y1floatthe y for start point x2floatthe x for end point y2floatthe y for end point
Set fill radial gradient radius for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient.
void lv_draw_vector_dsc_set_fill_radial_gradient ( lv_draw_vector_dsc_t * dsc , float cx , float cy , float radius ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor cxfloatthe x for center of the circle cyfloatthe y for center of the circle radiusfloatthe radius for circle
Set fill radial gradient spread for descriptor
void lv_draw_vector_dsc_set_fill_gradient_spread ( lv_draw_vector_dsc_t * dsc , lv_vector_gradient_spread_t spread ) Parameters Set fill gradient color stops for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient color stops.
void lv_draw_vector_dsc_set_fill_gradient_color_stops ( lv_draw_vector_dsc_t * dsc , const lv_grad_stop_t * stops , uint16_t count ) Parameters Set stroke color for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this color.
void lv_draw_vector_dsc_set_stroke_color32 ( lv_draw_vector_dsc_t * dsc , lv_color32_t color ) Parameters Set stroke color for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this color.
void lv_draw_vector_dsc_set_stroke_color ( lv_draw_vector_dsc_t * dsc , lv_color_t color ) Parameters Set stroke opacity for descriptor
void lv_draw_vector_dsc_set_stroke_opa ( lv_draw_vector_dsc_t * dsc , lv_opa_t opa ) Parameters Set stroke line width for descriptor. The new path shapes added by lv_draw_vector_dsc_add_path will use this stroke width.
void lv_draw_vector_dsc_set_stroke_width ( lv_draw_vector_dsc_t * dsc , float width ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor widthfloatthe stroke line width
Set stroke line dash pattern for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this dash.
void lv_draw_vector_dsc_set_stroke_dash ( lv_draw_vector_dsc_t * dsc , float * dash_pattern , uint16_t dash_count ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor dash_patternfloat *an array of values that specify the segments of dash line May be NULL. dash_countuint16_tthe length of dash pattern array
Set stroke line cap style for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this line cap.
void lv_draw_vector_dsc_set_stroke_cap ( lv_draw_vector_dsc_t * dsc , lv_vector_stroke_cap_t cap ) Parameters Set stroke line join style for descriptor
void lv_draw_vector_dsc_set_stroke_join ( lv_draw_vector_dsc_t * dsc , lv_vector_stroke_join_t join ) Parameters Set stroke miter limit for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this miter limit.
void lv_draw_vector_dsc_set_stroke_miter_limit ( lv_draw_vector_dsc_t * dsc , uint16_t miter_limit ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor miter_limituint16_tthe stroke miter_limit
Set stroke linear gradient for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient.
void lv_draw_vector_dsc_set_stroke_linear_gradient ( lv_draw_vector_dsc_t * dsc , float x1 , float y1 , float x2 , float y2 ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor x1floatthe x for start point y1floatthe y for start point x2floatthe x for end point y2floatthe y for end point
Set stroke radial gradient for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient.
void lv_draw_vector_dsc_set_stroke_radial_gradient ( lv_draw_vector_dsc_t * dsc , float cx , float cy , float radius ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor cxfloatthe x for center of the circle cyfloatthe y for center of the circle radiusfloatthe radius for circle
Set stroke color stops for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this gradient spread.
void lv_draw_vector_dsc_set_stroke_gradient_spread ( lv_draw_vector_dsc_t * dsc , lv_vector_gradient_spread_t spread ) Parameters Set stroke color stops for descriptor The new path shapes added by lv_draw_vector_dsc_add_path will use this color stops.
void lv_draw_vector_dsc_set_stroke_gradient_color_stops ( lv_draw_vector_dsc_t * dsc , const lv_grad_stop_t * stops , uint16_t count ) Parameters Get the bounding box of a path
void lv_vector_path_get_bounding ( const lv_vector_path_t * path , lv_area_t * area ) Parameters Try to get a vector draw descriptor from a draw task.
lv_draw_vector_dsc_t * lv_draw_task_get_vector_dsc ( lv_draw_task_t * task ) Parameters Returns: lv_draw_vector_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_VECTOR
Create a vector graphic path object
lv_vector_path_t * lv_vector_path_create ( lv_vector_path_quality_t quality ) Parameters Returns: lv_vector_path_t * — pointer to the created path object
Copy a path data to another
void lv_vector_path_copy ( lv_vector_path_t * target_path , const lv_vector_path_t * path ) Parameters Clear path data
void lv_vector_path_clear ( lv_vector_path_t * path ) Parameters Delete the graphic path object
void lv_vector_path_delete ( lv_vector_path_t * path ) Parameters Begin a new sub path and set a point to path
void lv_vector_path_move_to ( lv_vector_path_t * path , const lv_fpoint_t * p ) Parameters Add a line to the path from last point to the point
void lv_vector_path_line_to ( lv_vector_path_t * path , const lv_fpoint_t * p ) Parameters Add a quadratic bezier line to the path from last point to the point
void lv_vector_path_quad_to ( lv_vector_path_t * path , const lv_fpoint_t * p1 , const lv_fpoint_t * p2 ) Parameters Add a cubic bezier line to the path from last point to the point
void lv_vector_path_cubic_to ( lv_vector_path_t * path , const lv_fpoint_t * p1 , const lv_fpoint_t * p2 , const lv_fpoint_t * p3 ) Parameters Add ellipse arc to the path from last point to the point
void lv_vector_path_arc_to ( lv_vector_path_t * path , float radius_x , float radius_y , float rotate_angle , bool large_arc , bool clockwise , const lv_fpoint_t * p ) Parameters Name Type Description pathlv_vector_path_t *pointer to a path radius_xfloatthe x radius for ellipse arc radius_yfloatthe y radius for ellipse arc rotate_anglefloatthe rotate angle for arc large_arcbooltrue for large arc, otherwise small clockwisebooltrue for clockwise, otherwise anticlockwise pconst lv_fpoint_t *pointer to a lv_fpoint_t variable for end point
Close the sub path
void lv_vector_path_close ( lv_vector_path_t * path ) Parameters Add a rectangle to the path by x/y/w/h. rx/ry are corner radii
void lv_vector_path_append_rectangle ( lv_vector_path_t * path , float x , float y , float w , float h , float rx , float ry ) Parameters Name Type Description pathlv_vector_path_t *pointer to a path xfloatthe x coordinate of the top-left corner of the rectangle yfloatthe y coordinate of the top-left corner of the rectangle wfloatthe width of the rectangle hfloatthe height of the rectangle rxfloatthe horizontal radius for rounded rectangle ryfloatthe vertical radius for rounded rectangle
Add a rectangle to the path (legacy api, recommend use lv_vector_path_append_rectangle instead)
void lv_vector_path_append_rect ( lv_vector_path_t * path , const lv_area_t * rect , float rx , float ry ) Parameters Add a circle to the path
void lv_vector_path_append_circle ( lv_vector_path_t * path , const lv_fpoint_t * c , float rx , float ry ) Parameters Name Type Description pathlv_vector_path_t *pointer to a path cconst lv_fpoint_t *pointer to a lv_fpoint_t variable for center of the circle rxfloatthe horizontal radius for circle ryfloatthe vertical radius for circle
Add a arc to the path
void lv_vector_path_append_arc ( lv_vector_path_t * path , const lv_fpoint_t * c , float radius , float start_angle , float sweep , bool pie ) Parameters Name Type Description pathlv_vector_path_t *pointer to a path cconst lv_fpoint_t *pointer to a lv_fpoint_t variable for center of the circle radiusfloatthe radius for arc start_anglefloatthe start angle for arc sweepfloatthe sweep angle for arc, could be negative piebooltrue: draw a pie, false: draw a arc
Add an sub path to the path
void lv_vector_path_append_path ( lv_vector_path_t * path , const lv_vector_path_t * subpath ) Parameters Create a vector graphic descriptor
lv_draw_vector_dsc_t * lv_draw_vector_dsc_create ( lv_layer_t * layer ) Parameters Returns: lv_draw_vector_dsc_t * — pointer to the created descriptor
Delete the vector graphic descriptor
void lv_draw_vector_dsc_delete ( lv_draw_vector_dsc_t * dsc ) Parameters Set current transformation matrix to identity matrix The new path shapes added by lv_draw_vector_dsc_add_path will use this matrix.
void lv_draw_vector_dsc_identity ( lv_draw_vector_dsc_t * dsc ) Parameters Change the scale factor of current transformation matrix The new path shapes added by lv_draw_vector_dsc_add_path will use this scale.
void lv_draw_vector_dsc_scale ( lv_draw_vector_dsc_t * dsc , float scale_x , float scale_y ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor scale_xfloatthe scale factor for the X direction scale_yfloatthe scale factor for the Y direction
Rotate current transformation matrix with origin The new path shapes added by lv_draw_vector_dsc_add_path will use this rotation.
void lv_draw_vector_dsc_rotate ( lv_draw_vector_dsc_t * dsc , float degree ) Parameters Translate current transformation matrix to new position The new path shapes added by lv_draw_vector_dsc_add_path will use this rotation.
void lv_draw_vector_dsc_translate ( lv_draw_vector_dsc_t * dsc , float tx , float ty ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor txfloatthe amount of translate in x direction tyfloatthe amount of translate in y direction
Change the skew factor of current transformation matrix The new path shapes added by lv_draw_vector_dsc_add_path will use this skew.
void lv_draw_vector_dsc_skew ( lv_draw_vector_dsc_t * dsc , float skew_x , float skew_y ) Parameters Name Type Description dsclv_draw_vector_dsc_t *pointer to a vector graphic descriptor skew_xfloatthe skew factor for x direction skew_yfloatthe skew factor for y direction
Add a graphic path to the draw list. It will use colors, opacity, matrix and other parameters set by lv_draw_vector_dsc_set_fill_color() and similar functions.
void lv_draw_vector_dsc_add_path ( lv_draw_vector_dsc_t * dsc , const lv_vector_path_t * path ) Parameters Clear a rectangle area use current fill color
void lv_draw_vector_dsc_clear_area ( lv_draw_vector_dsc_t * dsc , const lv_area_t * rect ) Parameters Draw all the vector graphic paths
void lv_draw_vector ( lv_draw_vector_dsc_t * dsc ) Parameters
Name Value LV_VECTOR_FILL_NONZERO0LV_VECTOR_FILL_EVENODD
Used by 1 function
lv_draw_vector_dsc_set_fill_rule — param rule
Name Value LV_VECTOR_STROKE_CAP_BUTT0LV_VECTOR_STROKE_CAP_SQUARELV_VECTOR_STROKE_CAP_ROUND
Used by 1 function
lv_draw_vector_dsc_set_stroke_cap — param cap
Name Value LV_VECTOR_STROKE_JOIN_MITER0LV_VECTOR_STROKE_JOIN_BEVELLV_VECTOR_STROKE_JOIN_ROUND
Used by 1 function
lv_draw_vector_dsc_set_stroke_join — param join
Name Value LV_VECTOR_PATH_QUALITY_MEDIUM0LV_VECTOR_PATH_QUALITY_HIGHLV_VECTOR_PATH_QUALITY_LOW
Used by 1 function
lv_vector_path_create — param quality
Name Value LV_VECTOR_BLEND_SRC_OVER0LV_VECTOR_BLEND_SRC_INLV_VECTOR_BLEND_DST_OVERLV_VECTOR_BLEND_DST_INLV_VECTOR_BLEND_SCREENLV_VECTOR_BLEND_MULTIPLYLV_VECTOR_BLEND_NONELV_VECTOR_BLEND_ADDITIVELV_VECTOR_BLEND_SUBTRACTIVE
Used by 1 function
lv_draw_vector_dsc_set_blend_mode — param blend
Name Value LV_VECTOR_PATH_OP_MOVE_TO0LV_VECTOR_PATH_OP_LINE_TOLV_VECTOR_PATH_OP_QUAD_TOLV_VECTOR_PATH_OP_CUBIC_TOLV_VECTOR_PATH_OP_CLOSE
Name Value LV_VECTOR_DRAW_STYLE_SOLID0LV_VECTOR_DRAW_STYLE_PATTERNLV_VECTOR_DRAW_STYLE_GRADIENT
Name Value LV_VECTOR_GRADIENT_SPREAD_PAD0LV_VECTOR_GRADIENT_SPREAD_REPEATLV_VECTOR_GRADIENT_SPREAD_REFLECT
Used by 2 functions
lv_draw_vector_dsc_set_fill_gradient_spread — param spread
lv_draw_vector_dsc_set_stroke_gradient_spread — param spread
Name Value LV_VECTOR_GRADIENT_STYLE_LINEAR0LV_VECTOR_GRADIENT_STYLE_RADIAL
Name Value Description LV_VECTOR_FILL_UNITS_OBJECT_BOUNDING_BOX0LV_VECTOR_FILL_UNITS_USER_SPACE_ON_USERelative coordinates relative to the object bounding box.
Used by 1 function
lv_draw_vector_dsc_set_fill_units — param units
Member Type Description xfloatyfloat
typedef void ( * vector_draw_task_cb) ( void * ctx, const lv_vector_path_t * path, const lv_vector_path_ctx_t * dsc)
Used by 1 function
lv_vector_for_each_destroy_tasks — param cb
Includes (2) Included By (1) Transitive (32)
Last updated on