#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include "../../../lv_conf.h"
Go to the source code of this file.
|
void | lv_area_set (lv_area_t *area_p, lv_coord_t x1, lv_coord_t y1, lv_coord_t x2, lv_coord_t y2) |
|
void | lv_area_set_width (lv_area_t *area_p, lv_coord_t w) |
|
void | lv_area_set_height (lv_area_t *area_p, lv_coord_t h) |
|
void | lv_area_set_pos (lv_area_t *area_p, lv_coord_t x, lv_coord_t y) |
|
uint32_t | lv_area_get_size (const lv_area_t *area_p) |
|
bool | lv_area_intersect (lv_area_t *res_p, const lv_area_t *a1_p, const lv_area_t *a2_p) |
|
void | lv_area_join (lv_area_t *a_res_p, const lv_area_t *a1_p, const lv_area_t *a2_p) |
|
bool | lv_area_is_point_on (const lv_area_t *a_p, const lv_point_t *p_p) |
|
bool | lv_area_is_on (const lv_area_t *a1_p, const lv_area_t *a2_p) |
|
bool | lv_area_is_in (const lv_area_t *ain_p, const lv_area_t *aholder_p) |
|
§ LV_COORD_MAX
#define LV_COORD_MAX ((lv_coord_t)((uint32_t)((uint32_t)1 << (8 * sizeof(lv_coord_t) - 1)) - 1000)) |
§ LV_COORD_MIN
§ lv_area_set()
void lv_area_set |
( |
lv_area_t * |
area_p, |
|
|
lv_coord_t |
x1, |
|
|
lv_coord_t |
y1, |
|
|
lv_coord_t |
x2, |
|
|
lv_coord_t |
y2 |
|
) |
| |
Initialize an area
- Parameters
-
area_p | pointer to an area |
x1 | left coordinate of the area |
y1 | top coordinate of the area |
x2 | right coordinate of the area |
y2 | bottom coordinate of the area |
§ lv_area_set_width()
void lv_area_set_width |
( |
lv_area_t * |
area_p, |
|
|
lv_coord_t |
w |
|
) |
| |
Set the width of an area
- Parameters
-
area_p | pointer to an area |
w | the new width of the area (w == 1 makes x1 == x2) |
§ lv_area_set_height()
void lv_area_set_height |
( |
lv_area_t * |
area_p, |
|
|
lv_coord_t |
h |
|
) |
| |
Set the height of an area
- Parameters
-
area_p | pointer to an area |
h | the new height of the area (h == 1 makes y1 == y2) |
§ lv_area_set_pos()
void lv_area_set_pos |
( |
lv_area_t * |
area_p, |
|
|
lv_coord_t |
x, |
|
|
lv_coord_t |
y |
|
) |
| |
Set the position of an area (width and height will be kept)
- Parameters
-
area_p | pointer to an area |
x | the new x coordinate of the area |
y | the new y coordinate of the area |
§ lv_area_get_size()
uint32_t lv_area_get_size |
( |
const lv_area_t * |
area_p | ) |
|
Return with area of an area (x * y)
- Parameters
-
- Returns
- size of area
§ lv_area_intersect()
Get the common parts of two areas
- Parameters
-
res_p | pointer to an area, the result will be stored her |
a1_p | pointer to the first area |
a2_p | pointer to the second area |
- Returns
- false: the two area has NO common parts, res_p is invalid
§ lv_area_join()
Join two areas into a third which involves the other two
- Parameters
-
res_p | pointer to an area, the result will be stored here |
a1_p | pointer to the first area |
a2_p | pointer to the second area |
§ lv_area_is_point_on()
Check if a point is on an area
- Parameters
-
a_p | pointer to an area |
p_p | pointer to a point |
- Returns
- false:the point is out of the area
§ lv_area_is_on()
Check if two area has common parts
- Parameters
-
a1_p | pointer to an area. |
a2_p | pointer to an other area |
- Returns
- false: a1_p and a2_p has no common parts
§ lv_area_is_in()
Check if an area is fully on an other
- Parameters
-
ain_p | pointer to an area which could be on aholder_p |
aholder | pointer to an area which could involve ain_p |
- Returns