Updated PCI IDs to latest snapshot.
[tangerine.git] / test / patchrgbconv_rgb15.h
blob2d92b778c370b477c8cef8af1f2b654f77257836
1 CONVERTFUNC(RGB15,RGB16) /* Untested */
3 CONVERTFUNC_INIT
5 UWORD *src = (UWORD *)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 UWORD s = src[x];
15 dst[x] = ((s & (RGB15_RMASK | RGB15_GMASK)) << 1) | (s & RGB15_BMASK);
17 src = (UWORD *)(((UBYTE *)src) + srcMod);
18 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
21 return 1;
23 CONVERTFUNC_EXIT
26 CONVERTFUNC(RGB15,BGR16) /* Untested */
28 CONVERTFUNC_INIT
30 SWAP1516CODE
32 CONVERTFUNC_EXIT
35 CONVERTFUNC(RGB15,BGR15) /* Untested */
37 CONVERTFUNC_INIT
39 SWAP1515CODE
41 return 1;
43 CONVERTFUNC_EXIT
46 CONVERTFUNC(RGB15,ARGB32) /* Untested */
48 CONVERTFUNC_INIT
50 UWORD *src = (UWORD *)srcPixels;
51 ULONG *dst = (ULONG *)dstPixels;
52 ULONG x, y;
54 for(y = 0; y < height; y++)
56 for(x = 0; x < width; x++)
58 ULONG s = src[x];
60 dst[x] = UPSHIFT16(s, RGB15, ARGB32);
62 src = (UWORD *)(((UBYTE *)src) + srcMod);
63 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
66 return 1;
68 CONVERTFUNC_EXIT
71 CONVERTFUNC(RGB15,BGRA32) /* Untested */
73 CONVERTFUNC_INIT
75 UWORD *src = (UWORD *)srcPixels;
76 ULONG *dst = (ULONG *)dstPixels;
77 ULONG x, y;
79 for(y = 0; y < height; y++)
81 for(x = 0; x < width; x++)
83 ULONG s = src[x];
85 dst[x] = UPSHIFT16(s, RGB15, BGRA32);
87 src = (UWORD *)(((UBYTE *)src) + srcMod);
88 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
91 return 1;
93 CONVERTFUNC_EXIT
96 CONVERTFUNC(RGB15,RGBA32) /* Untested */
98 CONVERTFUNC_INIT
100 UWORD *src = (UWORD *)srcPixels;
101 ULONG *dst = (ULONG *)dstPixels;
102 ULONG x, y;
104 for(y = 0; y < height; y++)
106 for(x = 0; x < width; x++)
108 ULONG s = src[x];
110 dst[x] = UPSHIFT16(s, RGB15, RGBA32);
112 src = (UWORD *)(((UBYTE *)src) + srcMod);
113 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
116 return 1;
118 CONVERTFUNC_EXIT
122 CONVERTFUNC(RGB15,ABGR32) /* Untested */
124 CONVERTFUNC_INIT
126 UWORD *src = (UWORD *)srcPixels;
127 ULONG *dst = (ULONG *)dstPixels;
128 ULONG x, y;
130 for(y = 0; y < height; y++)
132 for(x = 0; x < width; x++)
134 ULONG s = src[x];
136 dst[x] = UPSHIFT16(s, RGB15, ABGR32);
138 src = (UWORD *)(((UBYTE *)src) + srcMod);
139 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
142 return 1;
144 CONVERTFUNC_EXIT
147 CONVERTFUNC(RGB15,RGB24) /* Untested */
149 CONVERTFUNC_INIT
151 UWORD *src = (UWORD *)srcPixels;
152 UBYTE *dst = (UBYTE *)dstPixels;
153 ULONG x, y;
155 for(y = 0; y < height; y++)
157 for(x = 0; x < width; x++)
159 ULONG s = src[x];
161 s = UPSHIFT16(s, RGB15, RGB24);
163 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
165 src = (UWORD *)(((UBYTE *)src) + srcMod);
166 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
169 return 1;
171 CONVERTFUNC_EXIT
174 CONVERTFUNC(RGB15,BGR24) /* Untested */
176 CONVERTFUNC_INIT
178 UWORD *src = (UWORD *)srcPixels;
179 UBYTE *dst = (UBYTE *)dstPixels;
180 ULONG x, y;
182 for(y = 0; y < height; y++)
184 for(x = 0; x < width; x++)
186 ULONG s = src[x];
188 s = UPSHIFT16(s, RGB15, BGR24);
190 PUT24(dst, COMP8(s, 1), COMP8(s, 2), COMP8(s, 3))
192 src = (UWORD *)(((UBYTE *)src) + srcMod);
193 dst = (UBYTE *)(((UBYTE *)dst) + dstMod);
196 return 1;
198 CONVERTFUNC_EXIT
201 CONVERTFUNC(RGB15,RGB16OE) /* Untested */
203 CONVERTFUNC_INIT
205 UWORD *src = (UWORD *)srcPixels;
206 UWORD *dst = (UWORD *)dstPixels;
207 ULONG x, y;
209 for(y = 0; y < height; y++)
211 for(x = 0; x < width; x++)
213 UWORD s = src[x];
215 s = ((s & (RGB15_RMASK | RGB15_GMASK)) << 1) | (s & RGB15_BMASK);
216 dst[x] = INV16(s);
218 src = (UWORD *)(((UBYTE *)src) + srcMod);
219 dst = (UWORD *)(((UBYTE *)dst) + dstMod);
222 return 1;
224 CONVERTFUNC_EXIT
227 CONVERTFUNC(RGB15,BGR16OE) /* Untested */
229 CONVERTFUNC_INIT
231 SWAP1516OECODE
233 CONVERTFUNC_EXIT
236 CONVERTFUNC(RGB15,BGR15OE) /* Untested */
238 CONVERTFUNC_INIT
240 SWAP1515OECODE
242 return 1;
244 CONVERTFUNC_EXIT
247 CONVERTFUNC(RGB15,RGB15OE) /* Untested */
249 CONVERTFUNC_INIT
251 SWAP16CODE
253 return 1;
255 CONVERTFUNC_EXIT
258 CONVERTFUNC(RGB15,XRGB32) /* Untested */
260 CONVERTFUNC_INIT
262 UWORD *src = (UWORD *)srcPixels;
263 ULONG *dst = (ULONG *)dstPixels;
264 ULONG x, y;
266 for(y = 0; y < height; y++)
268 for(x = 0; x < width; x++)
270 ULONG s = src[x];
272 dst[x] = UPSHIFT16(s, RGB15, ARGB32);
274 src = (UWORD *)(((UBYTE *)src) + srcMod);
275 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
278 return 1;
280 CONVERTFUNC_EXIT
283 CONVERTFUNC(RGB15,BGRX32) /* Untested */
285 CONVERTFUNC_INIT
287 UWORD *src = (UWORD *)srcPixels;
288 ULONG *dst = (ULONG *)dstPixels;
289 ULONG x, y;
291 for(y = 0; y < height; y++)
293 for(x = 0; x < width; x++)
295 ULONG s = src[x];
297 dst[x] = UPSHIFT16(s, RGB15, BGRA32);
299 src = (UWORD *)(((UBYTE *)src) + srcMod);
300 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
303 return 1;
305 CONVERTFUNC_EXIT
308 CONVERTFUNC(RGB15,RGBX32) /* Untested */
310 CONVERTFUNC_INIT
312 UWORD *src = (UWORD *)srcPixels;
313 ULONG *dst = (ULONG *)dstPixels;
314 ULONG x, y;
316 for(y = 0; y < height; y++)
318 for(x = 0; x < width; x++)
320 ULONG s = src[x];
322 dst[x] = UPSHIFT16(s, RGB15, RGBA32);
324 src = (UWORD *)(((UBYTE *)src) + srcMod);
325 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
328 return 1;
330 CONVERTFUNC_EXIT
334 CONVERTFUNC(RGB15,XBGR32) /* Untested */
336 CONVERTFUNC_INIT
338 UWORD *src = (UWORD *)srcPixels;
339 ULONG *dst = (ULONG *)dstPixels;
340 ULONG x, y;
342 for(y = 0; y < height; y++)
344 for(x = 0; x < width; x++)
346 ULONG s = src[x];
348 dst[x] = UPSHIFT16(s, RGB15, ABGR32);
350 src = (UWORD *)(((UBYTE *)src) + srcMod);
351 dst = (ULONG *)(((UBYTE *)dst) + dstMod);
354 return 1;
356 CONVERTFUNC_EXIT