summaryrefslogtreecommitdiff
path: root/src/lib/ecore/efl_divisor_interpolator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore/efl_divisor_interpolator.c')
-rw-r--r--src/lib/ecore/efl_divisor_interpolator.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/lib/ecore/efl_divisor_interpolator.c b/src/lib/ecore/efl_divisor_interpolator.c
index 3cbc12b..2d96764 100644
--- a/src/lib/ecore/efl_divisor_interpolator.c
+++ b/src/lib/ecore/efl_divisor_interpolator.c
@@ -11,7 +11,8 @@ typedef struct _Efl_Divisor_Interpolator_Data Efl_Divisor_Interpolator_Data;
11 11
12struct _Efl_Divisor_Interpolator_Data 12struct _Efl_Divisor_Interpolator_Data
13{ 13{
14 double factor[2]; 14 double divisor;
15 int power;
15}; 16};
16 17
17EOLIAN static double 18EOLIAN static double
@@ -23,28 +24,36 @@ _efl_divisor_interpolator_efl_interpolator_interpolate(Eo *eo_obj EINA_UNUSED,
23 return progress; 24 return progress;
24 25
25 return ecore_animator_pos_map(progress, ECORE_POS_MAP_DIVISOR_INTERP, 26 return ecore_animator_pos_map(progress, ECORE_POS_MAP_DIVISOR_INTERP,
26 pd->factor[0], pd->factor[1]); 27 pd->divisor, (double)pd->power);
27} 28}
28 29
29EOLIAN static void 30EOLIAN static void
30_efl_divisor_interpolator_factors_set(Eo *eo_obj EINA_UNUSED, 31_efl_divisor_interpolator_divisor_set(Eo *eo_obj EINA_UNUSED,
31 Efl_Divisor_Interpolator_Data *pd, 32 Efl_Divisor_Interpolator_Data *pd,
32 double factor1, double factor2) 33 double divisor)
33{ 34{
34 pd->factor[0] = factor1; 35 pd->divisor = divisor;
35 pd->factor[1] = factor2;
36} 36}
37 37
38EOLIAN static double
39_efl_divisor_interpolator_divisor_get(const Eo *eo_obj EINA_UNUSED,
40 Efl_Divisor_Interpolator_Data *pd)
41{
42 return pd->divisor;
43}
38EOLIAN static void 44EOLIAN static void
39_efl_divisor_interpolator_factors_get(const Eo *eo_obj EINA_UNUSED, 45_efl_divisor_interpolator_power_set(Eo *eo_obj EINA_UNUSED,
40 Efl_Divisor_Interpolator_Data *pd, 46 Efl_Divisor_Interpolator_Data *pd,
41 double *factor1, double *factor2) 47 int power)
42{ 48{
43 if (factor1) 49 pd->power = power;
44 *factor1 = pd->factor[0]; 50}
45 51
46 if (factor2) 52EOLIAN static int
47 *factor2 = pd->factor[1]; 53_efl_divisor_interpolator_power_get(const Eo *eo_obj EINA_UNUSED,
54 Efl_Divisor_Interpolator_Data *pd)
55{
56 return pd->power;
48} 57}
49 58
50EOLIAN static Efl_Object * 59EOLIAN static Efl_Object *
@@ -53,8 +62,8 @@ _efl_divisor_interpolator_efl_object_constructor(Eo *eo_obj,
53{ 62{
54 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); 63 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
55 64
56 pd->factor[0] = 1.0; 65 pd->divisor = 1.0;
57 pd->factor[1] = 1.0; 66 pd->power = 1;
58 67
59 return eo_obj; 68 return eo_obj;
60} 69}