*sigh* .. take 10 ... delete the correct lines this time.
[AROS.git] / test / patchrgbconv_bgr16.h
blob91a1fc381bf95f0574d62d507b03e29bc032e814
1 CONVERTFUNC(BGR16,RGB16) /* Untested */
3 CONVERTFUNC_INIT
5 SWAP1616CODE
7 CONVERTFUNC_EXIT
10 CONVERTFUNC(BGR16,BGR15) /* Untested */
12 CONVERTFUNC_INIT
14 UWORD *src = (UWORD *)srcPixels;
15 UWORD *dst = (UWORD *)dstPixels;
16 ULONG x, y;
18 for(y = 0; y < height; y++)
20 for(x = 0; x < width; x++)
22 UWORD s = src[x];
24 dst[x] = ((s >> 1) & (BGR15_BMASK | BGR15_GMASK)) | (s & BGR15_RMASK);
27 src = (UWORD *)(((UBYTE *)src) + srcMod);
28 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
31 return 1;
33 CONVERTFUNC_EXIT
36 CONVERTFUNC(BGR16,RGB15) /* Untested */
38 CONVERTFUNC_INIT
40 SWAP1615CODE
42 CONVERTFUNC_EXIT
45 CONVERTFUNC(BGR16,ARGB32) /* Untested */
47 CONVERTFUNC_INIT
49 UWORD *src = (UWORD *)srcPixels;
50 ULONG *dst = (ULONG *)dstPixels;
51 ULONG x, y;
53 for(y = 0; y < height; y++)
55 for(x = 0; x < width; x++)
57 ULONG s = src[x];
59 dst[x] = UPSHIFT16(s, BGR16, ARGB32);
61 src = (UWORD *)(((UBYTE *)src) + srcMod);
62 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
65 return 1;
67 CONVERTFUNC_EXIT
70 CONVERTFUNC(BGR16,BGRA32) /* Untested */
72 CONVERTFUNC_INIT
74 UWORD *src = (UWORD *)srcPixels;
75 ULONG *dst = (ULONG *)dstPixels;
76 ULONG x, y;
78 for(y = 0; y < height; y++)
80 for(x = 0; x < width; x++)
82 ULONG s = src[x];
84 dst[x] = UPSHIFT16(s, BGR16, BGRA32);
86 src = (UWORD *)(((UBYTE *)src) + srcMod);
87 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
90 return 1;
92 CONVERTFUNC_EXIT
95 CONVERTFUNC(BGR16,RGBA32) /* Untested */
97 CONVERTFUNC_INIT
99 UWORD *src = (UWORD *)srcPixels;
100 ULONG *dst = (ULONG *)dstPixels;
101 ULONG x, y;
103 for(y = 0; y < height; y++)
105 for(x = 0; x < width; x++)
107 ULONG s = src[x];
109 dst[x] = UPSHIFT16(s, BGR16, RGBA32);
111 src = (UWORD *)(((UBYTE *)src) + srcMod);
112 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
115 return 1;
117 CONVERTFUNC_EXIT
121 CONVERTFUNC(BGR16,ABGR32) /* Untested */
123 CONVERTFUNC_INIT
125 UWORD *src = (UWORD *)srcPixels;
126 ULONG *dst = (ULONG *)dstPixels;
127 ULONG x, y;
129 for(y = 0; y < height; y++)
131 for(x = 0; x < width; x++)
133 ULONG s = src[x];
135 dst[x] = UPSHIFT16(s, BGR16, ABGR32);
137 src = (UWORD *)(((UBYTE *)src) + srcMod);
138 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
141 return 1;
143 CONVERTFUNC_EXIT
146 CONVERTFUNC(BGR16,RGB24) /* Untested */
148 CONVERTFUNC_INIT
150 UWORD *src = (UWORD *)srcPixels;
151 UBYTE *dst = (UBYTE *)dstPixels;
152 ULONG x, y;
154 for(y = 0; y < height; y++)
156 for(x = 0; x < width; x++)
158 ULONG s = src[x];
160 s = UPSHIFT16(s, BGR16, RGB24);
162 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
164 src = (UWORD *)(((UBYTE *)src) + srcMod);
165 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
168 return 1;
170 CONVERTFUNC_EXIT
173 CONVERTFUNC(BGR16,BGR24) /* Untested */
175 CONVERTFUNC_INIT
177 UWORD *src = (UWORD *)srcPixels;
178 UBYTE *dst = (UBYTE *)dstPixels;
179 ULONG x, y;
181 for(y = 0; y < height; y++)
183 for(x = 0; x < width; x++)
185 ULONG s = src[x];
187 s = UPSHIFT16(s, BGR16, BGR24);
189 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
191 src = (UWORD *)(((UBYTE *)src) + srcMod);
192 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
195 return 1;
197 CONVERTFUNC_EXIT
200 CONVERTFUNC(BGR16,RGB16OE) /* Untested */
202 CONVERTFUNC_INIT
204 SWAP1616OECODE
206 CONVERTFUNC_EXIT
209 CONVERTFUNC(BGR16,BGR15OE) /* Untested */
211 CONVERTFUNC_INIT
213 UWORD *src = (UWORD *)srcPixels;
214 UWORD *dst = (UWORD *)dstPixels;
215 ULONG x, y;
217 for(y = 0; y < height; y++)
219 for(x = 0; x < width; x++)
221 UWORD s = src[x];
223 s = ((s >> 1) & (BGR15_BMASK | BGR15_GMASK)) | (s & BGR15_RMASK);
224 dst[x] = INV16(s);
227 src = (UWORD *)(((UBYTE *)src) + srcMod);
228 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
231 return 1;
233 CONVERTFUNC_EXIT
236 CONVERTFUNC(BGR16,RGB15OE) /* Untested */
238 CONVERTFUNC_INIT
240 SWAP1615OECODE
242 CONVERTFUNC_EXIT
245 CONVERTFUNC(BGR16,BGR16OE) /* Untested */
247 CONVERTFUNC_INIT
249 SWAP16CODE
251 CONVERTFUNC_EXIT
254 CONVERTFUNC(BGR16,XRGB32) /* Untested */
256 CONVERTFUNC_INIT
258 UWORD *src = (UWORD *)srcPixels;
259 ULONG *dst = (ULONG *)dstPixels;
260 ULONG x, y;
262 for(y = 0; y < height; y++)
264 for(x = 0; x < width; x++)
266 ULONG s = src[x];
268 dst[x] = UPSHIFT16(s, BGR16, ARGB32);
270 src = (UWORD *)(((UBYTE *)src) + srcMod);
271 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
274 return 1;
276 CONVERTFUNC_EXIT
279 CONVERTFUNC(BGR16,BGRX32) /* Untested */
281 CONVERTFUNC_INIT
283 UWORD *src = (UWORD *)srcPixels;
284 ULONG *dst = (ULONG *)dstPixels;
285 ULONG x, y;
287 for(y = 0; y < height; y++)
289 for(x = 0; x < width; x++)
291 ULONG s = src[x];
293 dst[x] = UPSHIFT16(s, BGR16, BGRA32);
295 src = (UWORD *)(((UBYTE *)src) + srcMod);
296 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
299 return 1;
301 CONVERTFUNC_EXIT
304 CONVERTFUNC(BGR16,RGBX32) /* Untested */
306 CONVERTFUNC_INIT
308 UWORD *src = (UWORD *)srcPixels;
309 ULONG *dst = (ULONG *)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 dst[x] = UPSHIFT16(s, BGR16, RGBA32);
320 src = (UWORD *)(((UBYTE *)src) + srcMod);
321 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
324 return 1;
326 CONVERTFUNC_EXIT
330 CONVERTFUNC(BGR16,XBGR32) /* Untested */
332 CONVERTFUNC_INIT
334 UWORD *src = (UWORD *)srcPixels;
335 ULONG *dst = (ULONG *)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 dst[x] = UPSHIFT16(s, BGR16, ABGR32);
346 src = (UWORD *)(((UBYTE *)src) + srcMod);
347 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
350 return 1;
352 CONVERTFUNC_EXIT