1 /** 2 * @file lv_gif.h 3 * 4 */ 5 6 #ifndef LV_GIF_H 7 #define LV_GIF_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 17 #include "../../lv_conf_internal.h" 18 #include "../../misc/lv_types.h" 19 #include "../../draw/lv_draw_buf.h" 20 #include "../../widgets/image/lv_image.h" 21 #include "../../core/lv_obj_class.h" 22 #include LV_STDBOOL_INCLUDE 23 #include LV_STDINT_INCLUDE 24 #if LV_USE_GIF 25 26 #include "gifdec.h" 27 28 /********************* 29 * DEFINES 30 *********************/ 31 32 /********************** 33 * TYPEDEFS 34 **********************/ 35 36 LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_gif_class; 37 38 /********************** 39 * GLOBAL PROTOTYPES 40 **********************/ 41 42 /** 43 * Create a gif object 44 * @param parent pointer to an object, it will be the parent of the new gif. 45 * @return pointer to the gif obj 46 */ 47 lv_obj_t * lv_gif_create(lv_obj_t * parent); 48 49 /** 50 * Set the gif data to display on the object 51 * @param obj pointer to a gif object 52 * @param src 1) pointer to an ::lv_image_dsc_t descriptor (which contains gif raw data) or 53 * 2) path to a gif file (e.g. "S:/dir/anim.gif") 54 */ 55 void lv_gif_set_src(lv_obj_t * obj, const void * src); 56 57 /** 58 * Restart a gif animation. 59 * @param obj pointer to a gif obj 60 */ 61 void lv_gif_restart(lv_obj_t * obj); 62 63 /** 64 * Pause a gif animation. 65 * @param obj pointer to a gif obj 66 */ 67 void lv_gif_pause(lv_obj_t * obj); 68 69 /** 70 * Resume a gif animation. 71 * @param obj pointer to a gif obj 72 */ 73 void lv_gif_resume(lv_obj_t * obj); 74 75 /** 76 * Checks if the GIF was loaded correctly. 77 * @param obj pointer to a gif obj 78 */ 79 bool lv_gif_is_loaded(lv_obj_t * obj); 80 81 /** 82 * Get the loop count for the GIF. 83 * @param obj pointer to a gif obj 84 */ 85 int32_t lv_gif_get_loop_count(lv_obj_t * obj); 86 87 /** 88 * Set the loop count for the GIF. 89 * @param obj pointer to a gif obj 90 * @param count the loop count to set 91 */ 92 void lv_gif_set_loop_count(lv_obj_t * obj, int32_t count); 93 94 /********************** 95 * MACROS 96 **********************/ 97 98 #endif /*LV_USE_GIF*/ 99 100 #ifdef __cplusplus 101 } /* extern "C" */ 102 #endif 103 104 #endif /*LV_GIF_H*/ 105