summaryrefslogtreecommitdiff
path: root/src/bin/image_mask_13.c
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 /src/bin/image_mask_13.c
parent39635aa465d3fbad4fdd075dcfd6e8ac4567a6b8 (diff)
more tests - use text as mask.. no go.
SVN revision: 58997
Diffstat (limited to 'src/bin/image_mask_13.c')
-rw-r--r--src/bin/image_mask_13.c119
1 files changed, 119 insertions, 0 deletions
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