summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2011-04-28 10:07:25 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-04-28 10:07:25 +0000
commit2f2dd23ee46ec3e25b2340828469d608f0d85735 (patch)
treed69e798612ff9e5de9cf9cf9752eda652a413e83
parent39635aa465d3fbad4fdd075dcfd6e8ac4567a6b8 (diff)
more tests - use text as mask.. no go.
SVN revision: 58997
-rw-r--r--src/bin/Makefile.am2
-rw-r--r--src/bin/image_mask_12.c119
-rw-r--r--src/bin/image_mask_13.c119
-rw-r--r--src/bin/tests.h2
-rw-r--r--src/bin/ui.c10
5 files changed, 248 insertions, 4 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index e7db3cf..74a897a 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -124,6 +124,8 @@ image_mask_8.c \
124image_mask_9.c \ 124image_mask_9.c \
125image_mask_10.c \ 125image_mask_10.c \
126image_mask_11.c \ 126image_mask_11.c \
127image_mask_12.c \
128image_mask_13.c \
127filter_object_colors.c \ 129filter_object_colors.c \
128filter_object_colors_solid.c \ 130filter_object_colors_solid.c \
129filter_object_sepia.c \ 131filter_object_sepia.c \
diff --git a/src/bin/image_mask_12.c b/src/bin/image_mask_12.c
new file mode 100644
index 0000000..fb94e58
--- /dev/null
+++ b/src/bin/image_mask_12.c
@@ -0,0 +1,119 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_mask_12
7#define NAME "Image Mask 12"
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_text_add(evas);
27 o_mask = o;
28 evas_object_text_font_set(o, "Vera-Bold", 150);
29 evas_object_show(o);
30
31 for (i = 0; i < OBNUM; i++)
32 {
33 o = evas_object_image_add(evas);
34 o_images[i] = o;
35 evas_object_image_file_set(o, build_path("texture.png"), NULL);
36 evas_object_image_fill_set(o, 0, 0, 500, 444);
37 evas_object_resize(o, win_w * 4, win_h * 4);
38// evas_object_clip_set(o, o_mask);
39 evas_object_show(o);
40 }
41 done = 0;
42}
43
44/* cleanup */
45static void _cleanup(void)
46{
47 int i;
48 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
49 evas_object_del(o_mask);
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 const char *strs[] = {
58 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
59 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
60 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
61 };
62 for (i = 0; i < OBNUM; i++)
63 {
64 w = win_w * 4;
65 h = win_h * 4;
66 x = (win_w / 2) - (w / 2);
67 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (500 / 2);
68 y = (win_h / 2) - (h / 2);
69 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (444 / 2);
70 evas_object_move(o_images[i], x, y);
71 }
72 evas_object_text_text_set(o_mask, strs[rnd() % (sizeof(strs) / sizeof(char *))]);
73 evas_object_color_set(o_mask, 255, 255, 255, 255);
74 evas_object_geometry_get(o_mask, NULL, NULL, &w, &h);
75 evas_object_move(o_mask, (win_w - w) / 2, (win_h - h) / 2);
76 FPS_STD(NAME);
77}
78
79/* prepend special key handlers if interactive (before STD) */
80static void _key(char *key)
81{
82 KEY_STD;
83}
84
85
86
87
88
89
90
91
92
93
94
95
96/* template stuff - ignore */
97# endif
98#endif
99
100#ifdef UI
101_ui_menu_item_add(ICON, NAME, FNAME);
102#endif
103
104#ifdef PROTO
105void FNAME(void);
106#endif
107
108#ifndef PROTO
109# ifndef UI
110void FNAME(void)
111{
112 ui_func_set(_key, _loop);
113 _setup();
114}
115# endif
116#endif
117#undef FNAME
118#undef NAME
119#undef ICON
diff --git a/src/bin/image_mask_13.c b/src/bin/image_mask_13.c
new file mode 100644
index 0000000..559b657
--- /dev/null
+++ b/src/bin/image_mask_13.c
@@ -0,0 +1,119 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_mask_13
7#define NAME "Image Mask 13"
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_text_add(evas);
27 o_mask = o;
28 evas_object_text_font_set(o, "Vera-Bold", 150);
29 evas_object_show(o);
30
31 for (i = 0; i < OBNUM; i++)
32 {
33 o = evas_object_image_add(evas);
34 o_images[i] = o;
35 evas_object_image_file_set(o, build_path("logo.png"), NULL);
36 evas_object_image_fill_set(o, 0, 0, 120, 160);
37 evas_object_resize(o, 120, 160);
38 evas_object_show(o);
39 evas_object_clip_set(o, o_mask);
40 }
41 done = 0;
42}
43
44/* cleanup */
45static void _cleanup(void)
46{
47 int i;
48 for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
49 evas_object_del(o_mask);
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 const char *strs[] = {
58 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
59 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
60 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
61 };
62 for (i = 0; i < OBNUM; i++)
63 {
64 w = 120;
65 h = 160;
66 x = (win_w / 2) - (w / 2);
67 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
68 y = (win_h / 2) - (h / 2);
69 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
70 evas_object_move(o_images[i], x, y);
71 }
72 evas_object_text_text_set(o_mask, strs[rnd() % (sizeof(strs) / sizeof(char *))]);
73 evas_object_color_set(o_mask, 255, 255, 255, 255);
74 evas_object_geometry_get(o_mask, NULL, NULL, &w, &h);
75 evas_object_move(o_mask, (win_w - w) / 2, (win_h - h) / 2);
76 FPS_STD(NAME);
77}
78
79/* prepend special key handlers if interactive (before STD) */
80static void _key(char *key)
81{
82 KEY_STD;
83}
84
85
86
87
88
89
90
91
92
93
94
95
96/* template stuff - ignore */
97# endif
98#endif
99
100#ifdef UI
101_ui_menu_item_add(ICON, NAME, FNAME);
102#endif
103
104#ifdef PROTO
105void FNAME(void);
106#endif
107
108#ifndef PROTO
109# ifndef UI
110void FNAME(void)
111{
112 ui_func_set(_key, _loop);
113 _setup();
114}
115# endif
116#endif
117#undef FNAME
118#undef NAME
119#undef ICON
diff --git a/src/bin/tests.h b/src/bin/tests.h
index e6c19b9..10e116e 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -100,6 +100,8 @@
100#include "image_mask_9.c" 100#include "image_mask_9.c"
101#include "image_mask_10.c" 101#include "image_mask_10.c"
102#include "image_mask_11.c" 102#include "image_mask_11.c"
103#include "image_mask_12.c"
104#include "image_mask_13.c"
103#include "filter_object_colors.c" 105#include "filter_object_colors.c"
104#include "filter_object_colors_solid.c" 106#include "filter_object_colors_solid.c"
105#include "filter_object_invert.c" 107#include "filter_object_invert.c"
diff --git a/src/bin/ui.c b/src/bin/ui.c
index 6ab61d1..0c4b2f9 100644
--- a/src/bin/ui.c
+++ b/src/bin/ui.c
@@ -174,17 +174,19 @@ static double weights[] =
174 174
175 20.000, // test 101 MASK 10 175 20.000, // test 101 MASK 10
176 20.000, // MASK 11 176 20.000, // MASK 11
177 1.000, 177 20.000, // MASK 12
178 2.000, 178 20.000, // MASK 13
179 1.000, 179 1.000,
180 180
181 2.000, // test 106 181 2.000, // test 106
182 1.000, 182 1.000,
183 2.000, 183 2.000,
184 1.000, 184 1.000,
185 2.000, 185 2.000,
186 186
187 10.000, // test 111 187 1.000, // test 111
188 2.000,
189 10.000,
188 10.000, 190 10.000,
189 191
190 0.0, // Exit 192 0.0, // Exit