Tizen 2.0 Release
[apps/core/preloaded/ug-image-viewer-efl.git] / slideshow / src / effect / include / ivug-anim.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *        http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __IVUG_ANIM_H__
18 #define __IVUG_ANIM_H__
19
20 #include <stdbool.h>
21
22 typedef enum {
23         ANIM_TYPE_LINEAR,
24         ANIM_TYPE_QUARTIC_INOUT,
25         ANIM_TYPE_QUINTIC_INOUT,
26         ANIM_TYPE_SINE,
27 } anim_type_t;
28
29 /*
30         t: current time b: start time c: change in value d: duration
31 */
32 typedef double (*anim_transit_func_t) (double t, double b, double c, double d);
33
34 typedef struct {
35 /* private */
36         double duration;
37         double t_start;
38         double t_varing;
39
40         anim_transit_func_t transit_func;
41
42         void *user_data;
43 } anim_handle_t;
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 anim_handle_t *create_animation();
50
51 void delete_animation(anim_handle_t *anim);
52
53 bool update_animation(anim_handle_t *anim, double current, double *value);
54
55 bool set_animation_type(anim_handle_t *anim, anim_type_t type);
56
57 bool set_animation(anim_handle_t *anim, int start, int end, double duration);
58
59 #ifdef __cplusplus
60 }
61 #endif
62
63
64 #endif