lv_area.h

API reference for lv_area.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_area_private.h

Functions

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)
Parameters
NameTypeDescription
area_plv_area_t *pointer to an area
x1int32_tleft coordinate of the area
y1int32_ttop coordinate of the area
x2int32_tright coordinate of the area
y2int32_tbottom coordinate of the area

lv_area_set_width

Set the width of an area

 
void lv_area_set_width(lv_area_t *area_p, int32_t w)
Parameters
NameTypeDescription
area_plv_area_t *pointer to an area
wint32_tthe new width of the area (w == 1 makes x1 == x2)

lv_area_set_height

Set the height of an area

 
void lv_area_set_height(lv_area_t *area_p, int32_t h)
Parameters
NameTypeDescription
area_plv_area_t *pointer to an area
hint32_tthe new height of the area (h == 1 makes y1 == y2)

lv_point_set

 
void lv_point_set(lv_point_t *p, int32_t x, int32_t y)
Parameters

lv_point_precise_set

 
void lv_point_precise_set(lv_point_precise_t *p, lv_value_precise_t x, lv_value_precise_t y)
Parameters

Enums

lv_align_t

Alignments

NameValue
LV_ALIGN_DEFAULT0
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_obj_set_align — param align
  • lv_obj_align — param align
  • lv_obj_align_to — param align
  • lv_obj_set_style_align — param value
  • lv_area_align — param align
  • lv_style_set_align — param value

lv_dir_t

NameValue
LV_DIR_NONE0x00
LV_DIR_LEFT(1 << 0)
LV_DIR_RIGHT(1 << 1)
LV_DIR_TOP(1 << 2)
LV_DIR_BOTTOM(1 << 3)
LV_DIR_HORLV_DIR_LEFT | LV_DIR_RIGHT
LV_DIR_VERLV_DIR_TOP | LV_DIR_BOTTOM
LV_DIR_ALLLV_DIR_HOR | LV_DIR_VER
Used by 8 functions
  • lv_obj_set_scroll_dir — param dir
  • lv_indev_scroll_throw_predict — param dir
  • lv_barcode_set_direction — param direction
  • lv_chart_add_cursor — param dir
  • lv_dropdown_set_dir — param dir
  • lv_spinbox_set_digit_step_direction — param direction
  • lv_tabview_set_tab_bar_position — param dir
  • lv_tileview_add_tile — param dir

Structs

struct

lv_point_t

Represents a point on the screen.

MemberTypeDescription
xint32_t
yint32_t
Used by 45 functions
  • lv_obj_transform_point — param p
  • lv_obj_transform_point_array — param points
  • lv_obj_hit_test — param point
  • lv_obj_get_scroll_end — param end
  • lv_test_gesture_set_pinch_data — param point_0
  • lv_test_gesture_set_pinch_data — param point_1
  • lv_test_gesture_pinch — param point_begin_0
  • lv_test_gesture_pinch — param point_begin_1
  • lv_test_gesture_pinch — param point_end_0
  • lv_test_gesture_pinch — param point_end_1
  • lv_display_rotate_point — param point
  • lv_image_buf_get_transformed_area — param pivot
  • lv_draw_character — param point
  • lv_draw_letter — param point
  • lv_draw_unit_draw_letter — param pos
  • lv_uefi_simple_pointer_indev_create — param display_res
  • lv_uefi_absolute_pointer_indev_create — param display_res
  • lv_indev_set_button_points — param points
  • lv_indev_get_point — param point
  • lv_indev_get_vect — param point
  • lv_indev_search_obj — param point
  • lv_indev_get_gesture_center_point — param point
  • lv_indev_get_gesture_primary_point — param point
  • lv_indev_scroll_get_snap_dist — param p
  • lv_freetype_italic_transform_on_pos — param point
  • lv_gltf_get_ray_from_2d_coordinate — param screen_pos
  • lv_gltf_world_to_screen — param screen_pos
  • lv_point_transform — param point
  • lv_point_transform — param pivot
  • lv_point_array_transform — param points
  • lv_point_array_transform — param pivot
  • lv_point_to_precise — param p
  • lv_point_set — param p
  • lv_point_swap — param p1
  • lv_point_swap — param p2
  • lv_area_is_point_on — param p_p
  • lv_text_get_size — param size_res
  • lv_text_get_size_attributes — param size_res
  • lv_chart_get_point_pos_by_id — param p_out
  • lv_chart_set_cursor_pos — param pos
  • lv_image_get_pivot — param pivot
  • lv_label_get_letter_pos — param pos
  • lv_label_get_letter_on — param pos_in
  • lv_label_is_char_under_pos — param pos
  • lv_spangroup_get_span_by_point — param point
struct

lv_point_precise_t

Used by 8 functions
  • lv_vg_lite_matrix_transform_point — param point
  • lv_point_from_precise — param p
  • lv_point_precise_set — param p
  • lv_point_precise_swap — param p1
  • lv_point_precise_swap — param p2
  • lv_matrix_transform_precise_point — param point
  • lv_line_set_points — param points
  • lv_line_set_points_mutable — param points
struct

lv_area_t

Represents an area of the screen.

MemberTypeDescription
x1int32_t
y1int32_t
x2int32_t
y2int32_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

How is this guide?

Last updated on

On this page