lv_nanovg_utils.h
API reference for lv_nanovg_utils.h
Summary
Functions
lv_nanovg_set_clip_area
Set the clipping area
void lv_nanovg_set_clip_area(NVGcontext *ctx, const lv_area_t *area)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
area | const lv_area_t * | the clipping area |
lv_nanovg_utils_init
Initialize NanoVG utilities
void lv_nanovg_utils_init(struct _lv_draw_nanovg_unit_t *u)| Name | Type | Description |
|---|---|---|
u | struct _lv_draw_nanovg_unit_t * | pointer to the nanovg unit |
lv_nanovg_utils_deinit
Deinitialize NanoVG utilities
void lv_nanovg_utils_deinit(struct _lv_draw_nanovg_unit_t *u)| Name | Type | Description |
|---|---|---|
u | struct _lv_draw_nanovg_unit_t * | pointer to the nanovg unit |
lv_nanovg_matrix_convert
Convert an LVGL matrix to a NanoVG transform (3x2 matrix)
static void lv_nanovg_matrix_convert(float *xform, const lv_matrix_t *matrix)| Name | Type | Description |
|---|---|---|
xform | float * | the NanoVG transform array (6 floats) |
matrix | const lv_matrix_t * | the LVGL matrix |
lv_nanovg_color_convert
Convert an LVGL color to a NanoVG color
static NVGcolor lv_nanovg_color_convert(lv_color_t color, lv_opa_t opa)| Name | Type | Description |
|---|---|---|
color | lv_color_t | the LVGL color |
opa | lv_opa_t | the opacity |
Returns: NVGcolor — the NanoVG color
lv_nanovg_transform
Apply a transform matrix to the NanoVG context
void lv_nanovg_transform(NVGcontext *ctx, const lv_matrix_t *matrix)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
matrix | const lv_matrix_t * | the transform matrix |
lv_nanovg_path_append_rect
Append a rectangle to the path
void lv_nanovg_path_append_rect(NVGcontext *ctx, float x, float y, float w, float h, float r)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
x | float | the x coordinate of the rectangle |
y | float | the y coordinate of the rectangle |
w | float | the width of the rectangle |
h | float | the height of the rectangle |
r | float | the radius of the rectangle (0 for no rounding) |
lv_nanovg_path_append_area
Append an area to the path
void lv_nanovg_path_append_area(NVGcontext *ctx, const lv_area_t *area)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
area | const lv_area_t * | the area |
lv_nanovg_path_append_arc_right_angle
Append a right angle arc to the path
void lv_nanovg_path_append_arc_right_angle(NVGcontext *ctx, float start_x, float start_y, float center_x, float center_y, float end_x, float end_y)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
start_x | float | the starting x coordinate |
start_y | float | the starting y coordinate |
center_x | float | the center x coordinate |
center_y | float | the center y coordinate |
end_x | float | the ending x coordinate |
end_y | float | the ending y coordinate |
lv_nanovg_path_append_arc
Append an arc to the path
void lv_nanovg_path_append_arc(NVGcontext *ctx, float cx, float cy, float radius, float start_angle, float sweep, bool pie)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
cx | float | the center x coordinate |
cy | float | the center y coordinate |
radius | float | the radius |
start_angle | float | the starting angle in radians |
sweep | float | the sweep angle in radians |
pie | bool | whether to draw a pie slice (connected to center) |
lv_nanovg_fill
Fill the current path
void lv_nanovg_fill(NVGcontext *ctx, enum NVGwinding winding, enum NVGcompositeOperation composite_operation, NVGcolor color)| Name | Type | Description |
|---|---|---|
ctx | NVGcontext * | the NanoVG context |
winding | enum NVGwinding | the winding rule |
composite_operation | enum NVGcompositeOperation | the blend mode |
color | NVGcolor | the fill color |
lv_nanovg_end_frame
End the current frame
void lv_nanovg_end_frame(struct _lv_draw_nanovg_unit_t *u)| Name | Type | Description |
|---|---|---|
u | struct _lv_draw_nanovg_unit_t * | pointer to the nanovg unit |
lv_nanovg_clean_up
Clean up the NanoVG unit (e.g. at the end of task)
void lv_nanovg_clean_up(struct _lv_draw_nanovg_unit_t *u)| Name | Type | Description |
|---|---|---|
u | struct _lv_draw_nanovg_unit_t * | pointer to the nanovg unit |
lv_nanovg_reshape_global_image
Reshape the global image buffer
lv_draw_buf_t * lv_nanovg_reshape_global_image(struct _lv_draw_nanovg_unit_t *u, lv_color_format_t cf, uint32_t w, uint32_t h)| Name | Type | Description |
|---|---|---|
u | struct _lv_draw_nanovg_unit_t * | pointer to the nanovg unit |
cf | lv_color_format_t | the color format |
w | uint32_t | the new width |
h | uint32_t | the new height |
Returns: lv_draw_buf_t * — pointer to the resized draw buffer
Dependencies
lvgl_public.hnanovg.h
Last updated on