LittlevGL  3.20.00.19
Data Structures | Macros | Functions
lv_area.h File Reference
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include "../../../lv_conf.h"
Include dependency graph for lv_area.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lv_point_t
 
struct  lv_area_t
 

Macros

#define LV_COORD_MAX   ((lv_coord_t)((uint32_t)((uint32_t)1 << (8 * sizeof(lv_coord_t) - 1)) - 1000))
 
#define LV_COORD_MIN   (-LV_COORD_MAX)
 

Functions

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)
 

Macro Definition Documentation

§ 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

#define LV_COORD_MIN   (-LV_COORD_MAX)

Function Documentation

§ 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_ppointer to an area
x1left coordinate of the area
y1top coordinate of the area
x2right coordinate of the area
y2bottom 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_ppointer to an area
wthe 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_ppointer to an area
hthe 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_ppointer to an area
xthe new x coordinate of the area
ythe 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
area_ppointer to an area
Returns
size of area

§ lv_area_intersect()

bool lv_area_intersect ( lv_area_t res_p,
const lv_area_t a1_p,
const lv_area_t a2_p 
)

Get the common parts of two areas

Parameters
res_ppointer to an area, the result will be stored her
a1_ppointer to the first area
a2_ppointer to the second area
Returns
false: the two area has NO common parts, res_p is invalid

§ lv_area_join()

void lv_area_join ( lv_area_t a_res_p,
const lv_area_t a1_p,
const lv_area_t a2_p 
)

Join two areas into a third which involves the other two

Parameters
res_ppointer to an area, the result will be stored here
a1_ppointer to the first area
a2_ppointer to the second area

§ lv_area_is_point_on()

bool lv_area_is_point_on ( const lv_area_t a_p,
const lv_point_t p_p 
)

Check if a point is on an area

Parameters
a_ppointer to an area
p_ppointer to a point
Returns
false:the point is out of the area

§ lv_area_is_on()

bool lv_area_is_on ( const lv_area_t a1_p,
const lv_area_t a2_p 
)

Check if two area has common parts

Parameters
a1_ppointer to an area.
a2_ppointer to an other area
Returns
false: a1_p and a2_p has no common parts

§ lv_area_is_in()

bool lv_area_is_in ( const lv_area_t ain_p,
const lv_area_t aholder_p 
)

Check if an area is fully on an other

Parameters
ain_ppointer to an area which could be on aholder_p
aholderpointer to an area which could involve ain_p
Returns
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale