summaryrefslogtreecommitdiff
path: root/src/bin/image_mask_10.c
blob: 03862d8a82e199def494a3bf1f98ef871e7698df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#undef FNAME
#undef NAME
#undef ICON

/* metadata */
#define FNAME image_mask_10
#define NAME "Image Mask 10"
#define ICON "blend.png"

#ifndef PROTO
# ifndef UI
#  include "main.h"

/* standard var */
static int done = 0;
/* private data */
static Evas_Object *o_images[1];
static Evas_Object *o_mask;

/* setup */
static void _setup(void)
{
   int i;
   Evas_Object *o;

   o = eo_add(EVAS_IMAGE_CLASS, evas);
   o_mask = o;
   efl_file_set(o, build_path("e-logo-mask.png"), NULL);
   efl_gfx_fill_set(o, 0, 0, 720, 420);
   efl_gfx_size_set(o, 720, 420);
   efl_gfx_position_set(o, (win_w - 720) / 2, (win_h - 420) / 2);
   efl_gfx_visible_set(o, EINA_TRUE);

   for (i = 0; i < 1; i++)
     {
        o = eo_add(EVAS_IMAGE_CLASS, evas);
        o_images[i] = o;
        efl_file_set(o, build_path("texture.png"), NULL);
        efl_gfx_fill_set(o, 0, 0, win_w * 4, win_h * 4);
        efl_gfx_size_set(o, win_w * 4, win_h * 4);
        evas_obj_clip_set(o, o_mask);
        efl_gfx_visible_set(o, EINA_TRUE);
     }
   done = 0;
}

/* cleanup */
static void _cleanup(void)
{
   int i;
   for (i = 0; i < 1; i++) eo_del(o_images[i]);
   eo_del(o_mask);
}

/* loop - do things */
static void _loop(double t, int f)
{
   int i;
   static Evas_Map *m = NULL;
   Evas_Coord x, y, w, h;
   if (!m) m = evas_map_new(4);
   for (i = 0; i < 1; i++)
     {
        w = win_w * 4;
        h = win_h * 4;
        x = (win_w / 2) - (w / 2);
        y = (win_h / 2) - (h / 2);
        evas_map_util_points_populate_from_geometry(m, 
                                                    -win_w, -win_h,
                                                    win_w * 4, win_h * 4, 0);
        evas_map_util_rotate(m, f, win_w / 2, win_h / 2);

        evas_obj_map_enable_set(o_images[i], 1);
        evas_obj_map_set(o_images[i], m);
     }
   FPS_STD(NAME);
}

/* prepend special key handlers if interactive (before STD) */
static void _key(char *key)
{
   KEY_STD;
}












/* template stuff - ignore */
# endif
#endif

#ifdef UI
_ui_menu_item_add(ICON, NAME, FNAME);
#endif

#ifdef PROTO
void FNAME(void);
#endif

#ifndef PROTO
# ifndef UI
void FNAME(void)
{
   ui_func_set(_key, _loop);
   _setup();
}
# endif
#endif
#undef FNAME
#undef NAME
#undef ICON