r6308@lvps87-230-33-50: verhaegs | 2007-12-03 22:24:30 +0100
[AROS.git] / test / patchrgbconv_xbgr32.h
blobe2050e3bff51686a4ad64bd7dd0b216707d2f2bf
1 CONVERTFUNC(XBGR32,RGB16) /* Untested */
3 CONVERTFUNC_INIT
5 ULONG *src = (ULONG *)srcPixels;
6 UWORD *dst = (UWORD *)dstPixels;
7 ULONG x, y;
9 for(y = 0; y < height; y++)
11 for(x = 0; x < width; x++)
13 ULONG s = src[x];
15 dst[x] = DOWNSHIFT16(s, ABGR32, RGB16);
17 src = (ULONG *)(((UBYTE *)src) + srcMod);
18 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
21 return 1;
23 CONVERTFUNC_EXIT
26 CONVERTFUNC(XBGR32,BGR16) /* Untested */
28 CONVERTFUNC_INIT
30 ULONG *src = (ULONG *)srcPixels;
31 UWORD *dst = (UWORD *)dstPixels;
32 ULONG x, y;
34 for(y = 0; y < height; y++)
36 for(x = 0; x < width; x++)
38 ULONG s = src[x];
40 dst[x] = DOWNSHIFT16(s, ABGR32, BGR16);
42 src = (ULONG *)(((UBYTE *)src) + srcMod);
43 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
46 return 1;
48 CONVERTFUNC_EXIT
51 CONVERTFUNC(XBGR32,RGB15) /* Untested */
53 CONVERTFUNC_INIT
55 ULONG *src = (ULONG *)srcPixels;
56 UWORD *dst = (UWORD *)dstPixels;
57 ULONG x, y;
59 for(y = 0; y < height; y++)
61 for(x = 0; x < width; x++)
63 ULONG s = src[x];
65 dst[x] = DOWNSHIFT16(s, ABGR32, RGB15);
67 src = (ULONG *)(((UBYTE *)src) + srcMod);
68 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
71 return 1;
73 CONVERTFUNC_EXIT
76 CONVERTFUNC(XBGR32,BGR15) /* Untested */
78 CONVERTFUNC_INIT
80 ULONG *src = (ULONG *)srcPixels;
81 UWORD *dst = (UWORD *)dstPixels;
82 ULONG x, y;
84 for(y = 0; y < height; y++)
86 for(x = 0; x < width; x++)
88 ULONG s = src[x];
90 dst[x] = DOWNSHIFT16(s, ABGR32, BGR15);
92 src = (ULONG *)(((UBYTE *)src) + srcMod);
93 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
96 return 1;
98 CONVERTFUNC_EXIT
101 CONVERTFUNC(XBGR32,RGBA32) /* Untested */
103 CONVERTFUNC_INIT
105 ULONG *src = (ULONG *)srcPixels;
106 ULONG *dst = (ULONG *)dstPixels;
107 ULONG x, y;
109 for(y = 0; y < height; y++)
111 for(x = 0; x < width; x++)
113 ULONG s = src[x];
115 dst[x] = SHUFFLE24(s, ABGR32, RGBA32);
117 src = (ULONG *)(((UBYTE *)src) + srcMod);
118 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
121 return 1;
123 CONVERTFUNC_EXIT
126 CONVERTFUNC(XBGR32,ARGB32) /* Untested */
128 CONVERTFUNC_INIT
130 ULONG *src = (ULONG *)srcPixels;
131 ULONG *dst = (ULONG *)dstPixels;
132 ULONG x, y;
134 for(y = 0; y < height; y++)
136 for(x = 0; x < width; x++)
138 ULONG s = src[x];
140 dst[x] = SHUFFLE24(s, ABGR32, ARGB32);
142 src = (ULONG *)(((UBYTE *)src) + srcMod);
143 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
146 return 1;
148 CONVERTFUNC_EXIT
152 CONVERTFUNC(XBGR32,BGRA32) /* Untested */
154 CONVERTFUNC_INIT
156 ULONG *src = (ULONG *)srcPixels;
157 ULONG *dst = (ULONG *)dstPixels;
158 ULONG x, y;
160 for(y = 0; y < height; y++)
162 for(x = 0; x < width; x++)
164 ULONG s = src[x];
166 dst[x] = SHUFFLE24(s, ABGR32, BGRA32);
168 src = (ULONG *)(((UBYTE *)src) + srcMod);
169 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
172 return 1;
174 CONVERTFUNC_EXIT
177 CONVERTFUNC(XBGR32,ABGR32) /* Untested */
179 CONVERTFUNC_INIT
181 ULONG *src = (ULONG *)srcPixels;
182 ULONG *dst = (ULONG *)dstPixels;
183 ULONG x, y;
185 for(y = 0; y < height; y++)
187 for(x = 0; x < width; x++)
189 ULONG s = src[x];
191 dst[x] = s & 0x00FFFFFF;
193 src = (ULONG *)(((UBYTE *)src) + srcMod);
194 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
197 return 1;
199 CONVERTFUNC_EXIT
202 CONVERTFUNC(XBGR32,RGB24) /* Untested */
204 CONVERTFUNC_INIT
206 ULONG *src = (ULONG *)srcPixels;
207 UBYTE *dst = (UBYTE *)dstPixels;
208 ULONG x, y;
210 for(y = 0; y < height; y++)
212 for(x = 0; x < width; x++)
214 ULONG s = src[x];
216 PUT24(dst, COMP8(s,3), COMP8(s, 2), COMP8(s, 1))
218 src = (ULONG *)(((UBYTE *)src) + srcMod);
219 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
222 return 1;
224 CONVERTFUNC_EXIT
227 CONVERTFUNC(XBGR32,BGR24) /* Untested */
229 CONVERTFUNC_INIT
231 ULONG *src = (ULONG *)srcPixels;
232 UBYTE *dst = (UBYTE *)dstPixels;
233 ULONG x, y;
235 for(y = 0; y < height; y++)
237 for(x = 0; x < width; x++)
239 ULONG s = src[x];
241 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
243 src = (ULONG *)(((UBYTE *)src) + srcMod);
244 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
247 return 1;
249 CONVERTFUNC_EXIT
252 CONVERTFUNC(XBGR32,RGB16OE) /* Untested */
254 CONVERTFUNC_INIT
256 ULONG *src = (ULONG *)srcPixels;
257 UWORD *dst = (UWORD *)dstPixels;
258 ULONG x, y;
260 for(y = 0; y < height; y++)
262 for(x = 0; x < width; x++)
264 ULONG s = src[x];
266 s = DOWNSHIFT16(s, ABGR32, RGB16);
267 dst[x] = INV16(s);
269 src = (ULONG *)(((UBYTE *)src) + srcMod);
270 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
273 return 1;
275 CONVERTFUNC_EXIT
278 CONVERTFUNC(XBGR32,BGR16OE) /* Untested */
280 CONVERTFUNC_INIT
282 ULONG *src = (ULONG *)srcPixels;
283 UWORD *dst = (UWORD *)dstPixels;
284 ULONG x, y;
286 for(y = 0; y < height; y++)
288 for(x = 0; x < width; x++)
290 ULONG s = src[x];
292 s = DOWNSHIFT16(s, ABGR32, BGR16);
293 dst[x] = INV16(s);
295 src = (ULONG *)(((UBYTE *)src) + srcMod);
296 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
299 return 1;
301 CONVERTFUNC_EXIT
304 CONVERTFUNC(XBGR32,RGB15OE) /* Untested */
306 CONVERTFUNC_INIT
308 ULONG *src = (ULONG *)srcPixels;
309 UWORD *dst = (UWORD *)dstPixels;
310 ULONG x, y;
312 for(y = 0; y < height; y++)
314 for(x = 0; x < width; x++)
316 ULONG s = src[x];
318 s = DOWNSHIFT16(s, ABGR32, RGB15);
319 dst[x] = INV16(s);
321 src = (ULONG *)(((UBYTE *)src) + srcMod);
322 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
325 return 1;
327 CONVERTFUNC_EXIT
330 CONVERTFUNC(XBGR32,BGR15OE) /* Untested */
332 CONVERTFUNC_INIT
334 ULONG *src = (ULONG *)srcPixels;
335 UWORD *dst = (UWORD *)dstPixels;
336 ULONG x, y;
338 for(y = 0; y < height; y++)
340 for(x = 0; x < width; x++)
342 ULONG s = src[x];
344 s = DOWNSHIFT16(s, ABGR32, BGR15);
345 dst[x] = INV16(s);
347 src = (ULONG *)(((UBYTE *)src) + srcMod);
348 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
351 return 1;
353 CONVERTFUNC_EXIT
356 CONVERTFUNC(XBGR32,BGRX32) /* Untested */
358 CONVERTFUNC_INIT
360 ULONG *src = (ULONG *)srcPixels;
361 ULONG *dst = (ULONG *)dstPixels;
362 ULONG x, y;
364 for(y = 0; y < height; y++)
366 for(x = 0; x < width; x++)
368 ULONG s = src[x];
370 dst[x] = SHUFFLE24(s, ABGR32, BGRA32);
372 src = (ULONG *)(((UBYTE *)src) + srcMod);
373 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
376 return 1;
378 CONVERTFUNC_EXIT
381 CONVERTFUNC(XBGR32,RGBX32) /* Untested */
383 CONVERTFUNC_INIT
385 SWAP32CODE
387 CONVERTFUNC_EXIT
391 CONVERTFUNC(XBGR32,XRGB32) /* Untested */
393 CONVERTFUNC_INIT
395 ULONG *src = (ULONG *)srcPixels;
396 ULONG *dst = (ULONG *)dstPixels;
397 ULONG x, y;
399 for(y = 0; y < height; y++)
401 for(x = 0; x < width; x++)
403 ULONG s = src[x];
405 dst[x] = SHUFFLE24(s, ABGR32, ARGB32);
407 src = (ULONG *)(((UBYTE *)src) + srcMod);
408 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
411 return 1;
413 CONVERTFUNC_EXIT