summaryrefslogtreecommitdiff
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
parent758cbafbda5c48d30c2b105b9d0c1b26e93d9a9a (diff)
Add filter tests.
SVN revision: 58728
-rw-r--r--src/bin/Makefile.am12
-rw-r--r--src/bin/filter_object_blur.c107
-rw-r--r--src/bin/filter_object_blur_solid.c108
-rw-r--r--src/bin/filter_object_colors.c111
-rw-r--r--src/bin/filter_object_colors_solid.c112
-rw-r--r--src/bin/filter_object_greyscale.c106
-rw-r--r--src/bin/filter_object_greyscale_solid.c107
-rw-r--r--src/bin/filter_object_invert.c106
-rw-r--r--src/bin/filter_object_invert_solid.c107
-rw-r--r--src/bin/filter_object_sepia.c106
-rw-r--r--src/bin/filter_object_sepia_solid.c107
-rw-r--r--src/bin/tests.h10
12 files changed, 1098 insertions, 1 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index d29a49e..adcfefb 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -113,7 +113,17 @@ poly_blend.c \
113proxy_image.c \ 113proxy_image.c \
114proxy_text_fixed.c \ 114proxy_text_fixed.c \
115proxy_text_random.c \ 115proxy_text_random.c \
116image_mask.c 116image_mask.c \
117filter_object_colors.c \
118filter_object_colors_solid.c \
119filter_object_sepia.c \
120filter_object_sepia_solid.c \
121filter_object_greyscale.c \
122filter_object_greyscale_solid.c \
123filter_object_invert.c \
124filter_object_invert_solid.c \
125filter_object_blur.c \
126filter_object_blur_solid.c
117 127
118expedite_CFLAGS = @WIN32_CFLAGS@ 128expedite_CFLAGS = @WIN32_CFLAGS@
119expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ 129expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@
diff --git a/src/bin/filter_object_blur.c b/src/bin/filter_object_blur.c
new file mode 100644
index 0000000..4f74c5a
--- /dev/null
+++ b/src/bin/filter_object_blur.c
@@ -0,0 +1,107 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_blur
7#define NAME "Filter Object Blur"
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("logo.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", 3);
33 evas_object_show(o);
34 src = o;
35 o_images[i] = src;
36 }
37
38 done = 0;
39}
40
41/* cleanup */
42static void _cleanup(void)
43{
44 int i;
45 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
46}
47
48/* loop - do things */
49static void _loop(double t, int f)
50{
51 int i;
52 Evas_Coord x, y, w, h;
53 for (i = 0; i < OBNUM; i++)
54 {
55 w = 120;
56 h = 160;
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
61 evas_object_move(o_images[i], x, y);
62 }
63 FPS_STD(NAME);
64}
65
66/* prepend special key handlers if interactive (before STD) */
67static void _key(char *key)
68{
69 KEY_STD;
70}
71
72
73
74
75
76
77
78
79
80
81
82
83/* template stuff - ignore */
84# endif
85#endif
86
87#ifdef UI
88_ui_menu_item_add(ICON, NAME, FNAME);
89#endif
90
91#ifdef PROTO
92void FNAME(void);
93#endif
94
95#ifndef PROTO
96# ifndef UI
97void FNAME(void)
98{
99 ui_func_set(_key, _loop);
100 _setup();
101}
102# endif
103#endif
104#undef FNAME
105#undef NAME
106#undef ICON
107
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
diff --git a/src/bin/filter_object_colors.c b/src/bin/filter_object_colors.c
new file mode 100644
index 0000000..2b66799
--- /dev/null
+++ b/src/bin/filter_object_colors.c
@@ -0,0 +1,111 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_colors
7#define NAME "Filter Object Colors"
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 Evas_Filter filters[3] = {
25 EVAS_FILTER_GREYSCALE,
26 EVAS_FILTER_INVERT,
27 EVAS_FILTER_SEPIA
28 };
29
30 for (i = 0; i < OBNUM; i++)
31 {
32 o = evas_object_image_add(evas);
33 evas_object_image_file_set(o, build_path("logo.png"), NULL);
34 evas_object_image_fill_set(o, 0, 0, 120, 160);
35 evas_object_resize(o, 120, 160);
36 evas_object_filter_set(o, filters[i % 3]);
37 evas_object_show(o);
38 src = o;
39 o_images[i] = src;
40 }
41
42 done = 0;
43}
44
45/* cleanup */
46static void _cleanup(void)
47{
48 int i;
49 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
50}
51
52/* loop - do things */
53static void _loop(double t, int f)
54{
55 int i;
56 Evas_Coord x, y, w, h;
57 for (i = 0; i < OBNUM; i++)
58 {
59 w = 120;
60 h = 160;
61 x = (win_w / 2) - (w / 2);
62 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
63 y = (win_h / 2) - (h / 2);
64 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
65 evas_object_move(o_images[i], x, y);
66 }
67 FPS_STD(NAME);
68}
69
70/* prepend special key handlers if interactive (before STD) */
71static void _key(char *key)
72{
73 KEY_STD;
74}
75
76
77
78
79
80
81
82
83
84
85
86
87/* template stuff - ignore */
88# endif
89#endif
90
91#ifdef UI
92_ui_menu_item_add(ICON, NAME, FNAME);
93#endif
94
95#ifdef PROTO
96void FNAME(void);
97#endif
98
99#ifndef PROTO
100# ifndef UI
101void FNAME(void)
102{
103 ui_func_set(_key, _loop);
104 _setup();
105}
106# endif
107#endif
108#undef FNAME
109#undef NAME
110#undef ICON
111
diff --git a/src/bin/filter_object_colors_solid.c b/src/bin/filter_object_colors_solid.c
new file mode 100644
index 0000000..534ab81
--- /dev/null
+++ b/src/bin/filter_object_colors_solid.c
@@ -0,0 +1,112 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_colors_solid
7#define NAME "Filter Object Colors 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 Evas_Filter filters[3] = {
25 EVAS_FILTER_GREYSCALE,
26 EVAS_FILTER_INVERT,
27 EVAS_FILTER_SEPIA
28 };
29
30 for (i = 0; i < OBNUM; i++)
31 {
32 o = evas_object_image_add(evas);
33 evas_object_image_file_set(o, build_path("image.png"), NULL);
34 evas_object_image_fill_set(o, 0, 0, 120, 160);
35 evas_object_resize(o, 120, 160);
36 evas_object_filter_set(o, filters[i % 3]);
37 evas_object_layer_set(o,1);
38 evas_object_show(o);
39 src = o;
40 o_images[i] = src;
41 }
42
43 done = 0;
44}
45
46/* cleanup */
47static void _cleanup(void)
48{
49 int i;
50 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
51}
52
53/* loop - do things */
54static void _loop(double t, int f)
55{
56 int i;
57 Evas_Coord x, y, w, h;
58 for (i = 0; i < OBNUM; i++)
59 {
60 w = 120;
61 h = 160;
62 x = (win_w / 2) - (w / 2);
63 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
64 y = (win_h / 2) - (h / 2);
65 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
66 evas_object_move(o_images[i], x, y);
67 }
68 FPS_STD(NAME);
69}
70
71/* prepend special key handlers if interactive (before STD) */
72static void _key(char *key)
73{
74 KEY_STD;
75}
76
77
78
79
80
81
82
83
84
85
86
87
88/* template stuff - ignore */
89# endif
90#endif
91
92#ifdef UI
93_ui_menu_item_add(ICON, NAME, FNAME);
94#endif
95
96#ifdef PROTO
97void FNAME(void);
98#endif
99
100#ifndef PROTO
101# ifndef UI
102void FNAME(void)
103{
104 ui_func_set(_key, _loop);
105 _setup();
106}
107# endif
108#endif
109#undef FNAME
110#undef NAME
111#undef ICON
112
diff --git a/src/bin/filter_object_greyscale.c b/src/bin/filter_object_greyscale.c
new file mode 100644
index 0000000..0d41ddd
--- /dev/null
+++ b/src/bin/filter_object_greyscale.c
@@ -0,0 +1,106 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_greyscale
7#define NAME "Filter Object Greyscale"
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("logo.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_GREYSCALE);
32 evas_object_show(o);
33 src = o;
34 o_images[i] = src;
35 }
36
37 done = 0;
38}
39
40/* cleanup */
41static void _cleanup(void)
42{
43 int i;
44 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
45}
46
47/* loop - do things */
48static void _loop(double t, int f)
49{
50 int i;
51 Evas_Coord x, y, w, h;
52 for (i = 0; i < OBNUM; i++)
53 {
54 w = 120;
55 h = 160;
56 x = (win_w / 2) - (w / 2);
57 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
58 y = (win_h / 2) - (h / 2);
59 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
60 evas_object_move(o_images[i], x, y);
61 }
62 FPS_STD(NAME);
63}
64
65/* prepend special key handlers if interactive (before STD) */
66static void _key(char *key)
67{
68 KEY_STD;
69}
70
71
72
73
74
75
76
77
78
79
80
81
82/* template stuff - ignore */
83# endif
84#endif
85
86#ifdef UI
87_ui_menu_item_add(ICON, NAME, FNAME);
88#endif
89
90#ifdef PROTO
91void FNAME(void);
92#endif
93
94#ifndef PROTO
95# ifndef UI
96void FNAME(void)
97{
98 ui_func_set(_key, _loop);
99 _setup();
100}
101# endif
102#endif
103#undef FNAME
104#undef NAME
105#undef ICON
106
diff --git a/src/bin/filter_object_greyscale_solid.c b/src/bin/filter_object_greyscale_solid.c
new file mode 100644
index 0000000..98373f5
--- /dev/null
+++ b/src/bin/filter_object_greyscale_solid.c
@@ -0,0 +1,107 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_greyscale_solid
7#define NAME "Filter Object Greyscale 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_GREYSCALE);
32 evas_object_layer_set(o,1);
33 evas_object_show(o);
34 src = o;
35 o_images[i] = src;
36 }
37
38 done = 0;
39}
40
41/* cleanup */
42static void _cleanup(void)
43{
44 int i;
45 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
46}
47
48/* loop - do things */
49static void _loop(double t, int f)
50{
51 int i;
52 Evas_Coord x, y, w, h;
53 for (i = 0; i < OBNUM; i++)
54 {
55 w = 120;
56 h = 160;
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
61 evas_object_move(o_images[i], x, y);
62 }
63 FPS_STD(NAME);
64}
65
66/* prepend special key handlers if interactive (before STD) */
67static void _key(char *key)
68{
69 KEY_STD;
70}
71
72
73
74
75
76
77
78
79
80
81
82
83/* template stuff - ignore */
84# endif
85#endif
86
87#ifdef UI
88_ui_menu_item_add(ICON, NAME, FNAME);
89#endif
90
91#ifdef PROTO
92void FNAME(void);
93#endif
94
95#ifndef PROTO
96# ifndef UI
97void FNAME(void)
98{
99 ui_func_set(_key, _loop);
100 _setup();
101}
102# endif
103#endif
104#undef FNAME
105#undef NAME
106#undef ICON
107
diff --git a/src/bin/filter_object_invert.c b/src/bin/filter_object_invert.c
new file mode 100644
index 0000000..506dd59
--- /dev/null
+++ b/src/bin/filter_object_invert.c
@@ -0,0 +1,106 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_invert
7#define NAME "Filter Object Invert"
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("logo.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_INVERT);
32 evas_object_show(o);
33 src = o;
34 o_images[i] = src;
35 }
36
37 done = 0;
38}
39
40/* cleanup */
41static void _cleanup(void)
42{
43 int i;
44 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
45}
46
47/* loop - do things */
48static void _loop(double t, int f)
49{
50 int i;
51 Evas_Coord x, y, w, h;
52 for (i = 0; i < OBNUM; i++)
53 {
54 w = 120;
55 h = 160;
56 x = (win_w / 2) - (w / 2);
57 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
58 y = (win_h / 2) - (h / 2);
59 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
60 evas_object_move(o_images[i], x, y);
61 }
62 FPS_STD(NAME);
63}
64
65/* prepend special key handlers if interactive (before STD) */
66static void _key(char *key)
67{
68 KEY_STD;
69}
70
71
72
73
74
75
76
77
78
79
80
81
82/* template stuff - ignore */
83# endif
84#endif
85
86#ifdef UI
87_ui_menu_item_add(ICON, NAME, FNAME);
88#endif
89
90#ifdef PROTO
91void FNAME(void);
92#endif
93
94#ifndef PROTO
95# ifndef UI
96void FNAME(void)
97{
98 ui_func_set(_key, _loop);
99 _setup();
100}
101# endif
102#endif
103#undef FNAME
104#undef NAME
105#undef ICON
106
diff --git a/src/bin/filter_object_invert_solid.c b/src/bin/filter_object_invert_solid.c
new file mode 100644
index 0000000..03e4eaa
--- /dev/null
+++ b/src/bin/filter_object_invert_solid.c
@@ -0,0 +1,107 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_invert_solid
7#define NAME "Filter Object Invert 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_INVERT);
32 evas_object_layer_set(o,1);
33 evas_object_show(o);
34 src = o;
35 o_images[i] = src;
36 }
37
38 done = 0;
39}
40
41/* cleanup */
42static void _cleanup(void)
43{
44 int i;
45 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
46}
47
48/* loop - do things */
49static void _loop(double t, int f)
50{
51 int i;
52 Evas_Coord x, y, w, h;
53 for (i = 0; i < OBNUM; i++)
54 {
55 w = 120;
56 h = 160;
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
61 evas_object_move(o_images[i], x, y);
62 }
63 FPS_STD(NAME);
64}
65
66/* prepend special key handlers if interactive (before STD) */
67static void _key(char *key)
68{
69 KEY_STD;
70}
71
72
73
74
75
76
77
78
79
80
81
82
83/* template stuff - ignore */
84# endif
85#endif
86
87#ifdef UI
88_ui_menu_item_add(ICON, NAME, FNAME);
89#endif
90
91#ifdef PROTO
92void FNAME(void);
93#endif
94
95#ifndef PROTO
96# ifndef UI
97void FNAME(void)
98{
99 ui_func_set(_key, _loop);
100 _setup();
101}
102# endif
103#endif
104#undef FNAME
105#undef NAME
106#undef ICON
107
diff --git a/src/bin/filter_object_sepia.c b/src/bin/filter_object_sepia.c
new file mode 100644
index 0000000..e9db58a
--- /dev/null
+++ b/src/bin/filter_object_sepia.c
@@ -0,0 +1,106 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_sepia
7#define NAME "Filter Object Sepia"
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("logo.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_SEPIA);
32 evas_object_show(o);
33 src = o;
34 o_images[i] = src;
35 }
36
37 done = 0;
38}
39
40/* cleanup */
41static void _cleanup(void)
42{
43 int i;
44 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
45}
46
47/* loop - do things */
48static void _loop(double t, int f)
49{
50 int i;
51 Evas_Coord x, y, w, h;
52 for (i = 0; i < OBNUM; i++)
53 {
54 w = 120;
55 h = 160;
56 x = (win_w / 2) - (w / 2);
57 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
58 y = (win_h / 2) - (h / 2);
59 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
60 evas_object_move(o_images[i], x, y);
61 }
62 FPS_STD(NAME);
63}
64
65/* prepend special key handlers if interactive (before STD) */
66static void _key(char *key)
67{
68 KEY_STD;
69}
70
71
72
73
74
75
76
77
78
79
80
81
82/* template stuff - ignore */
83# endif
84#endif
85
86#ifdef UI
87_ui_menu_item_add(ICON, NAME, FNAME);
88#endif
89
90#ifdef PROTO
91void FNAME(void);
92#endif
93
94#ifndef PROTO
95# ifndef UI
96void FNAME(void)
97{
98 ui_func_set(_key, _loop);
99 _setup();
100}
101# endif
102#endif
103#undef FNAME
104#undef NAME
105#undef ICON
106
diff --git a/src/bin/filter_object_sepia_solid.c b/src/bin/filter_object_sepia_solid.c
new file mode 100644
index 0000000..3f092cf
--- /dev/null
+++ b/src/bin/filter_object_sepia_solid.c
@@ -0,0 +1,107 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME filter_object_sepia_solid
7#define NAME "Filter Object Sepia 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_SEPIA);
32 evas_object_layer_set(o,1);
33 evas_object_show(o);
34 src = o;
35 o_images[i] = src;
36 }
37
38 done = 0;
39}
40
41/* cleanup */
42static void _cleanup(void)
43{
44 int i;
45 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
46}
47
48/* loop - do things */
49static void _loop(double t, int f)
50{
51 int i;
52 Evas_Coord x, y, w, h;
53 for (i = 0; i < OBNUM; i++)
54 {
55 w = 120;
56 h = 160;
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
61 evas_object_move(o_images[i], x, y);
62 }
63 FPS_STD(NAME);
64}
65
66/* prepend special key handlers if interactive (before STD) */
67static void _key(char *key)
68{
69 KEY_STD;
70}
71
72
73
74
75
76
77
78
79
80
81
82
83/* template stuff - ignore */
84# endif
85#endif
86
87#ifdef UI
88_ui_menu_item_add(ICON, NAME, FNAME);
89#endif
90
91#ifdef PROTO
92void FNAME(void);
93#endif
94
95#ifndef PROTO
96# ifndef UI
97void FNAME(void)
98{
99 ui_func_set(_key, _loop);
100 _setup();
101}
102# endif
103#endif
104#undef FNAME
105#undef NAME
106#undef ICON
107
diff --git a/src/bin/tests.h b/src/bin/tests.h
index e5ec127..970da94 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -90,3 +90,13 @@
90#include "proxy_text_fixed.c" 90#include "proxy_text_fixed.c"
91#include "proxy_text_random.c" 91#include "proxy_text_random.c"
92#include "image_mask.c" 92#include "image_mask.c"
93#include "filter_object_colors.c"
94#include "filter_object_colors_solid.c"
95#include "filter_object_invert.c"
96#include "filter_object_invert_solid.c"
97#include "filter_object_greyscale.c"
98#include "filter_object_greyscale_solid.c"
99#include "filter_object_sepia.c"
100#include "filter_object_sepia_solid.c"
101#include "filter_object_blur.c"
102#include "filter_object_blur_solid.c"