1 /**
2  * @file lv_bin_decoder.h
3  *
4  */
5 
6 #ifndef LV_BIN_DECODER_H
7 #define LV_BIN_DECODER_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../../draw/lv_image_decoder.h"
17 
18 /*********************
19  *      DEFINES
20  *********************/
21 
22 /**********************
23  *      TYPEDEFS
24  **********************/
25 
26 /**********************
27  * GLOBAL PROTOTYPES
28  **********************/
29 
30 /**
31  * Initialize the binary image decoder module
32  */
33 void lv_bin_decoder_init(void);
34 
35 /**
36  * Get info about a lvgl binary image
37  * @param decoder the decoder where this function belongs
38  * @param dsc image descriptor containing the source and type of the image and other info.
39  * @param header store the image data here
40  * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
41  */
42 lv_result_t lv_bin_decoder_info(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc, lv_image_header_t * header);
43 
44 lv_result_t lv_bin_decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
45                                     const lv_area_t * full_area, lv_area_t * decoded_area);
46 
47 /**
48  * Open a lvgl binary image
49  * @param decoder the decoder where this function belongs
50  * @param dsc pointer to decoder descriptor. `src`, `style` are already initialized in it.
51  * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
52  */
53 lv_result_t lv_bin_decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
54 
55 /**
56  * Close the pending decoding. Free resources etc.
57  * @param decoder pointer to the decoder the function associated with
58  * @param dsc pointer to decoder descriptor
59  */
60 void lv_bin_decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
61 
62 /**********************
63  *      MACROS
64  **********************/
65 
66 #ifdef __cplusplus
67 } /*extern "C"*/
68 #endif
69 
70 #endif /*LV_BIN_DECODER_H*/
71