lv_draw_sw_grad.h

Functions

void lv_draw_sw_grad_color_calculate(const lv_grad_dsc_t *dsc, int32_t range, int32_t frac, lv_color_t *color_out, lv_opa_t *opa_out)

Compute the color in the given gradient and fraction Gradient are specified in a virtual [0-255] range, so this function scales the virtual range to the given range

Parameters:
  • dsc – The gradient descriptor to use

  • range – The range to use in computation.

  • frac – The current part used in the range. frac is in [0; range]

  • color_out – Calculated gradient color

  • opa_out – Calculated opacity

lv_draw_sw_grad_calc_t *lv_draw_sw_grad_get(const lv_grad_dsc_t *gradient, int32_t w, int32_t h)

Get a gradient cache from the given parameters

void lv_draw_sw_grad_cleanup(lv_draw_sw_grad_calc_t *grad)

Clean up the gradient item after it was get with lv_grad_get_from_cache.

Parameters:

grad – pointer to a gradient

void lv_draw_sw_grad_linear_setup(lv_grad_dsc_t *dsc, const lv_area_t *coords)

Calculate constants from the given parameters that are used during rendering

Parameters:
  • dsc – gradient descriptor

  • coords – the area where to draw the gradient

void lv_draw_sw_grad_linear_cleanup(lv_grad_dsc_t *dsc)

Free up the allocated memory for the gradient calculation

Parameters:

dsc – gradient descriptor

void lv_draw_sw_grad_linear_get_line(lv_grad_dsc_t *dsc, int32_t xp, int32_t yp, int32_t width, lv_draw_sw_grad_calc_t *result)

Calculate a line segment of a linear gradient

Parameters:
  • dsc – gradient descriptor

  • xp – starting point x coordinate in gradient space

  • yp – starting point y coordinate in gradient space

  • width – width of the line segment in pixels

  • result – color buffer for the resulting line segment

void lv_draw_sw_grad_radial_setup(lv_grad_dsc_t *dsc, const lv_area_t *coords)

Calculate constants from the given parameters that are used during rendering

Parameters:
  • dsc – gradient descriptor

  • coords – the area where to draw the gradient

void lv_draw_sw_grad_radial_cleanup(lv_grad_dsc_t *dsc)

Free up the allocated memory for the gradient calculation

Parameters:

dsc – gradient descriptor

void lv_draw_sw_grad_radial_get_line(lv_grad_dsc_t *dsc, int32_t xp, int32_t yp, int32_t width, lv_draw_sw_grad_calc_t *result)

Calculate a line segment of a radial gradient

Parameters:
  • dsc – gradient descriptor

  • xp – starting point x coordinate in gradient space

  • yp – starting point y coordinate in gradient space

  • width – width of the line segment in pixels

  • result – color buffer for the resulting line segment

void lv_draw_sw_grad_conical_setup(lv_grad_dsc_t *dsc, const lv_area_t *coords)

Calculate constants from the given parameters that are used during rendering

Parameters:
  • dsc – gradient descriptor

  • coords – the area where to draw the gradient

void lv_draw_sw_grad_conical_cleanup(lv_grad_dsc_t *dsc)

Free up the allocated memory for the gradient calculation

Parameters:

dsc – gradient descriptor

void lv_draw_sw_grad_conical_get_line(lv_grad_dsc_t *dsc, int32_t xp, int32_t yp, int32_t width, lv_draw_sw_grad_calc_t *result)

Calculate a line segment of a conical gradient

Parameters:
  • dsc – gradient descriptor

  • xp – starting point x coordinate in gradient space

  • yp – starting point y coordinate in gradient space

  • width – width of the line segment in pixels

  • result – color buffer for the resulting line segment

struct lv_draw_sw_grad_calc_t

Public Members

lv_color_t *color_map
lv_opa_t *opa_map
uint32_t size