1 /** 2 * @file lv_image_header_cache.h 3 * 4 */ 5 6 #ifndef LV_IMAGE_HEADER_CACHE_H 7 #define LV_IMAGE_HEADER_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 header cache. 34 * @param count initial size of the cache in count of image headers. 35 * @return LV_RESULT_OK: initialization succeeded, LV_RESULT_INVALID: failed. 36 */ 37 lv_result_t lv_image_header_cache_init(uint32_t count); 38 39 /** 40 * Resize image header cache. 41 * If set to 0, the cache is disabled. 42 * @param count new max count of cached image headers. 43 * @param evict_now true: evict the image headers should be removed by the eviction policy, false: wait for the next cache cleanup. 44 */ 45 void lv_image_header_cache_resize(uint32_t count, bool evict_now); 46 47 /** 48 * Invalidate image header cache. Use NULL to invalidate all image headers. 49 * It's also automatically called when an image is invalidated. 50 * @param src pointer to an image source. 51 */ 52 void lv_image_header_cache_drop(const void * src); 53 54 /** 55 * Return true if the image header cache is enabled. 56 * @return true: enabled, false: disabled. 57 */ 58 bool lv_image_header_cache_is_enabled(void); 59 60 /** 61 * Create an iterator to iterate over the image header cache. 62 * @return an iterator to iterate over the image header cache. 63 */ 64 lv_iter_t * lv_image_header_cache_iter_create(void); 65 66 /** 67 * Dump the content of the image header cache in a human-readable format with cache order. 68 */ 69 void lv_image_header_cache_dump(void); 70 71 /************************* 72 * GLOBAL VARIABLES 73 *************************/ 74 75 /********************** 76 * MACROS 77 **********************/ 78 79 #ifdef __cplusplus 80 } /*extern "C"*/ 81 #endif 82 83 #endif /*LV_IMAGE_HEADER_CACHE_H*/ 84