lv_image_decoder_private.h

API reference for lv_image_decoder_private.h

Report on GitHub
See Also: Public APIThis is the private implementation. See the public header for the stable interface.lv_image_decoder.h

Functions

lv_image_decoder_init

Initialize the image decoder module

 
void lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count)
Parameters
NameTypeDescription
image_cache_sizeuint32_tImage cache size in bytes. 0 to disable cache.
image_header_countuint32_tNumber of header cache entries. 0 to disable header cache.

lv_image_decoder_deinit

Deinitialize the image decoder module

 
void lv_image_decoder_deinit(void)

Structs

struct

_lv_image_decoder_args_t

Image decoder args. It determines how to decoder an image, e.g. whether to premultiply the alpha or not. It should be passed to lv_img_decoder_open() function. If NULL is provided, default args are used.

Default args: all field are zero or false.

MemberTypeDescription
stride_alignboolWhether stride should be aligned
premultiplyboolWhether image should be premultiplied or not after decoding
no_cacheboolWhen set, decoded image won't be put to cache, and decoder open will also ignore cache.
use_indexedboolDecoded indexed image as is. Convert to ARGB8888 if false.
flush_cacheboolWhether to flush the data cache after decoding
struct

_lv_image_decoder_t

MemberTypeDescription
info_cblv_image_decoder_info_f_t
open_cblv_image_decoder_open_f_t
get_area_cblv_image_decoder_get_area_cb_t
close_cblv_image_decoder_close_f_t
custom_draw_cblv_image_decoder_custom_draw_t
nameconst char *
user_datavoid *
struct

_lv_image_cache_data_t

MemberTypeDescription
slotlv_cache_slot_size_t
srcconst void *
src_typelv_image_src_t
decodedconst lv_draw_buf_t *
decoderconst lv_image_decoder_t *
user_datavoid *
struct

_lv_image_header_cache_data_t

MemberTypeDescription
srcconst void *
src_typelv_image_src_t
headerlv_image_header_t
decoderlv_image_decoder_t *
struct

_lv_image_decoder_dsc_t

Describe an image decoding session. Stores data about the decoding

MemberTypeDescription
decoderlv_image_decoder_t *The decoder which was able to open the image source
argslv_image_decoder_args_tA copy of parameters of how this image is decoded
srcconst void *The image source. A file path like "S:my_img.png" or pointer to an lv_image_dsc_t variable
src_typelv_image_src_tType of the source: file or variable. Can be set in open function if required
filelv_fs_file_t
headerlv_image_header_tInfo about the opened image: color format, size, etc. MUST be set in open function
decodedconst lv_draw_buf_t *Pointer to a draw buffer where the image's data (pixels) are stored in a decoded, plain format. MUST be set in open or get_area_cbfunction
paletteconst lv_color32_t *
palette_sizeuint32_t
time_to_openuint32_tHow much time did it take to open the image. [ms] If not set lv_image_cache will measure and set the time to open
error_msgconst char *A text to display instead of the image when the image can't be opened. Can be set in open function or set NULL.
cachelv_cache_t *
cache_entrylv_cache_entry_t *Point to cache entry information
user_datavoid *Store any custom data here is required

Dependencies

How is this guide?

Last updated on

On this page