summaryrefslogtreecommitdiff
path: root/main/src/effect
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/effect')
-rwxr-xr-xmain/src/effect/include/ivug-anim.h56
-rwxr-xr-xmain/src/effect/include/ivug-effect.h90
-rwxr-xr-xmain/src/effect/ivug-anim.c178
-rwxr-xr-xmain/src/effect/ivug-effect.c201
-rwxr-xr-xmain/src/effect/ivug-slide.c107
-rwxr-xr-xmain/src/effect/template.c83
6 files changed, 0 insertions, 715 deletions
diff --git a/main/src/effect/include/ivug-anim.h b/main/src/effect/include/ivug-anim.h
deleted file mode 100755
index cf7ddfa..0000000
--- a/main/src/effect/include/ivug-anim.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __IVUG_ANIM_H__
-#define __IVUG_ANIM_H__
-
-#include <stdbool.h>
-
-typedef enum {
- ANIM_TYPE_LINEAR,
- ANIM_TYPE_QUARTIC_INOUT,
- ANIM_TYPE_QUINTIC_INOUT,
- ANIM_TYPE_SINE,
-} anim_type_t;
-
-/*
- t: current time b: start time c: change in value d: duration
-*/
-typedef double (*anim_transit_func_t) (double t, double b, double c, double d);
-
-typedef struct {
-/* private */
- double duration;
- double t_start;
- double t_varing;
-
- anim_transit_func_t transit_func;
-
- void *user_data;
-} anim_handle_t;
-
-anim_handle_t *create_animation();
-
-void delete_animation(anim_handle_t *anim);
-
-bool update_animation(anim_handle_t *anim, double current, int *value);
-
-bool set_animation_type(anim_handle_t *anim, anim_type_t type);
-
-bool set_animation(anim_handle_t *anim, int start, int end, double duration);
-
-#endif
diff --git a/main/src/effect/include/ivug-effect.h b/main/src/effect/include/ivug-effect.h
deleted file mode 100755
index 7594c54..0000000
--- a/main/src/effect/include/ivug-effect.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef __IVUG_EFFECT_H__
-#define __IVUG_EFFECT_H__
-
-#include <stdbool.h>
-#include <Elementary.h>
-#include "ivug-anim.h"
-
-#define EFFECT_LBYTES_ARGB8888(w) (((w) * 4))
-#define MAX_PERCENT (100.0f)
-#define MIN_PERCENT (0.0f)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void *Effect_Data ;
-
-typedef void (*FuncFinished)(void *data);
-
-typedef struct {
- Effect_Data eng_data;
-
- FuncFinished pFinishedCB;
- void *ClientData;
-
- double t_base; // start time.
- anim_handle_t *anim;
- Ecore_Animator *animator;
-
- struct {
- Effect_Data (*init) (Evas_Object *src, Evas_Object *dst, int screen_w, int screen_h, int rotation);
- void (*animate) (Effect_Data data, double percent);
- void (*pause) (Effect_Data data); /* Not used*/
- void (*resume) (Effect_Data data); /* Not used*/
- void (*finalize) (Effect_Data data);
-
- double (*get_duration)(Effect_Data data);
- } func;
-
-} Effect_Engine;
-
-typedef enum _Effect_Type {
- EFFECT_NONE,
- EFFECT_SLIDE,
- EFFECT_MAX
-} Effect_Type;
-
-
-Effect_Engine *ivug_effect_add(Effect_Type type);
-
-bool ivug_effect_init(Effect_Engine *engine, Evas_Object *src, Evas_Object *dst, int w, int h, int rotation);
-bool ivug_effect_start(Effect_Engine *engine, FuncFinished pFunc, void *data);
-bool ivug_effect_pause(Effect_Engine *engine);
-bool ivug_effect_resume(Effect_Engine *engine);
-bool ivug_effect_finalize(Effect_Engine *engine);
-
-
-/*
- Private function for adding effect. Do not use below functions directly..
-*/
-Effect_Engine *ivug_fade_add(void);
-Effect_Engine *ivug_iris_add(void);
-Effect_Engine *ivug_dissolve_add(void);
-Effect_Engine *ivug_blind_add(void);
-Effect_Engine *ivug_slide_add(void);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __IVUG_EFFECT_H__ */
diff --git a/main/src/effect/ivug-anim.c b/main/src/effect/ivug-anim.c
deleted file mode 100755
index b12d1fb..0000000
--- a/main/src/effect/ivug-anim.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include <stddef.h> /* for NULL */
-#include <memory.h>
-#include <stdlib.h>
-
-#include "ivug-common.h"
-
-#include "ivug-anim.h"
-
-/*
- t: current time b: start time c: change in value d: duration
-*/
-static double _anim_linear(double t, double b, double c, double d)
-{
- if(d != 0.0)
- t /= d;
- return b + c * (t);
-}
-
-static double _anim_sine(double t, double b, double c, double d)
-{
-/* TODO : Consider below table reconstruct. need only 0.0 ~ 1.0 range*/
- static const double const SIN_TABLE[91] = {
- 0.0000f, 0.0174f, 0.0349f, 0.0523f, 0.0698f,
- 0.0872f, 0.1045f, 0.1219f, 0.1392f, 0.1564f,
- 0.1736f, 0.1908f, 0.2079f, 0.2249f, 0.2419f,
- 0.2588f, 0.2756f, 0.2924f, 0.3090f, 0.3256f,
- 0.3420f, 0.3584f, 0.3746f, 0.3907f, 0.4067f,
- 0.4226f, 0.4384f, 0.4540f, 0.4695f, 0.4848f,
- 0.5000f, 0.5150f, 0.5299f, 0.5446f, 0.5592f,
- 0.5736f, 0.5878f, 0.6018f, 0.6157f, 0.6293f,
- 0.6528f, 0.6561f, 0.6691f, 0.6820f, 0.6947f,
- 0.7071f, 0.7193f, 0.7314f, 0.7431f, 0.7547f,
- 0.7660f, 0.7772f, 0.7880f, 0.7986f, 0.8090f,
- 0.8191f, 0.8290f, 0.8387f, 0.8480f, 0.8571f,
- 0.8660f, 0.8746f, 0.8829f, 0.8910f, 0.8988f,
- 0.9063f, 0.9135f, 0.9205f, 0.9272f, 0.9336f,
- 0.9397f, 0.9455f, 0.9511f, 0.9563f, 0.9613f,
- 0.9659f, 0.9703f, 0.9744f, 0.9781f, 0.9816f,
- 0.9848f, 0.9877f, 0.9903f, 0.9926f, 0.9945f,
- 0.9962f, 0.9976f, 0.9986f, 0.9994f, 0.9998f,
- 1.0f
- };
-
- if(d != 0.0)
- t /= d; /* normalize */
-
- int idx = (int)(90.0 * t);
-
- return b + c * (SIN_TABLE[idx]);
-
-}
-
-static double _anim_ease_inout_quartic(double t, double b,
- double c, double d)
-{
- if(d != 0.0)
- t /= d;
- double ts = t * t;
- double tc = ts * t;
- return b + c * (-2 * tc + 3 * ts);
-
-}
-
-static double _anim_ease_inout_quintic(double t, double b,
- double c, double d)
-{
- if(d != 0.0)
- t /= d;
- double ts = t * t;
- double tc = ts * t;
- return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc);
-}
-
-anim_handle_t *create_animation()
-{
- anim_handle_t *anim;
-
- anim = calloc(1, sizeof(anim_handle_t));
-
- if (anim == NULL) {
- MSG_IVUG_ERROR("Cannot allocate memory");
- return NULL;
- }
-
- return anim;
-
-}
-
-void delete_animation(anim_handle_t *anim)
-{
- IV_ASSERT(anim != NULL);
-
- free(anim);
-
-}
-
-bool set_animation_type(anim_handle_t *anim, anim_type_t type)
-{
- IV_ASSERT(anim != NULL);
-
- switch (type) {
- case ANIM_TYPE_LINEAR:
- anim->transit_func = _anim_linear;
- break;
- case ANIM_TYPE_QUARTIC_INOUT:
- anim->transit_func = _anim_ease_inout_quartic;
- break;
-
- case ANIM_TYPE_QUINTIC_INOUT:
- anim->transit_func = _anim_ease_inout_quintic;
- break;
-
- case ANIM_TYPE_SINE:
- anim->transit_func = _anim_sine;
- break;
- default:
- MSG_IVUG_ERROR("Invalid transition type=%d", type);
- return false;
- break;
- }
-
- return true;
-}
-
-bool set_animation(anim_handle_t *anim, int start, int end, double duration)
-{
- IV_ASSERT(anim != NULL);
-
- MSG_IVUG_MED("Set Anim. Start=%d End=%d Dur=%f", start, end, duration);
- anim->duration = duration;
- anim->t_start = start;
- anim->t_varing = end - start;
-
- return true;
-}
-
-bool update_animation(anim_handle_t *anim, double current, int *value)
-{
- IV_ASSERT(anim != NULL);
- IV_ASSERT(anim->transit_func != NULL);
-
- if (current >= anim->duration) {
- *value = anim->t_start + anim->t_varing;
- MSG_IVUG_MED("End Start:%f Varing:%f Duration=%f",
- anim->t_start, anim->t_varing, anim->duration);
-
- MSG_IVUG_MED("End Current=%f Value=%d", current, *value);
-
- return false; /* End of animation */
- }
-
- MSG_IVUG_MED("Start:%f Varing:%f Duration=%f Current=%f", anim->t_start,
- anim->t_varing, anim->duration, current);
-
- *value = (int)anim->transit_func(current, anim->t_start, anim->t_varing,
- anim->duration);
-
- MSG_IVUG_MED("Value = %d", *value);
-
- return true;
-}
diff --git a/main/src/effect/ivug-effect.c b/main/src/effect/ivug-effect.c
deleted file mode 100755
index ea17ee5..0000000
--- a/main/src/effect/ivug-effect.c
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include "ivug-common.h"
-#include "ivug-effect.h"
-
-#define SIN_TABLE_NUM 91
-
-/* Animation acceleration table */
-static const float const EFFECT_SIN_TABLE[SIN_TABLE_NUM] = {
- 0.0000f, 0.0174f, 0.0349f, 0.0523f, 0.0698f,
- 0.0872f, 0.1045f, 0.1219f, 0.1392f, 0.1564f,
- 0.1736f, 0.1908f, 0.2079f, 0.2249f, 0.2419f,
- 0.2588f, 0.2756f, 0.2924f, 0.3090f, 0.3256f,
- 0.3420f, 0.3584f, 0.3746f, 0.3907f, 0.4067f,
- 0.4226f, 0.4384f, 0.4540f, 0.4695f, 0.4848f,
- 0.5000f, 0.5150f, 0.5299f, 0.5446f, 0.5592f,
- 0.5736f, 0.5878f, 0.6018f, 0.6157f, 0.6293f,
- 0.6528f, 0.6561f, 0.6691f, 0.6820f, 0.6947f,
- 0.7071f, 0.7193f, 0.7314f, 0.7431f, 0.7547f,
- 0.7660f, 0.7772f, 0.7880f, 0.7986f, 0.8090f,
- 0.8191f, 0.8290f, 0.8387f, 0.8480f, 0.8571f,
- 0.8660f, 0.8746f, 0.8829f, 0.8910f, 0.8988f,
- 0.9063f, 0.9135f, 0.9205f, 0.9272f, 0.9336f,
- 0.9397f, 0.9455f, 0.9511f, 0.9563f, 0.9613f,
- 0.9659f, 0.9703f, 0.9744f, 0.9781f, 0.9816f,
- 0.9848f, 0.9877f, 0.9903f, 0.9926f, 0.9945f,
- 0.9962f, 0.9976f, 0.9986f, 0.9994f, 0.9998f,
- 1.0f
-};
-
-#define SLIDESHOW_ANI_TIME (1.0f)
-
-
-static Eina_Bool
-_on_effect_animator(void *data)
-{
- IV_ASSERT( data != NULL);
- Effect_Engine *engine = data;
-
- int value = 0;
-
- if ( update_animation(engine->anim, ecore_loop_time_get() - engine->t_base, &value) == false ) // If last frame
- {
- engine->animator = NULL;
-
- MSG_EFFECT_HIGH("Last effect frame. value=%d", value);
-
- engine->func.animate(engine->eng_data, value); // Draw last frame.
- // Inform to user.
- if ( engine->pFinishedCB )
- {
- engine->pFinishedCB(engine->ClientData);
- }
-
- return ECORE_CALLBACK_CANCEL;
- }
-
- engine->func.animate(engine->eng_data, value);
-
- return ECORE_CALLBACK_RENEW;
-}
-
-
-bool ivug_effect_init(Effect_Engine *engine, Evas_Object *src, Evas_Object *dst, int w, int h, int rotation)
-{
- IV_ASSERT(engine != NULL );
-
- void *data = engine->func.init(src, dst, w, h, rotation);
- if (data == NULL) {
- MSG_EFFECT_ERROR("init returned data is NULL");
-
- return false;
- }
-
- engine->eng_data = data;
-
- engine->anim = create_animation();
- return true;
-}
-
-bool ivug_effect_start(Effect_Engine *engine, FuncFinished pFunc, void *data)
-{
- ivug_retvm_if(engine == NULL, false, "engine is NULL");
-
- IV_ASSERT(engine->func.animate != NULL);
- IV_ASSERT(engine->eng_data != NULL);
-
-// Set up slide show animator
- engine->t_base = ecore_loop_time_get();
-
- double duration = SLIDESHOW_ANI_TIME;
-
- if (engine->func.get_duration )
- {
- duration = engine->func.get_duration(engine->eng_data);
- }
-
- set_animation_type(engine->anim, ANIM_TYPE_LINEAR);
- set_animation(engine->anim, 0, 100, duration); // 0~100% during 1 seconds
-
- engine->pFinishedCB = pFunc;
- engine->ClientData = data;
-
- if (engine->animator == NULL)
- {
- engine->animator = ecore_animator_add(_on_effect_animator, engine);
- }
-
- return true;
-}
-
-bool ivug_effect_pause(Effect_Engine *engine)
-{
-/* Unused. */
- return true;
-}
-
-bool ivug_effect_resume(Effect_Engine *engine)
-{
-/* Unused. */
- return true;
-}
-
-bool ivug_effect_finalize(Effect_Engine *engine)
-{
- ivug_retvm_if(engine == NULL, false, "engine is NULL");
-
- if ( engine->animator )
- {
- ecore_animator_del(engine->animator);
- engine->animator = NULL;
- }
-
- if (engine->eng_data)
- {
- if (engine->func.finalize)
- {
- MSG_EFFECT_HIGH("finalize");
- engine->func.finalize(engine->eng_data);
- }
- else
- {
- MSG_EFFECT_ERROR("engine->func.finalize is NULL");
- }
-
- engine->eng_data = NULL;
- }
- else
- {
- MSG_EFFECT_ERROR("engine->eng_data is NULL");
- }
-
- if ( engine->anim )
- {
- delete_animation(engine->anim);
- }
-
- free(engine);
- engine = NULL;
-
- return true;
-}
-
-Effect_Engine *ivug_effect_add(Effect_Type type)
-{
- Effect_Engine *eng = NULL;
-
- switch (type) {
- case EFFECT_SLIDE:
- eng = ivug_slide_add();
- break;
-
- default:
- MSG_EFFECT_ERROR("Unknown effect type=%d", type);
- return NULL;
- break;
- }
-
- if (eng == NULL)
- {
- MSG_EFFECT_ERROR("Cannot create effect enigne. type=%d", type);
- return NULL;
- }
-
- return eng;
-}
diff --git a/main/src/effect/ivug-slide.c b/main/src/effect/ivug-slide.c
deleted file mode 100755
index adb38f9..0000000
--- a/main/src/effect/ivug-slide.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ivug-common.h"
-#include "ivug-effect.h"
-
-
-typedef struct {
- Evas_Object *src;
- Evas_Object *dst;
-
- int screen_w;
- int screen_h;
-} Priv_Data;
-
-
-static Effect_Data __ivug_slide_init(Evas_Object *src, Evas_Object *dst, int screen_w, int screen_h, int rotation)
-{
- Priv_Data *pData = calloc(1, sizeof(Priv_Data));
- IV_ASSERT(pData != NULL);
-
- pData->src = src;
- pData->dst = dst;
-
- pData->screen_w = screen_w;
- pData->screen_h = screen_h;
-
- evas_object_stack_below(dst, src);
-
- evas_object_move(pData->src, 0, 0);
-
-// ivug_slider_item_move(sd->slide[NEXT_SLIDE], x + sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN , y);
-
- return (Effect_Data)pData;
-}
-
-static void __ivug_slide_anim(Effect_Data data, double percent)
-{
- Priv_Data *pData = (Priv_Data *)data;
-
- int first = 0;
- int last = -pData->screen_w -IMAGE_BETWEEN_MARGIN;
-
- int value = (double)first * (1.0f - percent / 100.0f) + (double)last * (percent / 100.0f);
-
- MSG_EFFECT_MED("Slide animation. Value=%d %f", value, percent);
-
- Evas_Coord ox, oy, ow, oh;
- evas_object_geometry_get(pData->src, &ox, &oy, &ow, &oh);
-
- evas_object_move(pData->src, value, oy);
- evas_object_move(pData->dst, value + ow + IMAGE_BETWEEN_MARGIN, oy);
-
-}
-
-static void __ivug_slide_pause(Effect_Data data)
-{
-
-}
-
-static void __ivug_slide_resume(Effect_Data data)
-{
-
-}
-
-static void __ivug_slide_finialize(Effect_Data data)
-{
- Priv_Data *pData = (Priv_Data *)data;
-
- free(pData);
-
-}
-
-static double __ivug_slide_get_duration(Effect_Data data)
-{
- return 0.2f;
-}
-
-
-
-Effect_Engine *ivug_slide_add(void)
-{
- Effect_Engine *eng_slide = calloc(1, sizeof(Effect_Engine));
- ivug_retvm_if(eng_slide == NULL, NULL, "calloc failed");
-
- eng_slide->func.init = __ivug_slide_init;
- eng_slide->func.animate = __ivug_slide_anim;
- eng_slide->func.pause = __ivug_slide_pause;
- eng_slide->func.resume = __ivug_slide_resume;
- eng_slide->func.finalize = __ivug_slide_finialize;
- eng_slide->func.get_duration = __ivug_slide_get_duration;
-
- return eng_slide;
-}
diff --git a/main/src/effect/template.c b/main/src/effect/template.c
deleted file mode 100755
index 22868eb..0000000
--- a/main/src/effect/template.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.tizenopensource.org/license
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#include "ivug-common.h"
-#include "ivug-effect.h"
-
-
-typedef struct {
- Evas_Object *src;
- Evas_Object *dst;
-
- Evas_Object *object;
- Evas_Object *orig_cliper;
-
- Evas_Object *cliper;
-
- int screen_w;
- int screen_h;
-} effect_data;
-
-
-static Effect_Data __ivug_init(Evas_Object *src, Evas_Object *dst, int screen_w, int screen_h, int rotation)
-{
- IVUG_FUNC_ENTER();
-
- IVUG_FUNC_LEAVE();
-}
-
-static void __ivug_anim(Effect_Data data, double percent)
-{
-/* IVUG_FUNC_ENTER(); */
-
-/* IVUG_FUNC_LEAVE(); */
-}
-
-static void __ivug_pause(Effect_Data data)
-{
- IVUG_FUNC_ENTER();
-
- IVUG_FUNC_LEAVE();
-}
-
-static void __ivug_resume(Effect_Data data)
-{
- IVUG_FUNC_ENTER();
-
- IVUG_FUNC_LEAVE();
-}
-
-static void __ivug_spin_finialize(Effect_Data data)
-{
- IVUG_FUNC_ENTER();
-
- IVUG_FUNC_LEAVE();
-}
-
-Effect_Engine *ivug_xxx_add(void)
-{
- Effect_Engine *eng_spin = calloc(1, sizeof(Effect_Engine));
- ivug_retvm_if(eng_spin == NULL, NULL, "calloc failed");
-
- eng_spin->func.init = &__ivug_init;
- eng_spin->func.animate = &__ivug_anim;
- eng_spin->func.pause = &__ivug_pause;
- eng_spin->func.resume = &__ivug_resume;
- eng_spin->func.finalize = &__ivug_finialize;
-
- return eng_spin;
-}