lv_line.h

Functions

lv_obj_t *lv_line_create(lv_obj_t *parent)

Create a line object

Parameters:

parent -- pointer to an object, it will be the parent of the new line

Returns:

pointer to the created line

void lv_line_set_points(lv_obj_t *obj, const lv_point_precise_t points[], uint32_t point_num)

Set an array of points. The line object will connect these points.

Parameters:
  • obj -- pointer to a line object

  • points -- an array of points. Only the address is saved, so the array needs to be alive while the line exists

  • point_num -- number of points in 'point_a'

void lv_line_set_points_mutable(lv_obj_t *obj, lv_point_precise_t points[], uint32_t point_num)

Set a non-const array of points. Identical to lv_line_set_points except the array may be retrieved by lv_line_get_points_mutable.

Parameters:
  • obj -- pointer to a line object

  • points -- a non-const array of points. Only the address is saved, so the array needs to be alive while the line exists.

  • point_num -- number of points in 'point_a'

void lv_line_set_y_invert(lv_obj_t *obj, bool en)

Enable (or disable) the y coordinate inversion. If enabled then y will be subtracted from the height of the object, therefore the y = 0 coordinate will be on the bottom.

Parameters:
  • obj -- pointer to a line object

  • en -- true: enable the y inversion, false:disable the y inversion

const lv_point_precise_t *lv_line_get_points(lv_obj_t *obj)

Get the pointer to the array of points.

Parameters:

obj -- pointer to a line object

Returns:

const pointer to the array of points

uint32_t lv_line_get_point_count(lv_obj_t *obj)

Get the number of points in the array of points.

Parameters:

obj -- pointer to a line object

Returns:

number of points in array of points

bool lv_line_is_point_array_mutable(lv_obj_t *obj)

Check the mutability of the stored point array pointer.

Parameters:

obj -- pointer to a line object

Returns:

true: the point array pointer is mutable, false: constant

lv_point_precise_t *lv_line_get_points_mutable(lv_obj_t *obj)

Get a pointer to the mutable array of points or NULL if it is not mutable

Parameters:

obj -- pointer to a line object

Returns:

pointer to the array of points. NULL if not mutable.

bool lv_line_get_y_invert(const lv_obj_t *obj)

Get the y inversion attribute

Parameters:

obj -- pointer to a line object

Returns:

true: y inversion is enabled, false: disabled

Variables

const lv_obj_class_t lv_line_class