summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-04-28 10:46:41 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-28 10:46:41 +0000
commit6ddaefaaf6b4d1658d9b945389439dd5e3063ae3 (patch)
tree26ccce080e5ca38773f7934e9e8247b3d71c2f08
parent2f2dd23ee46ec3e25b2340828469d608f0d85735 (diff)
more tests that fail. woot.
SVN revision: 58999
-rw-r--r--src/bin/Makefile.am2
-rw-r--r--src/bin/image_mask_14.c118
-rw-r--r--src/bin/image_mask_15.c118
-rw-r--r--src/bin/tests.h2
-rw-r--r--src/bin/ui.c15
5 files changed, 249 insertions, 6 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 74a897a..d849743 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -126,6 +126,8 @@ image_mask_10.c \
126image_mask_11.c \ 126image_mask_11.c \
127image_mask_12.c \ 127image_mask_12.c \
128image_mask_13.c \ 128image_mask_13.c \
129image_mask_14.c \
130image_mask_15.c \
129filter_object_colors.c \ 131filter_object_colors.c \
130filter_object_colors_solid.c \ 132filter_object_colors_solid.c \
131filter_object_sepia.c \ 133filter_object_sepia.c \
diff --git a/src/bin/image_mask_14.c b/src/bin/image_mask_14.c
new file mode 100644
index 0000000..a2a5d83
--- /dev/null
+++ b/src/bin/image_mask_14.c
@@ -0,0 +1,118 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_mask_14
7#define NAME "Image Mask 14"
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];
18static Evas_Object *o_mask;
19
20/* setup */
21static void _setup(void)
22{
23 int i;
24 Evas_Object *o;
25
26 o = evas_object_image_add(evas);
27 o_mask = o;
28 evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL);
29 evas_object_image_fill_set(o, 0, 0, 720, 420);
30 evas_object_resize(o, 720, 420);
31 evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2);
32 evas_object_show(o);
33
34 for (i = 0; i < OBNUM; i++)
35 {
36 o = evas_object_image_add(evas);
37 o_images[i] = o;
38 evas_object_image_file_set(o, build_path("logo.png"), NULL);
39 evas_object_image_fill_set(o, 0, 0, 120, 160);
40 evas_object_resize(o, 120, 160);
41 evas_object_image_smooth_scale_set(o, 1);
42 evas_object_clip_set(o, o_mask);
43 evas_object_show(o);
44 }
45 done = 0;
46}
47
48/* cleanup */
49static void _cleanup(void)
50{
51 int i;
52 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
53 evas_object_del(o_mask);
54}
55
56/* loop - do things */
57static void _loop(double t, int f)
58{
59 int i;
60 Evas_Coord x, y, w, h, w0, h0;
61 for (i = 0; i < OBNUM; i++)
62 {
63 w0 = 80;
64 h0 = 80;
65 w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
66 h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
67 x = (win_w / 2) - (w / 2);
68 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
69 y = (win_h / 2) - (h / 2);
70 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
71 evas_object_move(o_images[i], x, y);
72 evas_object_resize(o_images[i], w, h);
73 evas_object_image_fill_set(o_images[i], 0, 0, w, h);
74 }
75 FPS_STD(NAME);
76}
77
78/* prepend special key handlers if interactive (before STD) */
79static void _key(char *key)
80{
81 KEY_STD;
82}
83
84
85
86
87
88
89
90
91
92
93
94
95/* template stuff - ignore */
96# endif
97#endif
98
99#ifdef UI
100_ui_menu_item_add(ICON, NAME, FNAME);
101#endif
102
103#ifdef PROTO
104void FNAME(void);
105#endif
106
107#ifndef PROTO
108# ifndef UI
109void FNAME(void)
110{
111 ui_func_set(_key, _loop);
112 _setup();
113}
114# endif
115#endif
116#undef FNAME
117#undef NAME
118#undef ICON
diff --git a/src/bin/image_mask_15.c b/src/bin/image_mask_15.c
new file mode 100644
index 0000000..f6a1abe
--- /dev/null
+++ b/src/bin/image_mask_15.c
@@ -0,0 +1,118 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_mask_15
7#define NAME "Image Mask 15"
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];
18static Evas_Object *o_mask;
19
20/* setup */
21static void _setup(void)
22{
23 int i;
24 Evas_Object *o;
25
26 o = evas_object_image_add(evas);
27 o_mask = o;
28 evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL);
29 evas_object_image_fill_set(o, 0, 0, 720, 420);
30 evas_object_resize(o, 720, 420);
31 evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2);
32 evas_object_show(o);
33
34 for (i = 0; i < OBNUM; i++)
35 {
36 o = evas_object_image_add(evas);
37 o_images[i] = o;
38 evas_object_image_file_set(o, build_path("logo.png"), NULL);
39 evas_object_image_fill_set(o, 0, 0, 120, 160);
40 evas_object_resize(o, 120, 160);
41 evas_object_image_smooth_scale_set(o, 0);
42 evas_object_clip_set(o, o_mask);
43 evas_object_show(o);
44 }
45 done = 0;
46}
47
48/* cleanup */
49static void _cleanup(void)
50{
51 int i;
52 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
53 evas_object_del(o_mask);
54}
55
56/* loop - do things */
57static void _loop(double t, int f)
58{
59 int i;
60 Evas_Coord x, y, w, h, w0, h0;
61 for (i = 0; i < OBNUM; i++)
62 {
63 w0 = 80;
64 h0 = 80;
65 w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2);
66 h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2);
67 x = (win_w / 2) - (w / 2);
68 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2);
69 y = (win_h / 2) - (h / 2);
70 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2);
71 evas_object_move(o_images[i], x, y);
72 evas_object_resize(o_images[i], w, h);
73 evas_object_image_fill_set(o_images[i], 0, 0, w, h);
74 }
75 FPS_STD(NAME);
76}
77
78/* prepend special key handlers if interactive (before STD) */
79static void _key(char *key)
80{
81 KEY_STD;
82}
83
84
85
86
87
88
89
90
91
92
93
94
95/* template stuff - ignore */
96# endif
97#endif
98
99#ifdef UI
100_ui_menu_item_add(ICON, NAME, FNAME);
101#endif
102
103#ifdef PROTO
104void FNAME(void);
105#endif
106
107#ifndef PROTO
108# ifndef UI
109void FNAME(void)
110{
111 ui_func_set(_key, _loop);
112 _setup();
113}
114# endif
115#endif
116#undef FNAME
117#undef NAME
118#undef ICON
diff --git a/src/bin/tests.h b/src/bin/tests.h
index 10e116e..c500640 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -102,6 +102,8 @@
102#include "image_mask_11.c" 102#include "image_mask_11.c"
103#include "image_mask_12.c" 103#include "image_mask_12.c"
104#include "image_mask_13.c" 104#include "image_mask_13.c"
105#include "image_mask_14.c"
106#include "image_mask_15.c"
105#include "filter_object_colors.c" 107#include "filter_object_colors.c"
106#include "filter_object_colors_solid.c" 108#include "filter_object_colors_solid.c"
107#include "filter_object_invert.c" 109#include "filter_object_invert.c"
diff --git a/src/bin/ui.c b/src/bin/ui.c
index 0c4b2f9..91904ca 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -172,22 +172,25 @@ static double weights[] =
172 20.000, // MASK 8 172 20.000, // MASK 8
173 20.000, // MASK 9 173 20.000, // MASK 9
174 174
175 20.000, // test 101 MASK 10 175 20.000, // test 101
176 20.000, // MASK 11 176 20.000, // MASK 11
177 20.000, // MASK 12 177 20.000, // MASK 12
178 20.000, // MASK 13 178 20.000, // MASK 13
179 1.000, 179 20.000, // MASK 14
180 180
181 2.000, // test 106 181 20.000, // test 106 MASK 15
182 1.000,
183 2.000,
184 1.000, 182 1.000,
185 2.000, 183 2.000,
184 1.000,
185 2.000,
186 186
187 1.000, // test 111 187 1.000, // test 111
188 2.000, 188 2.000,
189 1.000,
190 2.000,
189 10.000, 191 10.000,
190 10.000, 192
193 10.000, // test 116
191 194
192 0.0, // Exit 195 0.0, // Exit
193 196