move around - flatter.
[profile/ivi/evas.git] / src / lib / engines / common / evas_convert_rgb_32.c
1 /*
2  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
3  */
4
5 #include "evas_common.h"
6 #include "evas_convert_rgb_32.h"
7
8 #ifdef BUILD_CONVERT_32_RGB_8888
9 #ifdef BUILD_CONVERT_32_RGB_ROT0
10 void
11 evas_common_convert_rgba_to_32bpp_rgb_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
12 {
13    DATA32 *src_ptr;
14    DATA32 *dst_ptr;
15    int y;
16    Gfx_Func_Copy func;
17
18    dst_ptr = (DATA32 *)dst;
19    src_ptr = src;
20
21    func = evas_common_draw_func_copy_get(w, 0);
22
23    for (y = 0; y < h; y++)
24      {
25         func(src_ptr, dst_ptr, w);
26         src_ptr += w + src_jump;
27         dst_ptr += w + dst_jump;
28      }
29    return;
30    pal = 0;
31    dith_x = 0;
32    dith_y = 0;
33 }
34 #endif
35 #endif
36
37 #ifdef BUILD_CONVERT_32_RGB_8888
38 #ifdef BUILD_CONVERT_32_RGB_ROT180
39 void
40 evas_common_convert_rgba_to_32bpp_rgb_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
41 {
42    DATA32 *src_ptr;
43    DATA32 *dst_ptr;
44    int x, y;
45
46    dst_ptr = (DATA32 *)dst;
47
48    CONVERT_LOOP_START_ROT_180();
49
50    *dst_ptr = *src_ptr;
51
52    CONVERT_LOOP_END_ROT_180();
53    return;
54    pal = 0;
55    dith_x = 0;
56    dith_y = 0;
57 }
58 #endif
59 #endif
60
61 #ifdef BUILD_CONVERT_32_RGB_8888
62 #ifdef BUILD_CONVERT_32_RGB_ROT270
63 void
64 evas_common_convert_rgba_to_32bpp_rgb_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
65 {
66    DATA32 *src_ptr;
67    DATA32 *dst_ptr;
68    int x, y;
69
70    dst_ptr = (DATA32 *)dst;
71
72    CONVERT_LOOP_START_ROT_270();
73
74    *dst_ptr = *src_ptr;
75
76    CONVERT_LOOP_END_ROT_270();
77    return;
78    pal = 0;
79    dith_x = 0;
80    dith_y = 0;
81 }
82 #endif
83 #endif
84
85 #ifdef BUILD_CONVERT_32_RGB_8888
86 #ifdef BUILD_CONVERT_32_RGB_ROT90
87 void
88 evas_common_convert_rgba_to_32bpp_rgb_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
89 {
90    DATA32 *src_ptr;
91    DATA32 *dst_ptr;
92    int x, y;
93
94    dst_ptr = (DATA32 *)dst;
95
96    CONVERT_LOOP_START_ROT_90();
97
98    *dst_ptr = *src_ptr;
99
100    CONVERT_LOOP_END_ROT_90();
101    return;
102    pal = 0;
103    dith_x = 0;
104    dith_y = 0;
105 }
106 #endif
107 #endif
108
109 #ifdef BUILD_CONVERT_32_RGBX_8888
110 #ifdef BUILD_CONVERT_32_RGB_ROT0
111 void
112 evas_common_convert_rgba_to_32bpp_rgbx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
113 {
114    DATA32 *src_ptr;
115    DATA32 *dst_ptr;
116    int x, y;
117
118    dst_ptr = (DATA32 *)dst;
119
120    CONVERT_LOOP_START_ROT_0();
121
122 //   *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
123    *dst_ptr = (*src_ptr << 8);
124
125    CONVERT_LOOP_END_ROT_0();
126    return;
127    pal = 0;
128    dith_x = 0;
129    dith_y = 0;
130 }
131 #endif
132 #endif
133
134 #ifdef BUILD_CONVERT_32_RGBX_8888
135 #ifdef BUILD_CONVERT_32_RGB_ROT180
136 void
137 evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
138 {
139    DATA32 *src_ptr;
140    DATA32 *dst_ptr;
141    int x, y;
142
143    dst_ptr = (DATA32 *)dst;
144
145    CONVERT_LOOP_START_ROT_180();
146
147 //   *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
148    *dst_ptr = (*src_ptr << 8);
149
150    CONVERT_LOOP_END_ROT_180();
151    return;
152    pal = 0;
153    dith_x = 0;
154    dith_y = 0;
155 }
156 #endif
157 #endif
158
159 #ifdef BUILD_CONVERT_32_RGBX_8888
160 #ifdef BUILD_CONVERT_32_RGB_ROT270
161 void
162 evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
163 {
164    DATA32 *src_ptr;
165    DATA32 *dst_ptr;
166    int x, y;
167
168    dst_ptr = (DATA32 *)dst;
169
170    CONVERT_LOOP_START_ROT_270();
171
172 //   *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
173    *dst_ptr = (*src_ptr << 8);
174
175    CONVERT_LOOP_END_ROT_270();
176    return;
177    pal = 0;
178    dith_x = 0;
179    dith_y = 0;
180 }
181 #endif
182 #endif
183
184 #ifdef BUILD_CONVERT_32_RGBX_8888
185 #ifdef BUILD_CONVERT_32_RGB_ROT90
186 void
187 evas_common_convert_rgba_to_32bpp_rgbx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
188 {
189    DATA32 *src_ptr;
190    DATA32 *dst_ptr;
191    int x, y;
192
193    dst_ptr = (DATA32 *)dst;
194
195    CONVERT_LOOP_START_ROT_90();
196
197 //   *dst_ptr = (R_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (B_VAL(src_ptr) << 8);
198    *dst_ptr = (*src_ptr << 8);
199
200    CONVERT_LOOP_END_ROT_90();
201    return;
202    pal = 0;
203    dith_x = 0;
204    dith_y = 0;
205 }
206 #endif
207 #endif
208
209 #ifdef BUILD_CONVERT_32_BGR_8888
210 #ifdef BUILD_CONVERT_32_RGB_ROT0
211 void
212 evas_common_convert_rgba_to_32bpp_bgr_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
213 {
214    DATA32 *src_ptr;
215    DATA32 *dst_ptr;
216    int x, y;
217
218    dst_ptr = (DATA32 *)dst;
219
220    CONVERT_LOOP_START_ROT_0();
221
222    *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
223
224    CONVERT_LOOP_END_ROT_0();
225    return;
226    pal = 0;
227    dith_x = 0;
228    dith_y = 0;
229 }
230 #endif
231 #endif
232
233 #ifdef BUILD_CONVERT_32_BGR_8888
234 #ifdef BUILD_CONVERT_32_RGB_ROT180
235 void
236 evas_common_convert_rgba_to_32bpp_bgr_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
237 {
238    DATA32 *src_ptr;
239    DATA32 *dst_ptr;
240    int x, y;
241
242    dst_ptr = (DATA32 *)dst;
243
244    CONVERT_LOOP_START_ROT_180();
245
246    *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
247
248    CONVERT_LOOP_END_ROT_180();
249    return;
250    pal = 0;
251    dith_x = 0;
252    dith_y = 0;
253 }
254 #endif
255 #endif
256
257 #ifdef BUILD_CONVERT_32_BGR_8888
258 #ifdef BUILD_CONVERT_32_RGB_ROT270
259 void
260 evas_common_convert_rgba_to_32bpp_bgr_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
261 {
262    DATA32 *src_ptr;
263    DATA32 *dst_ptr;
264    int x, y;
265
266    dst_ptr = (DATA32 *)dst;
267
268    CONVERT_LOOP_START_ROT_270();
269
270    *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
271
272    CONVERT_LOOP_END_ROT_270();
273    return;
274    pal = 0;
275    dith_x = 0;
276    dith_y = 0;
277 }
278 #endif
279 #endif
280
281 #ifdef BUILD_CONVERT_32_BGR_8888
282 #ifdef BUILD_CONVERT_32_RGB_ROT90
283 void
284 evas_common_convert_rgba_to_32bpp_bgr_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
285 {
286    DATA32 *src_ptr;
287    DATA32 *dst_ptr;
288    int x, y;
289
290    dst_ptr = (DATA32 *)dst;
291
292    CONVERT_LOOP_START_ROT_90();
293
294    *dst_ptr = (B_VAL(src_ptr) << 16) | (G_VAL(src_ptr) << 8) | (R_VAL(src_ptr));
295
296    CONVERT_LOOP_END_ROT_90();
297    return;
298    pal = 0;
299    dith_x = 0;
300    dith_y = 0;
301 }
302 #endif
303 #endif
304
305 #ifdef BUILD_CONVERT_32_BGRX_8888
306 #ifdef BUILD_CONVERT_32_RGB_ROT0
307 void
308 evas_common_convert_rgba_to_32bpp_bgrx_8888 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
309 {
310    DATA32 *src_ptr;
311    DATA32 *dst_ptr;
312    int x, y;
313
314    dst_ptr = (DATA32 *)dst;
315
316    CONVERT_LOOP_START_ROT_0();
317
318    *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
319
320    CONVERT_LOOP_END_ROT_0();
321    return;
322    pal = 0;
323    dith_x = 0;
324    dith_y = 0;
325 }
326 #endif
327 #endif
328
329 #ifdef BUILD_CONVERT_32_BGRX_8888
330 #ifdef BUILD_CONVERT_32_RGB_ROT180
331 void
332 evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_180 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
333 {
334    DATA32 *src_ptr;
335    DATA32 *dst_ptr;
336    int x, y;
337
338    dst_ptr = (DATA32 *)dst;
339
340    CONVERT_LOOP_START_ROT_180();
341
342    *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
343
344    CONVERT_LOOP_END_ROT_180();
345    return;
346    pal = 0;
347    dith_x = 0;
348    dith_y = 0;
349 }
350 #endif
351 #endif
352
353 #ifdef BUILD_CONVERT_32_BGRX_8888
354 #ifdef BUILD_CONVERT_32_RGB_ROT270
355 void
356 evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_270 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
357 {
358    DATA32 *src_ptr;
359    DATA32 *dst_ptr;
360    int x, y;
361
362    dst_ptr = (DATA32 *)dst;
363
364    CONVERT_LOOP_START_ROT_270();
365
366    *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
367
368    CONVERT_LOOP_END_ROT_270();
369    return;
370    pal = 0;
371    dith_x = 0;
372    dith_y = 0;
373 }
374 #endif
375 #endif
376
377 #ifdef BUILD_CONVERT_32_BGRX_8888
378 #ifdef BUILD_CONVERT_32_RGB_ROT90
379 void
380 evas_common_convert_rgba_to_32bpp_bgrx_8888_rot_90 (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal)
381 {
382    DATA32 *src_ptr;
383    DATA32 *dst_ptr;
384    int x, y;
385
386    dst_ptr = (DATA32 *)dst;
387
388    CONVERT_LOOP_START_ROT_90();
389
390    *dst_ptr = (B_VAL(src_ptr) << 24) | (G_VAL(src_ptr) << 16) | (R_VAL(src_ptr) << 8);
391
392    CONVERT_LOOP_END_ROT_90();
393    return;
394    pal = 0;
395    dith_x = 0;
396    dith_y = 0;
397 }
398 #endif
399 #endif