List.mui: Update entries count prior to range change
[AROS.git] / rom / hidds / graphics / colorconv / rgbconv_bgra32.h
bloba28119ecc234d71b5f4586011c9c047492cbd6d6
1 CONVERTFUNC(BGRA32,RGB16)
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];
14 dst[x] = DOWNSHIFT16(s, BGRA32, RGB16);
16 src = (ULONG *)(((UBYTE *)src) + srcMod);
17 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
20 return 1;
22 CONVERTFUNC_EXIT
25 CONVERTFUNC(BGRA32,BGR16)
27 CONVERTFUNC_INIT
29 ULONG *src = (ULONG *)srcPixels;
30 UWORD *dst = (UWORD *)dstPixels;
31 ULONG x, y;
33 for(y = 0; y < height; y++)
35 for(x = 0; x < width; x++)
37 ULONG s = src[x];
39 dst[x] = DOWNSHIFT16(s, BGRA32, BGR16);
41 src = (ULONG *)(((UBYTE *)src) + srcMod);
42 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
45 return 1;
47 CONVERTFUNC_EXIT
50 CONVERTFUNC(BGRA32,RGB15)
52 CONVERTFUNC_INIT
54 ULONG *src = (ULONG *)srcPixels;
55 UWORD *dst = (UWORD *)dstPixels;
56 ULONG x, y;
58 for(y = 0; y < height; y++)
60 for(x = 0; x < width; x++)
62 ULONG s = src[x];
64 dst[x] = DOWNSHIFT16(s, BGRA32, RGB15);
66 src = (ULONG *)(((UBYTE *)src) + srcMod);
67 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
70 return 1;
72 CONVERTFUNC_EXIT
75 CONVERTFUNC(BGRA32,BGR15)
77 CONVERTFUNC_INIT
79 ULONG *src = (ULONG *)srcPixels;
80 UWORD *dst = (UWORD *)dstPixels;
81 ULONG x, y;
83 for(y = 0; y < height; y++)
85 for(x = 0; x < width; x++)
87 ULONG s = src[x];
89 dst[x] = DOWNSHIFT16(s, BGRA32, BGR15);
91 src = (ULONG *)(((UBYTE *)src) + srcMod);
92 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
95 return 1;
97 CONVERTFUNC_EXIT
100 CONVERTFUNC(BGRA32,ARGB32)
102 CONVERTFUNC_INIT
104 SWAP32CODE
106 CONVERTFUNC_EXIT
109 CONVERTFUNC(BGRA32,RGBA32)
111 CONVERTFUNC_INIT
113 ULONG *src = (ULONG *)srcPixels;
114 ULONG *dst = (ULONG *)dstPixels;
115 ULONG x, y;
117 for(y = 0; y < height; y++)
119 for(x = 0; x < width; x++)
121 ULONG s = src[x];
123 dst[x] = SHUFFLE32(s, BGRA32, RGBA32);
125 src = (ULONG *)(((UBYTE *)src) + srcMod);
126 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
129 return 1;
131 CONVERTFUNC_EXIT
135 CONVERTFUNC(BGRA32,ABGR32)
137 CONVERTFUNC_INIT
139 ULONG *src = (ULONG *)srcPixels;
140 ULONG *dst = (ULONG *)dstPixels;
141 ULONG x, y;
143 for(y = 0; y < height; y++)
145 for(x = 0; x < width; x++)
147 ULONG s = src[x];
149 dst[x] = SHUFFLE32(s, BGRA32, ABGR32);
151 src = (ULONG *)(((UBYTE *)src) + srcMod);
152 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
155 return 1;
157 CONVERTFUNC_EXIT
160 CONVERTFUNC(BGRA32,RGB24)
162 CONVERTFUNC_INIT
164 ULONG *src = (ULONG *)srcPixels;
165 UBYTE *dst = (UBYTE *)dstPixels;
166 ULONG x, y;
168 for(y = 0; y < height; y++)
170 for(x = 0; x < width; x++)
172 ULONG s = src[x];
174 PUT24(dst, COMP8(s, 2), COMP8(s, 1), COMP8(s, 0))
176 src = (ULONG *)(((UBYTE *)src) + srcMod);
177 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
180 return 1;
182 CONVERTFUNC_EXIT
185 CONVERTFUNC(BGRA32,BGR24)
187 CONVERTFUNC_INIT
189 ULONG *src = (ULONG *)srcPixels;
190 UBYTE *dst = (UBYTE *)dstPixels;
191 ULONG x, y;
193 for(y = 0; y < height; y++)
195 for(x = 0; x < width; x++)
197 ULONG s = src[x];
199 PUT24(dst, COMP8(s, 0), COMP8(s, 1), COMP8(s, 2))
201 src = (ULONG *)(((UBYTE *)src) + srcMod);
202 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
205 return 1;
207 CONVERTFUNC_EXIT
210 CONVERTFUNC(BGRA32,RGB16OE)
212 CONVERTFUNC_INIT
214 ULONG *src = (ULONG *)srcPixels;
215 UWORD *dst = (UWORD *)dstPixels;
216 ULONG x, y;
218 for(y = 0; y < height; y++)
220 for(x = 0; x < width; x++)
222 ULONG s = src[x];
224 s = DOWNSHIFT16(s, BGRA32, RGB16);
225 dst[x] = INV16(s);
227 src = (ULONG *)(((UBYTE *)src) + srcMod);
228 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
231 return 1;
233 CONVERTFUNC_EXIT
236 CONVERTFUNC(BGRA32,BGR16OE)
238 CONVERTFUNC_INIT
240 ULONG *src = (ULONG *)srcPixels;
241 UWORD *dst = (UWORD *)dstPixels;
242 ULONG x, y;
244 for(y = 0; y < height; y++)
246 for(x = 0; x < width; x++)
248 ULONG s = src[x];
250 s = DOWNSHIFT16(s, BGRA32, BGR16);
251 dst[x] = INV16(s);
253 src = (ULONG *)(((UBYTE *)src) + srcMod);
254 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
257 return 1;
259 CONVERTFUNC_EXIT
262 CONVERTFUNC(BGRA32,RGB15OE)
264 CONVERTFUNC_INIT
266 ULONG *src = (ULONG *)srcPixels;
267 UWORD *dst = (UWORD *)dstPixels;
268 ULONG x, y;
270 for(y = 0; y < height; y++)
272 for(x = 0; x < width; x++)
274 ULONG s = src[x];
276 s = DOWNSHIFT16(s, BGRA32, RGB15);
277 dst[x] = INV16(s);
279 src = (ULONG *)(((UBYTE *)src) + srcMod);
280 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
283 return 1;
285 CONVERTFUNC_EXIT
288 CONVERTFUNC(BGRA32,BGR15OE)
290 CONVERTFUNC_INIT
292 ULONG *src = (ULONG *)srcPixels;
293 UWORD *dst = (UWORD *)dstPixels;
294 ULONG x, y;
296 for(y = 0; y < height; y++)
298 for(x = 0; x < width; x++)
300 ULONG s = src[x];
302 s = DOWNSHIFT16(s, BGRA32, BGR15);
303 dst[x] = INV16(s);
305 src = (ULONG *)(((UBYTE *)src) + srcMod);
306 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
309 return 1;
311 CONVERTFUNC_EXIT
314 CONVERTFUNC(BGRA32,BGRX32)
316 CONVERTFUNC_INIT
318 ULONG *src = (ULONG *)srcPixels;
319 ULONG *dst = (ULONG *)dstPixels;
320 ULONG x, y;
322 for(y = 0; y < height; y++)
324 for(x = 0; x < width; x++)
326 ULONG s = src[x];
328 dst[x] = s & 0xFFFFFF00;
330 src = (ULONG *)(((UBYTE *)src) + srcMod);
331 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
334 return 1;
336 CONVERTFUNC_EXIT
339 CONVERTFUNC(BGRA32,XRGB32)
341 CONVERTFUNC_INIT
343 ULONG *src = (ULONG *)srcPixels;
344 ULONG *dst = (ULONG *)dstPixels;
345 ULONG x, y;
347 for(y = 0; y < height; y++)
349 for(x = 0; x < width; x++)
351 ULONG s = src[x];
353 dst[x] = SHUFFLE24(s, BGRA32, ARGB32);
355 src = (ULONG *)(((UBYTE *)src) + srcMod);
356 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
359 return 1;
361 CONVERTFUNC_EXIT
364 CONVERTFUNC(BGRA32,RGBX32)
366 CONVERTFUNC_INIT
368 ULONG *src = (ULONG *)srcPixels;
369 ULONG *dst = (ULONG *)dstPixels;
370 ULONG x, y;
372 for(y = 0; y < height; y++)
374 for(x = 0; x < width; x++)
376 ULONG s = src[x];
378 dst[x] = SHUFFLE24(s, BGRA32, RGBA32);
380 src = (ULONG *)(((UBYTE *)src) + srcMod);
381 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
384 return 1;
386 CONVERTFUNC_EXIT
390 CONVERTFUNC(BGRA32,XBGR32)
392 CONVERTFUNC_INIT
394 ULONG *src = (ULONG *)srcPixels;
395 ULONG *dst = (ULONG *)dstPixels;
396 ULONG x, y;
398 for(y = 0; y < height; y++)
400 for(x = 0; x < width; x++)
402 ULONG s = src[x];
404 dst[x] = SHUFFLE24(s, BGRA32, ABGR32);
406 src = (ULONG *)(((UBYTE *)src) + srcMod);
407 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
410 return 1;
412 CONVERTFUNC_EXIT