blob: 87df815404f5cb650243d4308d56aa6011c13312 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
/**
* @file lv_animimg.h
*
*/
#ifndef LV_ANIM_IMAGE_H
#define LV_ANIM_IMAGE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../image/lv_image.h"
#if LV_USE_ANIMIMG != 0
/*Testing of dependencies*/
#if LV_USE_IMAGE == 0
#error "lv_animimg: lv_img is required. Enable it in lv_conf.h (LV_USE_IMAGE 1)"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
LV_ATTRIBUTE_EXTERN_DATA extern const lv_obj_class_t lv_animimg_class;
/*Data of the animimage*/
typedef struct {
lv_image_t img;
lv_anim_t anim;
/*picture sequence */
const void ** dsc;
int8_t pic_count;
} lv_animimg_t;
/*Image parts*/
enum _lv_animimg_part_t {
LV_ANIM_IMAGE_PART_MAIN,
};
#ifdef DOXYGEN
typedef _lv_animimg_part_t lv_animimg_part_t;
#else
typedef uint8_t lv_animimg_part_t;
#endif
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Create an animation image objects
* @param parent pointer to an object, it will be the parent of the new button
* @return pointer to the created animation image object
*/
lv_obj_t * lv_animimg_create(lv_obj_t * parent);
/*=====================
* Setter functions
*====================*/
/**
* Set the image animation images source.
* @param img pointer to an animation image object
* @param dsc pointer to a series images
* @param num images' number
*/
void lv_animimg_set_src(lv_obj_t * img, const void * dsc[], size_t num);
/**
* Startup the image animation.
* @param obj pointer to an animation image object
*/
void lv_animimg_start(lv_obj_t * obj);
/**
* Set the image animation duration time. unit:ms
* @param img pointer to an animation image object
* @param duration the duration in milliseconds
*/
void lv_animimg_set_duration(lv_obj_t * img, uint32_t duration);
/**
* Set the image animation repeatedly play times.
* @param img pointer to an animation image object
* @param count the number of times to repeat the animation
*/
void lv_animimg_set_repeat_count(lv_obj_t * img, uint32_t count);
/*=====================
* Getter functions
*====================*/
/**
* Get the image animation images source.
* @param img pointer to an animation image object
* @return a pointer that will point to a series images
*/
const void ** lv_animimg_get_src(lv_obj_t * img);
/**
* Get the image animation images source.
* @param img pointer to an animation image object
* @return the number of source images
*/
uint8_t lv_animimg_get_src_count(lv_obj_t * img);
/**
* Get the image animation duration time. unit:ms
* @param img pointer to an animation image object
* @return the animation duration time
*/
uint32_t lv_animimg_get_duration(lv_obj_t * img);
/**
* Get the image animation repeat play times.
* @param img pointer to an animation image object
* @return the repeat count
*/
uint32_t lv_animimg_get_repeat_count(lv_obj_t * img);
#endif /*LV_USE_ANIMIMG*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_ANIM_IMAGE_H*/
|