summaryrefslogtreecommitdiff
path: root/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2010-09-05 02:58:51 +0000
committerCarsten Haitzler <raster@rasterman.com>2010-09-05 02:58:51 +0000
commit11a0377961200bc586d22c2c71453bc3b08eae42 (patch)
tree31af3815125c1aa330f4866e03b8918f89531281 /src/bin/image_data_ycbcr601pl_map_solid_rotate.c
parent9572d6f406315dda6d34dac73f62bbf83f0a225c (diff)
add tests for yuv rotated map thing. :)
SVN revision: 51894
Diffstat (limited to 'src/bin/image_data_ycbcr601pl_map_solid_rotate.c')
-rw-r--r--src/bin/image_data_ycbcr601pl_map_solid_rotate.c147
1 files changed, 147 insertions, 0 deletions
diff --git a/src/bin/image_data_ycbcr601pl_map_solid_rotate.c b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
new file mode 100644
index 0000000..6054946
--- /dev/null
+++ b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c
@@ -0,0 +1,147 @@
1#undef FNAME
2#undef NAME
3#undef ICON
4
5/* metadata */
6#define FNAME image_data_ycbcr601pl_map_solid_rotate_start
7#define NAME "Image Data YCbCr 601 Pointer List Map Solid Rotate"
8#define ICON "data.png"
9
10#ifndef PROTO
11# ifndef UI
12# include "main.h"
13
14/* standard var */
15static int done = 0;
16
17/* private data */
18static Evas_Object *o_images[1];
19static unsigned char *yp = NULL, *up = NULL, *vp = NULL;
20
21/* setup */
22static void _setup(void)
23{
24 int i, y;
25 FILE *f;
26 unsigned char **data, **lp;
27 Evas_Object *o;
28 for (i = 0; i < 1; i++)
29 {
30 o = evas_object_image_add(evas);
31 o_images[i] = o;
32 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
33 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL);
34 evas_object_image_size_set(o, 640, 480);
35 evas_object_image_alpha_set(o, 0);
36 evas_object_image_fill_set(o, 0, 0, 640, 480);
37 evas_object_resize(o, 640, 480);
38 evas_object_show(o);
39 yp = malloc(640 * 480);
40 up = malloc(320 * 240);
41 vp = malloc(320 * 240);
42 f = fopen(build_path("tp.yuv"), "rb");
43 if (f)
44 {
45 fread(yp, 640 * 480, 1, f);
46 fread(up, 320 * 240, 1, f);
47 fread(vp, 320 * 240, 1, f);
48 fclose(f);
49 }
50 data = evas_object_image_data_get(o_images[i], 1);
51 lp = data;
52 for (y = 0; y < 480; y++)
53 {
54 *lp = yp + (y * 640);
55 lp++;
56 }
57 for (y = 0; y < 240; y++)
58 {
59 *lp = up + (y * 320);
60 lp++;
61 }
62 for (y = 0; y < 240; y++)
63 {
64 *lp = vp + (y * 320);
65 lp++;
66 }
67 evas_object_image_data_set(o_images[i], data);
68 }
69 done = 0;
70}
71
72/* cleanup */
73static void _cleanup(void)
74{
75 int i;
76 for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
77 free(yp);
78 free(up);
79 free(vp);
80}
81
82/* loop - do things */
83static void _loop(double t, int f)
84{
85 int i;
86 Evas_Map *m;
87 Evas_Coord x, y, w, h;
88 m = evas_map_new(4);
89 for (i = 0; i < 1; i++)
90 {
91 w = 640;
92 h = 480;
93 x = (win_w / 2) - (w / 2);
94 y = (win_h / 2) - (h / 2);
95
96 evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0);
97
98 evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2));
99
100 evas_object_map_enable_set(o_images[i], 1);
101 evas_object_map_set(o_images[i], m);
102 }
103 evas_map_free(m);
104 FPS_STD(NAME);
105}
106
107/* prepend special key handlers if interactive (before STD) */
108static void _key(char *key)
109{
110 KEY_STD;
111}
112
113
114
115
116
117
118
119
120
121
122
123
124/* template stuff - ignore */
125# endif
126#endif
127
128#ifdef UI
129_ui_menu_item_add(ICON, NAME, FNAME);
130#endif
131
132#ifdef PROTO
133void FNAME(void);
134#endif
135
136#ifndef PROTO
137# ifndef UI
138void FNAME(void)
139{
140 ui_func_set(_key, _loop);
141 _setup();
142}
143# endif
144#endif
145#undef FNAME
146#undef NAME
147#undef ICON