grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / hidds / graphics / colorconv / rgbconv_bgr16.h
blobff8fbc7eab296bcb08a9a1cee95597d2be4d31da
1 CONVERTFUNC(BGR16,RGB16)
3 CONVERTFUNC_INIT
5 SWAP1616CODE
7 CONVERTFUNC_EXIT
10 CONVERTFUNC(BGR16,BGR15)
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)
38 CONVERTFUNC_INIT
40 SWAP1615CODE
42 CONVERTFUNC_EXIT
45 CONVERTFUNC(BGR16,ARGB32)
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)
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)
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)
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)
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)
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)
202 CONVERTFUNC_INIT
204 SWAP1616OECODE
206 CONVERTFUNC_EXIT
209 CONVERTFUNC(BGR16,BGR15OE)
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);
226 src = (UWORD *)(((UBYTE *)src) + srcMod);
227 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
230 return 1;
232 CONVERTFUNC_EXIT
235 CONVERTFUNC(BGR16,RGB15OE)
237 CONVERTFUNC_INIT
239 SWAP1615OECODE
241 CONVERTFUNC_EXIT
244 CONVERTFUNC(BGR16,BGR16OE)
246 CONVERTFUNC_INIT
248 SWAP16CODE
250 CONVERTFUNC_EXIT
253 CONVERTFUNC(BGR16,XRGB32)
255 CONVERTFUNC_INIT
257 UWORD *src = (UWORD *)srcPixels;
258 ULONG *dst = (ULONG *)dstPixels;
259 ULONG x, y;
261 for(y = 0; y < height; y++)
263 for(x = 0; x < width; x++)
265 ULONG s = src[x];
267 dst[x] = UPSHIFT16(s, BGR16, ARGB32);
269 src = (UWORD *)(((UBYTE *)src) + srcMod);
270 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
273 return 1;
275 CONVERTFUNC_EXIT
278 CONVERTFUNC(BGR16,BGRX32)
280 CONVERTFUNC_INIT
282 UWORD *src = (UWORD *)srcPixels;
283 ULONG *dst = (ULONG *)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 dst[x] = UPSHIFT16(s, BGR16, BGRA32);
294 src = (UWORD *)(((UBYTE *)src) + srcMod);
295 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
298 return 1;
300 CONVERTFUNC_EXIT
303 CONVERTFUNC(BGR16,RGBX32)
305 CONVERTFUNC_INIT
307 UWORD *src = (UWORD *)srcPixels;
308 ULONG *dst = (ULONG *)dstPixels;
309 ULONG x, y;
311 for(y = 0; y < height; y++)
313 for(x = 0; x < width; x++)
315 ULONG s = src[x];
317 dst[x] = UPSHIFT16(s, BGR16, RGBA32);
319 src = (UWORD *)(((UBYTE *)src) + srcMod);
320 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
323 return 1;
325 CONVERTFUNC_EXIT
329 CONVERTFUNC(BGR16,XBGR32)
331 CONVERTFUNC_INIT
333 UWORD *src = (UWORD *)srcPixels;
334 ULONG *dst = (ULONG *)dstPixels;
335 ULONG x, y;
337 for(y = 0; y < height; y++)
339 for(x = 0; x < width; x++)
341 ULONG s = src[x];
343 dst[x] = UPSHIFT16(s, BGR16, ABGR32);
345 src = (UWORD *)(((UBYTE *)src) + srcMod);
346 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
349 return 1;
351 CONVERTFUNC_EXIT