lv_draw_sw_mask.h
API reference for lv_draw_sw_mask.h
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_draw_sw_mask_private.h
Functions
draw/sw/lv_draw_sw_mask.h:71function
lv_draw_sw_mask_init
void lv_draw_sw_mask_init(void)draw/sw/lv_draw_sw_mask.h:73function
lv_draw_sw_mask_deinit
void lv_draw_sw_mask_deinit(void)draw/sw/lv_draw_sw_mask.h:87function
lv_draw_sw_mask_apply
Apply the added buffers on a line. Used internally by the library's drawing routines.
lv_draw_sw_mask_res_t lv_draw_sw_mask_apply(void *masks[], lv_opa_t *mask_buf, int32_t abs_x, int32_t abs_y, int32_t len)| Name | Type | Description |
|---|---|---|
masks | void * | the masks list to apply, must be ended with NULL pointer in array. |
mask_buf | lv_opa_t * | store the result mask here. Has to be len byte long. Should be initialized with 0xFF. |
abs_x | int32_t | absolute X coordinate where the line to calculate start |
abs_y | int32_t | absolute Y coordinate where the line to calculate start |
len | int32_t | length of the line to calculate (in pixel count) |
Returns: lv_draw_sw_mask_res_t — One of these values:
LV_DRAW_MASK_RES_FULL_TRANSP: the whole line is transparent.mask_bufis not set to zeroLV_DRAW_MASK_RES_FULL_COVER: the whole line is fully visible.mask_bufis unchangedLV_DRAW_MASK_RES_CHANGED:mask_bufhas changed, it shows the desired opacity of each pixel in the given line
draw/sw/lv_draw_sw_mask.h:99function
lv_draw_sw_mask_free_param
Free the data from the parameter. It's called inside lv_draw_sw_mask_remove_id and lv_draw_sw_mask_remove_custom Needs to be called only in special cases when the mask is not added by lv_draw_mask_add and not removed by lv_draw_mask_remove_id or lv_draw_mask_remove_custom
void lv_draw_sw_mask_free_param(void *p)| Name | Type | Description |
|---|---|---|
p | void * | pointer to a mask parameter |
draw/sw/lv_draw_sw_mask.h:112function
lv_draw_sw_mask_line_points_init
Initialize a line mask from two points.
void lv_draw_sw_mask_line_points_init(lv_draw_sw_mask_line_param_t *param, int32_t p1x, int32_t p1y, int32_t p2x, int32_t p2y, lv_draw_sw_mask_line_side_t side)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_line_param_t * | pointer to a lv_draw_mask_param_t to initialize |
p1x | int32_t | X coordinate of the first point of the line |
p1y | int32_t | Y coordinate of the first point of the line |
p2x | int32_t | X coordinate of the second point of the line |
p2y | int32_t | y coordinate of the second point of the line |
side | lv_draw_sw_mask_line_side_t | and element of lv_draw_mask_line_side_t to describe which side to keep. With LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT and horizontal line all pixels are kept With LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM and vertical line all pixels are kept |
draw/sw/lv_draw_sw_mask.h:126function
lv_draw_sw_mask_line_angle_init
Initialize a line mask from a point and an angle.
void lv_draw_sw_mask_line_angle_init(lv_draw_sw_mask_line_param_t *param, int32_t px, int32_t py, int16_t angle, lv_draw_sw_mask_line_side_t side)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_line_param_t * | pointer to a lv_draw_mask_param_t to initialize |
px | int32_t | X coordinate of a point of the line |
py | int32_t | X coordinate of a point of the line |
angle | int16_t | right 0 deg, bottom: 90 |
side | lv_draw_sw_mask_line_side_t | an element of lv_draw_mask_line_side_t to describe which side to keep. With LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT and horizontal line all pixels are kept With LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM and vertical line all pixels are kept |
draw/sw/lv_draw_sw_mask.h:137function
lv_draw_sw_mask_angle_init
Initialize an angle mask.
void lv_draw_sw_mask_angle_init(lv_draw_sw_mask_angle_param_t *param, int32_t vertex_x, int32_t vertex_y, int32_t start_angle, int32_t end_angle)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_angle_param_t * | pointer to a lv_draw_mask_param_t to initialize |
vertex_x | int32_t | X coordinate of the angle vertex (absolute coordinates) |
vertex_y | int32_t | Y coordinate of the angle vertex (absolute coordinates) |
start_angle | int32_t | start angle in degrees. 0 deg on the right, 90 deg, on the bottom |
end_angle | int32_t | end angle |
draw/sw/lv_draw_sw_mask.h:147function
lv_draw_sw_mask_radius_init
Initialize a fade mask.
void lv_draw_sw_mask_radius_init(lv_draw_sw_mask_radius_param_t *param, const lv_area_t *rect, int32_t radius, bool inv)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_radius_param_t * | pointer to an lv_draw_mask_radius_param_t to initialize |
rect | const lv_area_t * | coordinates of the rectangle to affect (absolute coordinates) |
radius | int32_t | radius of the rectangle |
inv | bool | true: keep the pixels inside the rectangle; keep the pixels outside of the rectangle |
draw/sw/lv_draw_sw_mask.h:159function
lv_draw_sw_mask_fade_init
Initialize a fade mask.
void lv_draw_sw_mask_fade_init(lv_draw_sw_mask_fade_param_t *param, const lv_area_t *coords, lv_opa_t opa_top, int32_t y_top, lv_opa_t opa_bottom, int32_t y_bottom)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_fade_param_t * | pointer to a lv_draw_mask_param_t to initialize |
coords | const lv_area_t * | coordinates of the area to affect (absolute coordinates) |
opa_top | lv_opa_t | opacity on the top |
y_top | int32_t | at which coordinate start to change to opacity to opa_bottom |
opa_bottom | lv_opa_t | opacity at the bottom |
y_bottom | int32_t | at which coordinate reach opa_bottom. |
draw/sw/lv_draw_sw_mask.h:169function
lv_draw_sw_mask_map_init
Initialize a map mask.
void lv_draw_sw_mask_map_init(lv_draw_sw_mask_map_param_t *param, const lv_area_t *coords, const lv_opa_t *map)| Name | Type | Description |
|---|---|---|
param | lv_draw_sw_mask_map_param_t * | pointer to a lv_draw_mask_param_t to initialize |
coords | const lv_area_t * | coordinates of the map (absolute coordinates) |
map | const lv_opa_t * | array of bytes with the mask values |
Enums
lv_draw_sw_mask_res_t
| Name |
|---|
LV_DRAW_SW_MASK_RES_TRANSP |
LV_DRAW_SW_MASK_RES_FULL_COVER |
LV_DRAW_SW_MASK_RES_CHANGED |
LV_DRAW_SW_MASK_RES_UNKNOWN |
lv_draw_sw_mask_type_t
| Name |
|---|
LV_DRAW_SW_MASK_TYPE_LINE |
LV_DRAW_SW_MASK_TYPE_ANGLE |
LV_DRAW_SW_MASK_TYPE_RADIUS |
LV_DRAW_SW_MASK_TYPE_FADE |
LV_DRAW_SW_MASK_TYPE_MAP |
lv_draw_sw_mask_line_side_t
| Name | Value |
|---|---|
LV_DRAW_SW_MASK_LINE_SIDE_LEFT | 0 |
LV_DRAW_SW_MASK_LINE_SIDE_RIGHT | |
LV_DRAW_SW_MASK_LINE_SIDE_TOP | |
LV_DRAW_SW_MASK_LINE_SIDE_BOTTOM |
Used by 2 functions
lv_draw_sw_mask_line_points_init— paramsidelv_draw_sw_mask_line_angle_init— paramside
Typedefs
draw/sw/lv_draw_sw_mask.h:63typedef
lv_draw_sw_mask_xcb_t
typedef lv_draw_sw_mask_res_t(* lv_draw_sw_mask_xcb_t) (lv_opa_t *mask_buf, int32_t abs_x, int32_t abs_y, int32_t len, void *p)A common callback type for every mask type. Used internally by the library.
Macros
LV_MASK_ID_INV
#define LV_MASK_ID_INV (-1)LV_MASK_MAX_NUM
#define LV_MASK_MAX_NUM 16Dependencies
How is this guide?
Last updated on