1 /**
2 * @file lv_image_cache.h
3 *
4  */
5 
6 #ifndef LV_IMAGE_CACHE_H
7 #define LV_IMAGE_CACHE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../../lv_conf_internal.h"
18 #include "../lv_types.h"
19 
20 /*********************
21  *      DEFINES
22  *********************/
23 
24 /**********************
25  *      TYPEDEFS
26  **********************/
27 
28 /**********************
29  * GLOBAL PROTOTYPES
30  **********************/
31 
32 /**
33  * Initialize image cache.
34  * @param  size size of the cache in bytes.
35  * @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed.
36  */
37 lv_result_t lv_image_cache_init(uint32_t size);
38 
39 /**
40  * Resize image cache.
41  * If set to 0, the cache will be disabled.
42  * @param new_size  new size of the cache in bytes.
43  * @param evict_now true: evict the images should be removed by the eviction policy, false: wait for the next cache cleanup.
44  */
45 void lv_image_cache_resize(uint32_t new_size, bool evict_now);
46 
47 /**
48  * Invalidate image cache. Use NULL to invalidate all images.
49  * @param src pointer to an image source.
50  */
51 void lv_image_cache_drop(const void * src);
52 
53 /**
54  * Return true if the image cache is enabled.
55  * @return true: enabled, false: disabled.
56  */
57 bool lv_image_cache_is_enabled(void);
58 
59 /**
60  * Create an iterator to iterate over the image cache.
61  * @return an iterator to iterate over the image cache.
62  */
63 lv_iter_t * lv_image_cache_iter_create(void);
64 
65 /**
66  * Dump the content of the image cache in a human-readable format with cache order.
67  */
68 void lv_image_cache_dump(void);
69 
70 /*************************
71  *    GLOBAL VARIABLES
72  *************************/
73 
74 /**********************
75  *      MACROS
76  **********************/
77 
78 #ifdef __cplusplus
79 } /*extern "C"*/
80 #endif
81 
82 #endif /*LV_IMAGE_CACHE_H*/
83