mikroSDK Reference Manual
lv_img_decoder.h
Go to the documentation of this file.
1
6#ifndef LV_IMG_DECODER_H
7#define LV_IMG_DECODER_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../lv_conf_internal.h"
17
18#include <stdint.h>
19#include "lv_img_buf.h"
20#include "../misc/lv_fs.h"
21#include "../misc/lv_types.h"
22#include "../misc/lv_area.h"
23
24/*********************
25 * DEFINES
26 *********************/
27
28/**********************
29 * TYPEDEFS
30 **********************/
31
34enum {
35 LV_IMG_SRC_VARIABLE,
39};
40
41typedef uint8_t lv_img_src_t;
42
43/*Decoder function definitions*/
46
54typedef lv_res_t (*lv_img_decoder_info_f_t)(struct _lv_img_decoder_t * decoder, const void * src,
55 lv_img_header_t * header);
56
62typedef lv_res_t (*lv_img_decoder_open_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc);
63
75typedef lv_res_t (*lv_img_decoder_read_line_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc,
76 lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t * buf);
77
83typedef void (*lv_img_decoder_close_f_t)(struct _lv_img_decoder_t * decoder, struct _lv_img_decoder_dsc_t * dsc);
84
85
86typedef struct _lv_img_decoder_t {
91
92#if LV_USE_USER_DATA
93 void * user_data;
94#endif
96
97
99typedef struct _lv_img_decoder_dsc_t {
102
104 const void * src;
105
107 lv_color_t color;
108
110 int32_t frame_id;
111
113 lv_img_src_t src_type;
114
117
120 const uint8_t * img_data;
121
124 uint32_t time_to_open;
125
128 const char * error_msg;
129
131 void * user_data;
133
134/**********************
135 * GLOBAL PROTOTYPES
136 **********************/
137
142
153lv_res_t lv_img_decoder_get_info(const void * src, lv_img_header_t * header);
154
168lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id);
169
179lv_res_t lv_img_decoder_read_line(lv_img_decoder_dsc_t * dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len,
180 uint8_t * buf);
181
187
193
199
206
213
220
227
235lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header);
236
244
257 lv_coord_t y, lv_coord_t len, uint8_t * buf);
258
265
266/**********************
267 * MACROS
268 **********************/
269
270#ifdef __cplusplus
271} /*extern "C"*/
272#endif
273
274#endif /*LV_IMG_DECODER_H*/
lv_img_decoder_t * lv_img_decoder_create(void)
void _lv_img_decoder_init(void)
lv_res_t lv_img_decoder_built_in_read_line(lv_img_decoder_t *decoder, lv_img_decoder_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t *buf)
void lv_img_decoder_built_in_close(lv_img_decoder_t *decoder, lv_img_decoder_dsc_t *dsc)
void lv_img_decoder_set_close_cb(lv_img_decoder_t *decoder, lv_img_decoder_close_f_t close_cb)
void lv_img_decoder_delete(lv_img_decoder_t *decoder)
void lv_img_decoder_close(lv_img_decoder_dsc_t *dsc)
lv_res_t lv_img_decoder_get_info(const void *src, lv_img_header_t *header)
@ LV_IMG_SRC_FILE
Definition lv_img_decoder.h:36
@ LV_IMG_SRC_UNKNOWN
Definition lv_img_decoder.h:38
@ LV_IMG_SRC_SYMBOL
Definition lv_img_decoder.h:37
void lv_img_decoder_set_info_cb(lv_img_decoder_t *decoder, lv_img_decoder_info_f_t info_cb)
void lv_img_decoder_set_open_cb(lv_img_decoder_t *decoder, lv_img_decoder_open_f_t open_cb)
void lv_img_decoder_set_read_line_cb(lv_img_decoder_t *decoder, lv_img_decoder_read_line_f_t read_line_cb)
lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t *dsc, const void *src, lv_color_t color, int32_t frame_id)
lv_res_t lv_img_decoder_read_line(lv_img_decoder_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t *buf)
void(* lv_img_decoder_close_f_t)(struct _lv_img_decoder_t *decoder, struct _lv_img_decoder_dsc_t *dsc)
Definition lv_img_decoder.h:83
lv_res_t(* lv_img_decoder_open_f_t)(struct _lv_img_decoder_t *decoder, struct _lv_img_decoder_dsc_t *dsc)
Definition lv_img_decoder.h:62
lv_res_t(* lv_img_decoder_read_line_f_t)(struct _lv_img_decoder_t *decoder, struct _lv_img_decoder_dsc_t *dsc, lv_coord_t x, lv_coord_t y, lv_coord_t len, uint8_t *buf)
Definition lv_img_decoder.h:75
lv_res_t(* lv_img_decoder_info_f_t)(struct _lv_img_decoder_t *decoder, const void *src, lv_img_header_t *header)
Definition lv_img_decoder.h:54
lv_res_t lv_img_decoder_built_in_open(lv_img_decoder_t *decoder, lv_img_decoder_dsc_t *dsc)
lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t *decoder, const void *src, lv_img_header_t *header)
struct _lv_img_decoder_dsc_t lv_img_decoder_dsc_t
Definition lv_img_decoder.h:99
lv_img_src_t src_type
Definition lv_img_decoder.h:113
const uint8_t * img_data
Definition lv_img_decoder.h:120
lv_img_decoder_t * decoder
Definition lv_img_decoder.h:101
lv_color_t color
Definition lv_img_decoder.h:107
const void * src
Definition lv_img_decoder.h:104
int32_t frame_id
Definition lv_img_decoder.h:110
lv_img_header_t header
Definition lv_img_decoder.h:116
const char * error_msg
Definition lv_img_decoder.h:128
void * user_data
Definition lv_img_decoder.h:131
uint32_t time_to_open
Definition lv_img_decoder.h:124
Definition lv_img_decoder.h:86
Definition lv_img_buf.h:126