summaryrefslogtreecommitdiff
path: root/src/bin/filter_object_blur_solid.c
diff options
context:
space:
mode:
authorBrett Nash <nash@nash.id.au>2011-04-19 06:09:34 +0000
committerBrett Nash <nash@nash.id.au>2011-04-19 06:09:34 +0000
commit180423aefcaa07455021ea31bab5194f130aa884 (patch)
tree9909ffce4a22b856a403cac08731de87c6d9e37a /src/bin/filter_object_blur_solid.c
parent758cbafbda5c48d30c2b105b9d0c1b26e93d9a9a (diff)
Add filter tests.
SVN revision: 58728
Diffstat (limited to 'src/bin/filter_object_blur_solid.c')
-rw-r--r--src/bin/filter_object_blur_solid.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/bin/filter_object_blur_solid.c b/src/bin/filter_object_blur_solid.c
new file mode 100644
index 0000000..7e2e827
--- /dev/null
+++ b/src/bin/filter_object_blur_solid.c
@@ -0,0 +1,108 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_blur_solid
7#define NAME "Filter Object Blur Solid"
8#define ICON "blend.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16/* private data */
17static Evas_Object *o_images[OBNUM];
18
19/* setup */
20static void _setup(void)
21{
22 int i;
23 Evas_Object *o,*src;
24
25 for (i = 0; i < OBNUM; i++)
26 {
27 o = evas_object_image_add(evas);
28 evas_object_image_file_set(o, build_path("image.png"), NULL);
29 evas_object_image_fill_set(o, 0, 0, 120, 160);
30 evas_object_resize(o, 120, 160);
31 evas_object_filter_set(o, EVAS_FILTER_BLUR);
32 evas_object_filter_param_set_int(o, "radius", 5);
33 evas_object_layer_set(o,1);
34 evas_object_show(o);
35 src = o;
36 o_images[i] = src;
37 }
38
39 done = 0;
40}
41
42/* cleanup */
43static void _cleanup(void)
44{
45 int i;
46 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
47}
48
49/* loop - do things */
50static void _loop(double t, int f)
51{
52 int i;
53 Evas_Coord x, y, w, h;
54 for (i = 0; i < OBNUM; i++)
55 {
56 w = 120;
57 h = 160;
58 x = (win_w / 2) - (w / 2);
59 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
60 y = (win_h / 2) - (h / 2);
61 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
62 evas_object_move(o_images[i], x, y);
63 }
64 FPS_STD(NAME);
65}
66
67/* prepend special key handlers if interactive (before STD) */
68static void _key(char *key)
69{
70 KEY_STD;
71}
72
73
74
75
76
77
78
79
80
81
82
83
84/* template stuff - ignore */
85# endif
86#endif
87
88#ifdef UI
89_ui_menu_item_add(ICON, NAME, FNAME);
90#endif
91
92#ifdef PROTO
93void FNAME(void);
94#endif
95
96#ifndef PROTO
97# ifndef UI
98void FNAME(void)
99{
100 ui_func_set(_key, _loop);
101 _setup();
102}
103# endif
104#endif
105#undef FNAME
106#undef NAME
107#undef ICON
108