lv_area.h
API reference for lv_area.h
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_area_private.h
Functions
public/core/lv_area.h:100function
lv_area_set
Initialize an area
void lv_area_set(lv_area_t *area_p, int32_t x1, int32_t y1, int32_t x2, int32_t y2)| Name | Type | Description |
|---|---|---|
area_p | lv_area_t * | pointer to an area |
x1 | int32_t | left coordinate of the area |
y1 | int32_t | top coordinate of the area |
x2 | int32_t | right coordinate of the area |
y2 | int32_t | bottom coordinate of the area |
public/core/lv_area.h:128function
lv_area_set_width
Set the width of an area
void lv_area_set_width(lv_area_t *area_p, int32_t w)| Name | Type | Description |
|---|---|---|
area_p | lv_area_t * | pointer to an area |
w | int32_t | the new width of the area (w == 1 makes x1 == x2) |
public/core/lv_area.h:135function
lv_area_set_height
Set the height of an area
void lv_area_set_height(lv_area_t *area_p, int32_t h)| Name | Type | Description |
|---|---|---|
area_p | lv_area_t * | pointer to an area |
h | int32_t | the new height of the area (h == 1 makes y1 == y2) |
public/core/lv_area.h:188function
lv_point_set
void lv_point_set(lv_point_t *p, int32_t x, int32_t y)| Name | Type |
|---|---|
p | lv_point_t * |
x | int32_t |
y | int32_t |
public/core/lv_area.h:190function
lv_point_precise_set
void lv_point_precise_set(lv_point_precise_t *p, lv_value_precise_t x, lv_value_precise_t y)public/core/lv_area.h:114function
lv_area_get_width
Get the width of an area
int32_t lv_area_get_width(const lv_area_t *area_p)| Name | Type | Description |
|---|---|---|
area_p | const lv_area_t * | pointer to an area |
Returns: int32_t — the width of the area (if x1 == x2 -> width = 1)
public/core/lv_area.h:121function
lv_area_get_height
Get the height of an area
int32_t lv_area_get_height(const lv_area_t *area_p)| Name | Type | Description |
|---|---|---|
area_p | const lv_area_t * | pointer to an area |
Returns: int32_t — the height of the area (if y1 == y2 -> height = 1)
public/core/lv_area.h:142function
lv_area_get_size
Return with area of an area (x * y)
uint32_t lv_area_get_size(const lv_area_t *area_p)| Name | Type | Description |
|---|---|---|
area_p | const lv_area_t * | pointer to an area |
Returns: uint32_t — size of area
public/core/lv_area.h:107function
lv_area_copy
Copy an area
void lv_area_copy(lv_area_t *dest, const lv_area_t *src)| Name | Type | Description |
|---|---|---|
dest | lv_area_t * | pointer to the destination area |
src | const lv_area_t * | pointer to the source area |
public/core/lv_area.h:144function
lv_area_increase
void lv_area_increase(lv_area_t *area, int32_t w_extra, int32_t h_extra)| Name | Type |
|---|---|
area | lv_area_t * |
w_extra | int32_t |
h_extra | int32_t |
public/core/lv_area.h:146function
lv_area_move
void lv_area_move(lv_area_t *area, int32_t x_ofs, int32_t y_ofs)| Name | Type |
|---|---|
area | lv_area_t * |
x_ofs | int32_t |
y_ofs | int32_t |
public/core/lv_area.h:156function
lv_area_align
Align an area to another
void lv_area_align(const lv_area_t *base, lv_area_t *to_align, lv_align_t align, int32_t ofs_x, int32_t ofs_y)| Name | Type | Description |
|---|---|---|
base | const lv_area_t * | an area where the other will be aligned |
to_align | lv_area_t * | the area to align |
align | lv_align_t | LV_ALIGN_... |
ofs_x | int32_t | X offset |
ofs_y | int32_t | Y offset |
public/core/lv_area.h:167function
lv_point_transform
Transform a point
void lv_point_transform(lv_point_t *point, int32_t angle, int32_t scale_x, int32_t scale_y, const lv_point_t *pivot, bool zoom_first)| Name | Type | Description |
|---|---|---|
point | lv_point_t * | pointer to a point |
angle | int32_t | angle with 0.1 resolutions (123 means 12.3°) |
scale_x | int32_t | horizontal zoom, 256 means 100% |
scale_y | int32_t | vertical zoom, 256 means 100% |
pivot | const lv_point_t * | pointer to the pivot point of the transformation |
zoom_first | bool | true: zoom first and rotate after that; else: opposite order |
public/core/lv_area.h:180function
lv_point_array_transform
Transform an array of points
void lv_point_array_transform(lv_point_t *points, size_t count, int32_t angle, int32_t scale_x, int32_t scale_y, const lv_point_t *pivot, bool zoom_first)| Name | Type | Description |
|---|---|---|
points | lv_point_t * | pointer to an array of points |
count | size_t | number of points in the array |
angle | int32_t | angle with 0.1 resolutions (123 means 12.3°) |
scale_x | int32_t | horizontal zoom, 256 means 100% |
scale_y | int32_t | vertical zoom, 256 means 100% |
pivot | const lv_point_t * | pointer to the pivot point of the transformation |
zoom_first | bool | true: zoom first and rotate after that; else: opposite order |
public/core/lv_area.h:184function
lv_point_from_precise
lv_point_t lv_point_from_precise(const lv_point_precise_t *p)| Name | Type |
|---|---|
p | const lv_point_precise_t * |
public/core/lv_area.h:186function
lv_point_to_precise
lv_point_precise_t lv_point_to_precise(const lv_point_t *p)| Name | Type |
|---|---|
p | const lv_point_t * |
public/core/lv_area.h:192function
lv_point_swap
void lv_point_swap(lv_point_t *p1, lv_point_t *p2)| Name | Type |
|---|---|
p1 | lv_point_t * |
p2 | lv_point_t * |
public/core/lv_area.h:194function
lv_point_precise_swap
void lv_point_precise_swap(lv_point_precise_t *p1, lv_point_precise_t *p2)| Name | Type |
|---|---|
p1 | lv_point_precise_t * |
p2 | lv_point_precise_t * |
public/core/lv_area.h:240function
lv_pct
Convert a percentage value to int32_t. Percentage values are stored in special range
int32_t lv_pct(int32_t x)| Name | Type | Description |
|---|---|---|
x | int32_t | the percentage (0..1000) |
Returns: int32_t — a coordinate that stores the percentage
public/core/lv_area.h:242function
lv_pct_to_px
int32_t lv_pct_to_px(int32_t v, int32_t base)| Name | Type |
|---|---|
v | int32_t |
base | int32_t |
Enums
lv_align_t
Alignments
| Name | Value |
|---|---|
LV_ALIGN_DEFAULT | 0 |
LV_ALIGN_TOP_LEFT | |
LV_ALIGN_TOP_MID | |
LV_ALIGN_TOP_RIGHT | |
LV_ALIGN_BOTTOM_LEFT | |
LV_ALIGN_BOTTOM_MID | |
LV_ALIGN_BOTTOM_RIGHT | |
LV_ALIGN_LEFT_MID | |
LV_ALIGN_RIGHT_MID | |
LV_ALIGN_CENTER | |
LV_ALIGN_OUT_TOP_LEFT | |
LV_ALIGN_OUT_TOP_MID | |
LV_ALIGN_OUT_TOP_RIGHT | |
LV_ALIGN_OUT_BOTTOM_LEFT | |
LV_ALIGN_OUT_BOTTOM_MID | |
LV_ALIGN_OUT_BOTTOM_RIGHT | |
LV_ALIGN_OUT_LEFT_TOP | |
LV_ALIGN_OUT_LEFT_MID | |
LV_ALIGN_OUT_LEFT_BOTTOM | |
LV_ALIGN_OUT_RIGHT_TOP | |
LV_ALIGN_OUT_RIGHT_MID | |
LV_ALIGN_OUT_RIGHT_BOTTOM |
Used by 6 functions
lv_area_align— paramalignlv_obj_set_align— paramalignlv_obj_align— paramalignlv_obj_align_to— paramalignlv_obj_set_style_align— paramvaluelv_style_set_align— paramvalue
lv_dir_t
| Name | Value |
|---|---|
LV_DIR_NONE | 0x00 |
LV_DIR_LEFT | (1 << 0) |
LV_DIR_RIGHT | (1 << 1) |
LV_DIR_TOP | (1 << 2) |
LV_DIR_BOTTOM | (1 << 3) |
LV_DIR_HOR | LV_DIR_LEFT | LV_DIR_RIGHT |
LV_DIR_VER | LV_DIR_TOP | LV_DIR_BOTTOM |
LV_DIR_ALL | LV_DIR_HOR | LV_DIR_VER |
Used by 8 functions
lv_obj_set_scroll_dir— paramdirlv_barcode_set_direction— paramdirectionlv_chart_add_cursor— paramdirlv_dropdown_set_dir— paramdirlv_spinbox_set_digit_step_direction— paramdirectionlv_tabview_set_tab_bar_position— paramdirlv_tileview_add_tile— paramdirlv_indev_scroll_throw_predict— paramdir
Structs
struct
lv_point_t
Represents a point on the screen.
| Member | Type | Description |
|---|---|---|
x | int32_t | |
y | int32_t |
Used by 48 functions
lv_point_transform— parampointlv_point_transform— parampivotlv_point_array_transform— parampointslv_point_array_transform— parampivotlv_point_to_precise— paramplv_point_set— paramplv_point_swap— paramp1lv_point_swap— paramp2lv_obj_transform_point— paramplv_obj_transform_point_array— parampointslv_obj_hit_test— parampointlv_obj_get_scroll_end— paramendlv_test_gesture_set_pinch_data— parampoint_0lv_test_gesture_set_pinch_data— parampoint_1lv_test_gesture_pinch— parampoint_begin_0lv_test_gesture_pinch— parampoint_begin_1lv_test_gesture_pinch— parampoint_end_0lv_test_gesture_pinch— parampoint_end_1lv_display_rotate_point— parampointlv_display_rotate_point_ccw— parampointlv_draw_character— parampointlv_draw_letter— parampointlv_draw_unit_draw_letter— paramposlv_uefi_simple_pointer_indev_create— paramdisplay_reslv_uefi_absolute_pointer_indev_create— paramdisplay_reslv_text_get_size— paramsize_reslv_indev_set_button_points— parampointslv_indev_get_point— parampointlv_indev_get_vect— parampointlv_indev_search_obj— parampointlv_indev_get_gesture_center_point— parampointlv_indev_get_gesture_primary_point— parampointlv_chart_get_point_pos_by_id— paramp_outlv_chart_set_cursor_pos— paramposlv_gltf_get_ray_from_2d_coordinate— paramscreen_poslv_gltf_world_to_screen— paramscreen_poslv_image_get_pivot— parampivotlv_label_get_letter_pos— paramposlv_label_get_letter_on— parampos_inlv_label_is_char_under_pos— paramposlv_spangroup_get_span_by_point— paramplv_image_buf_get_transformed_area— parampivotlv_draw_unit_draw_letter_internal— paramposlv_freetype_italic_transform_on_pos— parampointlv_indev_scroll_get_snap_dist— paramplv_area_is_point_on— paramp_plv_text_get_size_attributes— paramsize_reslv_text_get_size_internal— paramsize_res
struct
lv_point_precise_t
| Member | Type | Description |
|---|---|---|
x | lv_value_precise_t | |
y | lv_value_precise_t |
Used by 8 functions
lv_point_from_precise— paramplv_point_precise_set— paramplv_point_precise_swap— paramp1lv_point_precise_swap— paramp2lv_matrix_transform_precise_point— parampointlv_line_set_points— parampointslv_line_set_points_mutable— parampointslv_vg_lite_matrix_transform_point— parampoint
struct
lv_area_t
Represents an area of the screen.
| Member | Type | Description |
|---|---|---|
x1 | int32_t | |
y1 | int32_t | |
x2 | int32_t | |
y2 | int32_t |
Macros
LV_COORD_TYPE_SHIFT
#define LV_COORD_TYPE_SHIFT (29U)LV_COORD_TYPE_MASK
#define LV_COORD_TYPE_MASK (3 << LV_COORD_TYPE_SHIFT)LV_COORD_TYPE
#define LV_COORD_TYPE(x) \
((x) & LV_COORD_TYPE_MASK) /*Extract type specifiers*/LV_COORD_PLAIN
#define LV_COORD_PLAIN(x) \
((x) & ~LV_COORD_TYPE_MASK) /*Remove type specifiers*/LV_COORD_TYPE_PX
#define LV_COORD_TYPE_PX (0 << LV_COORD_TYPE_SHIFT)LV_COORD_TYPE_SPEC
#define LV_COORD_TYPE_SPEC (1 << LV_COORD_TYPE_SHIFT)LV_COORD_TYPE_PX_NEG
#define LV_COORD_TYPE_PX_NEG (3 << LV_COORD_TYPE_SHIFT)LV_COORD_IS_PX
#define LV_COORD_IS_PX(x) \
(LV_COORD_TYPE(x) == LV_COORD_TYPE_PX || LV_COORD_TYPE(x) == LV_COORD_TYPE_PX_NEG)LV_COORD_IS_SPEC
#define LV_COORD_IS_SPEC(x) \
(LV_COORD_TYPE(x) == LV_COORD_TYPE_SPEC)LV_COORD_SET_SPEC
#define LV_COORD_SET_SPEC(x) \
((x) | LV_COORD_TYPE_SPEC)LV_COORD_MAX
#define LV_COORD_MAX ((1 << LV_COORD_TYPE_SHIFT) - 1)Max coordinate value
LV_COORD_MIN
#define LV_COORD_MIN (-LV_COORD_MAX)LV_SIZE_CONTENT
#define LV_SIZE_CONTENT LV_COORD_SET_SPEC(LV_COORD_MAX)LV_PCT_STORED_MAX
#define LV_PCT_STORED_MAX (LV_COORD_MAX - 1)LV_PCT_POS_MAX
#define LV_PCT_POS_MAX (LV_PCT_STORED_MAX / 2)LV_PCT
#define LV_PCT(x) \
(LV_COORD_SET_SPEC(((x) < 0 ? (LV_PCT_POS_MAX - LV_MAX((x), -LV_PCT_POS_MAX)) : LV_MIN((x), LV_PCT_POS_MAX))))LV_COORD_IS_PCT
#define LV_COORD_IS_PCT(x) \
((LV_COORD_IS_SPEC(x) && LV_COORD_PLAIN(x) <= LV_PCT_STORED_MAX))LV_COORD_GET_PCT
#define LV_COORD_GET_PCT(x) \
(LV_COORD_PLAIN(x) > LV_PCT_POS_MAX ? LV_PCT_POS_MAX - LV_COORD_PLAIN(x) : LV_COORD_PLAIN(x))Dependencies
Last updated on