Updated to V6.5 (SVN rev. 92)
[cake.git] / test / patchrgbconv_bgr15.h
blob2ff1e8fd0800c31c2926028b104c3a432020bee6
1 CONVERTFUNC(BGR15,RGB16) /* Untested */
3 CONVERTFUNC_INIT
5 SWAP1516CODE
7 CONVERTFUNC_EXIT
10 CONVERTFUNC(BGR15,BGR16) /* 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 & (BGR15_BMASK | BGR15_GMASK)) << 1) | (s & BGR15_RMASK);
26 src = (UWORD *)(((UBYTE *)src) + srcMod);
27 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
30 return 1;
32 CONVERTFUNC_EXIT
35 CONVERTFUNC(BGR15,RGB15) /* Untested */
37 CONVERTFUNC_INIT
39 SWAP1515CODE
41 CONVERTFUNC_EXIT
44 CONVERTFUNC(BGR15,ARGB32) /* Untested */
46 CONVERTFUNC_INIT
48 UWORD *src = (UWORD *)srcPixels;
49 ULONG *dst = (ULONG *)dstPixels;
50 ULONG x, y;
52 for(y = 0; y < height; y++)
54 for(x = 0; x < width; x++)
56 ULONG s = src[x];
58 dst[x] = UPSHIFT16(s, BGR15, ARGB32);
60 src = (UWORD *)(((UBYTE *)src) + srcMod);
61 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
64 return 1;
66 CONVERTFUNC_EXIT
69 CONVERTFUNC(BGR15,BGRA32) /* Untested */
71 CONVERTFUNC_INIT
73 UWORD *src = (UWORD *)srcPixels;
74 ULONG *dst = (ULONG *)dstPixels;
75 ULONG x, y;
77 for(y = 0; y < height; y++)
79 for(x = 0; x < width; x++)
81 ULONG s = src[x];
83 dst[x] = UPSHIFT16(s, BGR15, BGRA32);
85 src = (UWORD *)(((UBYTE *)src) + srcMod);
86 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
89 return 1;
91 CONVERTFUNC_EXIT
94 CONVERTFUNC(BGR15,RGBA32) /* Untested */
96 CONVERTFUNC_INIT
98 UWORD *src = (UWORD *)srcPixels;
99 ULONG *dst = (ULONG *)dstPixels;
100 ULONG x, y;
102 for(y = 0; y < height; y++)
104 for(x = 0; x < width; x++)
106 ULONG s = src[x];
108 dst[x] = UPSHIFT16(s, BGR15, RGBA32);
110 src = (UWORD *)(((UBYTE *)src) + srcMod);
111 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
114 return 1;
116 CONVERTFUNC_EXIT
120 CONVERTFUNC(BGR15,ABGR32) /* Untested */
122 CONVERTFUNC_INIT
124 UWORD *src = (UWORD *)srcPixels;
125 ULONG *dst = (ULONG *)dstPixels;
126 ULONG x, y;
128 for(y = 0; y < height; y++)
130 for(x = 0; x < width; x++)
132 ULONG s = src[x];
134 dst[x] = UPSHIFT16(s, BGR15, ABGR32);
136 src = (UWORD *)(((UBYTE *)src) + srcMod);
137 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
140 return 1;
142 CONVERTFUNC_EXIT
145 CONVERTFUNC(BGR15,RGB24) /* Untested */
147 CONVERTFUNC_INIT
149 UWORD *src = (UWORD *)srcPixels;
150 UBYTE *dst = (UBYTE *)dstPixels;
151 ULONG x, y;
153 for(y = 0; y < height; y++)
155 for(x = 0; x < width; x++)
157 ULONG s = src[x];
159 s = UPSHIFT16(s, BGR15, RGB24);
161 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
163 src = (UWORD *)(((UBYTE *)src) + srcMod);
164 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
167 return 1;
169 CONVERTFUNC_EXIT
172 CONVERTFUNC(BGR15,BGR24) /* Untested */
174 CONVERTFUNC_INIT
176 UWORD *src = (UWORD *)srcPixels;
177 UBYTE *dst = (UBYTE *)dstPixels;
178 ULONG x, y;
180 for(y = 0; y < height; y++)
182 for(x = 0; x < width; x++)
184 ULONG s = src[x];
186 s = UPSHIFT16(s, BGR15, BGR24);
188 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
190 src = (UWORD *)(((UBYTE *)src) + srcMod);
191 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
194 return 1;
196 CONVERTFUNC_EXIT
199 CONVERTFUNC(BGR15,RGB16OE) /* Untested */
201 CONVERTFUNC_INIT
203 SWAP1516OECODE
205 CONVERTFUNC_EXIT
208 CONVERTFUNC(BGR15,BGR16OE) /* Untested */
210 CONVERTFUNC_INIT
212 UWORD *src = (UWORD *)srcPixels;
213 UWORD *dst = (UWORD *)dstPixels;
214 ULONG x, y;
216 for(y = 0; y < height; y++)
218 for(x = 0; x < width; x++)
220 UWORD s = src[x];
222 s = ((s & (BGR15_BMASK | BGR15_GMASK)) << 1) | (s & BGR15_RMASK);
223 dst[x] = INV16(s);
225 src = (UWORD *)(((UBYTE *)src) + srcMod);
226 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
229 return 1;
231 CONVERTFUNC_EXIT
234 CONVERTFUNC(BGR15,RGB15OE) /* Untested */
236 CONVERTFUNC_INIT
238 SWAP1515OECODE
240 CONVERTFUNC_EXIT
243 CONVERTFUNC(BGR15,BGR15OE) /* Untested */
245 CONVERTFUNC_INIT
247 SWAP16CODE
249 CONVERTFUNC_EXIT
252 CONVERTFUNC(BGR15,XRGB32) /* Untested */
254 CONVERTFUNC_INIT
256 UWORD *src = (UWORD *)srcPixels;
257 ULONG *dst = (ULONG *)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 dst[x] = UPSHIFT16(s, BGR15, ARGB32);
268 src = (UWORD *)(((UBYTE *)src) + srcMod);
269 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
272 return 1;
274 CONVERTFUNC_EXIT
277 CONVERTFUNC(BGR15,BGRX32) /* Untested */
279 CONVERTFUNC_INIT
281 UWORD *src = (UWORD *)srcPixels;
282 ULONG *dst = (ULONG *)dstPixels;
283 ULONG x, y;
285 for(y = 0; y < height; y++)
287 for(x = 0; x < width; x++)
289 ULONG s = src[x];
291 dst[x] = UPSHIFT16(s, BGR15, BGRA32);
293 src = (UWORD *)(((UBYTE *)src) + srcMod);
294 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
297 return 1;
299 CONVERTFUNC_EXIT
302 CONVERTFUNC(BGR15,RGBX32) /* Untested */
304 CONVERTFUNC_INIT
306 UWORD *src = (UWORD *)srcPixels;
307 ULONG *dst = (ULONG *)dstPixels;
308 ULONG x, y;
310 for(y = 0; y < height; y++)
312 for(x = 0; x < width; x++)
314 ULONG s = src[x];
316 dst[x] = UPSHIFT16(s, BGR15, RGBA32);
318 src = (UWORD *)(((UBYTE *)src) + srcMod);
319 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
322 return 1;
324 CONVERTFUNC_EXIT
328 CONVERTFUNC(BGR15,XBGR32) /* Untested */
330 CONVERTFUNC_INIT
332 UWORD *src = (UWORD *)srcPixels;
333 ULONG *dst = (ULONG *)dstPixels;
334 ULONG x, y;
336 for(y = 0; y < height; y++)
338 for(x = 0; x < width; x++)
340 ULONG s = src[x];
342 dst[x] = UPSHIFT16(s, BGR15, ABGR32);
344 src = (UWORD *)(((UBYTE *)src) + srcMod);
345 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
348 return 1;
350 CONVERTFUNC_EXIT