Expedite initialize.
[framework/uifw/expedite.git] / src / bin / image_data_argb.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME image_data_argb_start
7 #define NAME "Image Data ARGB"
8 #define ICON "data.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 /* standard var */
15 static int done = 0;
16
17 /* private data */
18 static Evas_Object *o_images[1];
19
20 /* setup */
21 static void _setup(void)
22 {
23    int i;
24    Evas_Object *o;
25    for (i = 0; i < 1; i++)
26      {
27         o = evas_object_image_add(evas);
28         o_images[i] = o;
29         evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
30         evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
31         evas_object_image_size_set(o, 640, 480);
32         evas_object_image_alpha_set(o, 0);
33         evas_object_image_fill_set(o, 0, 0, 640, 480);
34         evas_object_resize(o, 640, 480);
35         evas_object_show(o);
36      }
37    done = 0;
38 }
39
40 /* cleanup */
41 static void _cleanup(void)
42 {
43    int i;
44    for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
45 }
46
47 /* loop - do things */
48 static void _loop(double t, int f)
49 {
50    int i;
51    Evas_Coord x, y, w, h;
52    for (i = 0; i < 1; i++)
53      {
54         unsigned int *data, *p;
55         int ff;
56         w = 640;
57         h = 480;
58         x = (win_w / 2) - (w / 2);
59         y = (win_h / 2) - (h / 2);
60         evas_object_move(o_images[i], x, y);
61         evas_object_resize(o_images[i], w, h);
62         evas_object_image_fill_set(o_images[i], 0, 0, w, h);
63         data = evas_object_image_data_get(o_images[i], 1);
64         p = data;
65         ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24));
66         for (y = 0; y < 480; y++)
67           {
68              for (x = 0; x < 640; x++)
69                {
70                   *p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000;
71                   p++;
72                }
73           }
74         evas_object_image_data_set(o_images[i], data);
75         evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480);
76      }
77    FPS_STD(NAME);
78 }
79
80 /* prepend special key handlers if interactive (before STD) */
81 static void _key(char *key)
82 {
83    KEY_STD;
84 }
85
86
87
88
89
90
91
92
93
94
95
96
97 /* template stuff - ignore */
98 # endif
99 #endif
100
101 #ifdef UI
102 _ui_menu_item_add(ICON, NAME, FNAME);
103 #endif
104
105 #ifdef PROTO
106 void FNAME(void);
107 #endif
108
109 #ifndef PROTO
110 # ifndef UI
111 void FNAME(void)
112 {
113    ui_func_set(_key, _loop);
114    _setup();
115 }
116 # endif
117 #endif
118 #undef FNAME
119 #undef NAME
120 #undef ICON