Go to the source code of this file.
|
| void | lv_draw_img (const lv_area_t *coords, const lv_area_t *mask, const void *src, const lv_style_t *style, lv_opa_t opa_scale) |
| |
| lv_img_src_t | lv_img_src_get_type (const void *src) |
| |
| lv_color_t | lv_img_buf_get_px_color (lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, const lv_style_t *style) |
| |
| lv_opa_t | lv_img_buf_get_px_alpha (lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y) |
| |
| void | lv_img_buf_set_px_color (lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_color_t c) |
| |
| void | lv_img_buf_set_px_alpha (lv_img_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_opa_t opa) |
| |
| void | lv_img_buf_set_palette (lv_img_dsc_t *dsc, uint8_t id, lv_color_t c) |
| |
| uint8_t | lv_img_color_format_get_px_size (lv_img_cf_t cf) |
| |
| bool | lv_img_color_format_is_chroma_keyed (lv_img_cf_t cf) |
| |
| bool | lv_img_color_format_has_alpha (lv_img_cf_t cf) |
| |
§ lv_draw_img()
Draw an image
- Parameters
-
| coords | the coordinates of the image |
| mask | the image will be drawn only in this area |
| src | pointer to a lv_color_t array which contains the pixels of the image |
| style | style of the image |
| opa_scale | scale down all opacities by the factor |
§ lv_img_src_get_type()
Get the type of an image source
- Parameters
-
| src | pointer to an image source:
- pointer to an 'lv_img_t' variable (image stored internally and compiled into the code)
- a path to a file (e.g. "S:/folder/image.bin")
- or a symbol (e.g. LV_SYMBOL_CLOSE)
|
- Returns
- type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN
§ lv_img_buf_get_px_color()
| lv_color_t lv_img_buf_get_px_color |
( |
lv_img_dsc_t * |
dsc, |
|
|
lv_coord_t |
x, |
|
|
lv_coord_t |
y, |
|
|
const lv_style_t * |
style |
|
) |
| |
Get the color of an image's pixel
- Parameters
-
| dsc | an image descriptor |
| x | x coordinate of the point to get |
| y | x coordinate of the point to get |
| style | style of the image. In case of LV_IMG_CF_ALPHA_1/2/4/8 style->image.color shows the color. Can be NULL but for ALPHA images black will be returned. In other cases it is not used. |
- Returns
- color of the point
§ lv_img_buf_get_px_alpha()
Get the alpha value of an image's pixel
- Parameters
-
| dsc | pointer to an image descriptor |
| x | x coordinate of the point to set |
| y | x coordinate of the point to set |
- Returns
- alpha value of the point
§ lv_img_buf_set_px_color()
| void lv_img_buf_set_px_color |
( |
lv_img_dsc_t * |
dsc, |
|
|
lv_coord_t |
x, |
|
|
lv_coord_t |
y, |
|
|
lv_color_t |
c |
|
) |
| |
Set the color of a pixel of an image. The alpha channel won't be affected.
- Parameters
-
| dsc | pointer to an image descriptor |
| x | x coordinate of the point to set |
| y | x coordinate of the point to set |
| c | color of the point |
§ lv_img_buf_set_px_alpha()
Set the alpha value of a pixel of an image. The color won't be affected
- Parameters
-
| dsc | pointer to an image descriptor |
| x | x coordinate of the point to set |
| y | x coordinate of the point to set |
| opa | the desired opacity |
§ lv_img_buf_set_palette()
| void lv_img_buf_set_palette |
( |
lv_img_dsc_t * |
dsc, |
|
|
uint8_t |
id, |
|
|
lv_color_t |
c |
|
) |
| |
Set the palette color of an indexed image. Valid only for LV_IMG_CF_INDEXED1/2/4/8
- Parameters
-
| dsc | pointer to an image descriptor |
| id | the palette color to set:
- for
LV_IMG_CF_INDEXED1: 0..1
- for
LV_IMG_CF_INDEXED2: 0..3
- for
LV_IMG_CF_INDEXED4: 0..15
- for
LV_IMG_CF_INDEXED8: 0..255
|
| c | the color to set |
§ lv_img_color_format_get_px_size()
| uint8_t lv_img_color_format_get_px_size |
( |
lv_img_cf_t |
cf | ) |
|
Get the pixel size of a color format in bits
- Parameters
-
| cf | a color format (LV_IMG_CF_...) |
- Returns
- the pixel size in bits
§ lv_img_color_format_is_chroma_keyed()
| bool lv_img_color_format_is_chroma_keyed |
( |
lv_img_cf_t |
cf | ) |
|
Check if a color format is chroma keyed or not
- Parameters
-
| cf | a color format (LV_IMG_CF_...) |
- Returns
- true: chroma keyed; false: not chroma keyed
§ lv_img_color_format_has_alpha()
Check if a color format has alpha channel or not
- Parameters
-
| cf | a color format (LV_IMG_CF_...) |
- Returns
- true: has alpha channel; false: doesn't have alpha channel