lv_image_decoder_private.h

Functions

void lv_image_decoder_init(uint32_t image_cache_size, uint32_t image_header_count)

Initialize the image decoder module

Parameters:
  • image_cache_size – Image cache size in bytes. 0 to disable cache.

  • image_header_count – Number of header cache entries. 0 to disable header cache.

void lv_image_decoder_deinit(void)

Deinitialize the image decoder module

struct _lv_image_decoder_args_t
#include <lv_image_decoder_private.h>

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.

Public Members

bool stride_align

Whether stride should be aligned

bool premultiply

Whether image should be premultiplied or not after decoding

bool no_cache

When set, decoded image won't be put to cache, and decoder open will also ignore cache.

bool use_indexed

Decoded indexed image as is. Convert to ARGB8888 if false.

bool flush_cache

Whether to flush the data cache after decoding

struct _lv_image_decoder_t

Public Members

lv_image_decoder_info_f_t info_cb
lv_image_decoder_open_f_t open_cb
lv_image_decoder_get_area_cb_t get_area_cb
lv_image_decoder_close_f_t close_cb
lv_image_decoder_custom_draw_t custom_draw_cb
const char *name
void *user_data
struct _lv_image_cache_data_t

Public Members

lv_cache_slot_size_t slot
const void *src
lv_image_src_t src_type
const lv_draw_buf_t *decoded
const lv_image_decoder_t *decoder
void *user_data
struct _lv_image_header_cache_data_t

Public Members

const void *src
lv_image_src_t src_type
lv_image_header_t header
lv_image_decoder_t *decoder
struct _lv_image_decoder_dsc_t
#include <lv_image_decoder_private.h>

Describe an image decoding session. Stores data about the decoding

Public Members

lv_image_decoder_t *decoder

The decoder which was able to open the image source

lv_image_decoder_args_t args

A copy of parameters of how this image is decoded

const void *src

The image source. A file path like "S:my_img.png" or pointer to an lv_image_dsc_t variable

lv_image_src_t src_type

Type of the source: file or variable. Can be set in open function if required

lv_fs_file_t file
lv_image_header_t header

Info about the opened image: color format, size, etc. MUST be set in open function

const lv_draw_buf_t *decoded

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

const lv_color32_t *palette
uint32_t palette_size
uint32_t time_to_open

How much time did it take to open the image. [ms] If not set lv_image_cache will measure and set the time to open

const char *error_msg

A text to display instead of the image when the image can't be opened. Can be set in open function or set NULL.

lv_cache_t *cache
lv_cache_entry_t *cache_entry

Point to cache entry information

void *user_data

Store any custom data here is required