- Sync up Mm interface with WinLdr branch (introduce the concept of a memory type...
[reactos.git] / reactos / subsystems / win32 / win32k / dib / dib4bpp.c
1 /*
2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /* $Id$ */
20
21 #include <w32k.h>
22
23 #define NDEBUG
24 #include <debug.h>
25
26 VOID
27 DIB_4BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
28 {
29 PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
30 *addr = (*addr & notmask[x&1]) | (c << ((1-(x&1))<<2));
31 }
32
33 ULONG
34 DIB_4BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
35 {
36 PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x>>1) + y * SurfObj->lDelta;
37 return (*addr >> ((1-(x&1))<<2)) & 0x0f;
38 }
39
40 VOID
41 DIB_4BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
42 {
43 PBYTE addr = (PBYTE)SurfObj->pvScan0 + (x1>>1) + y * SurfObj->lDelta;
44 LONG cx = x1;
45
46 while(cx < x2) {
47 *addr = (*addr & notmask[x1&1]) | (c << ((1-(x1&1))<<2));
48 if((++x1 & 1) == 0)
49 ++addr;
50 ++cx;
51 }
52 }
53
54 VOID
55 DIB_4BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
56 {
57 PBYTE addr = SurfObj->pvScan0;
58 int lDelta = SurfObj->lDelta;
59
60 addr += (x>>1) + y1 * lDelta;
61 while(y1++ < y2) {
62 *addr = (*addr & notmask[x&1]) | (c << ((1-(x&1))<<2));
63 addr += lDelta;
64 }
65 }
66
67 BOOLEAN
68 DIB_4BPP_BitBltSrcCopy(PBLTINFO BltInfo)
69 {
70 LONG i, j, sx, sy, f2, xColor;
71 PBYTE SourceBits_24BPP, SourceLine_24BPP;
72 PBYTE DestBits, DestLine, SourceBits_8BPP, SourceLine_8BPP;
73 PBYTE SourceBits, SourceLine;
74
75 DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 +
76 (BltInfo->DestRect.left >> 1) +
77 BltInfo->DestRect.top * BltInfo->DestSurface->lDelta;
78
79 switch (BltInfo->SourceSurface->iBitmapFormat)
80 {
81 case BMF_1BPP:
82 sx = BltInfo->SourcePoint.x;
83 sy = BltInfo->SourcePoint.y;
84
85 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
86 {
87 sx = BltInfo->SourcePoint.x;
88 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
89 {
90 if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0)
91 {
92 DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0));
93 } else {
94 DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1));
95 }
96 sx++;
97 }
98 sy++;
99 }
100 break;
101
102 case BMF_4BPP:
103 sy = BltInfo->SourcePoint.y;
104
105 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
106 {
107 sx = BltInfo->SourcePoint.x;
108
109 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
110 {
111 if (NULL != BltInfo->XlateSourceToDest)
112 {
113 DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy)));
114 }
115 else
116 {
117 DIB_4BPP_PutPixel(BltInfo->DestSurface, i, j, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy));
118 }
119 sx++;
120 }
121 sy++;
122 }
123 break;
124
125 case BMF_8BPP:
126 SourceBits_8BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x;
127
128 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
129 {
130 SourceLine_8BPP = SourceBits_8BPP;
131 DestLine = DestBits;
132 f2 = BltInfo->DestRect.left & 1;
133
134 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
135 {
136 *DestLine = (*DestLine & notmask[f2]) |
137 ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_8BPP)) << ((4 * (1 - f2))));
138 if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
139 SourceLine_8BPP++;
140 }
141
142 SourceBits_8BPP += BltInfo->SourceSurface->lDelta;
143 DestBits += BltInfo->DestSurface->lDelta;
144 }
145 break;
146
147 case BMF_16BPP:
148 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x;
149 DestLine = DestBits;
150
151 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
152 {
153 SourceBits = SourceLine;
154 DestBits = DestLine;
155 f2 = BltInfo->DestRect.left & 1;
156
157 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
158 {
159 xColor = *((PWORD) SourceBits);
160 *DestBits = (*DestBits & notmask[f2]) |
161 ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
162 if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
163 SourceBits += 2;
164 }
165
166 SourceLine += BltInfo->SourceSurface->lDelta;
167 DestLine += BltInfo->DestSurface->lDelta;
168 }
169 break;
170
171 case BMF_24BPP:
172 SourceBits_24BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x * 3;
173
174 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
175 {
176 SourceLine_24BPP = SourceBits_24BPP;
177 DestLine = DestBits;
178 f2 = BltInfo->DestRect.left & 1;
179
180 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
181 {
182 xColor = (*(SourceLine_24BPP + 2) << 0x10) +
183 (*(SourceLine_24BPP + 1) << 0x08) +
184 (*(SourceLine_24BPP));
185 *DestLine = (*DestLine & notmask[f2]) |
186 ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
187 if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; }
188 SourceLine_24BPP+=3;
189 }
190
191 SourceBits_24BPP += BltInfo->SourceSurface->lDelta;
192 DestBits += BltInfo->DestSurface->lDelta;
193 }
194 break;
195
196 case BMF_32BPP:
197 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x;
198 DestLine = DestBits;
199
200 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++)
201 {
202 SourceBits = SourceLine;
203 DestBits = DestLine;
204 f2 = BltInfo->DestRect.left & 1;
205
206 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++)
207 {
208 xColor = *((PDWORD) SourceBits);
209 *DestBits = (*DestBits & notmask[f2]) |
210 ((XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, xColor)) << ((4 * (1 - f2))));
211 if(f2 == 1) { DestBits++; f2 = 0; } else { f2 = 1; }
212 SourceBits += 4;
213 }
214
215 SourceLine += BltInfo->SourceSurface->lDelta;
216 DestLine += BltInfo->DestSurface->lDelta;
217 }
218 break;
219
220 default:
221 DbgPrint("DIB_4BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
222 return FALSE;
223 }
224 return(TRUE);
225 }
226
227 BOOLEAN
228 DIB_4BPP_BitBlt(PBLTINFO BltInfo)
229 {
230 ULONG DestX, DestY;
231 ULONG SourceX, SourceY;
232 ULONG PatternY = 0;
233 ULONG Dest, Source = 0, Pattern = 0;
234 BOOLEAN UsesSource;
235 BOOLEAN UsesPattern;
236 PULONG DestBits;
237 LONG RoundedRight;
238 static const ULONG ExpandSolidColor[16] =
239 {
240 0x00000000 /* 0 */,
241 0x11111111 /* 1 */,
242 0x22222222 /* 2 */,
243 0x33333333 /* 3 */,
244 0x44444444 /* 4 */,
245 0x55555555 /* 5 */,
246 0x66666666 /* 6 */,
247 0x77777777 /* 7 */,
248 0x88888888 /* 8 */,
249 0x99999999 /* 9 */,
250 0xAAAAAAAA /* 10 */,
251 0xBBBBBBBB /* 11 */,
252 0xCCCCCCCC /* 12 */,
253 0xDDDDDDDD /* 13 */,
254 0xEEEEEEEE /* 14 */,
255 0xFFFFFFFF /* 15 */,
256 };
257
258 UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
259 UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
260
261 SourceY = BltInfo->SourcePoint.y;
262 RoundedRight = BltInfo->DestRect.right -
263 ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 0x7);
264
265 if (UsesPattern)
266 {
267 if (BltInfo->PatternSurface)
268 {
269 PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
270 BltInfo->PatternSurface->sizlBitmap.cy;
271 }
272 else
273 {
274 Pattern = ExpandSolidColor[BltInfo->Brush->iSolidColor];
275 }
276 }
277
278 for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
279 {
280 DestBits = (PULONG)(
281 (PBYTE)BltInfo->DestSurface->pvScan0 +
282 (BltInfo->DestRect.left >> 1) +
283 DestY * BltInfo->DestSurface->lDelta);
284 SourceX = BltInfo->SourcePoint.x;
285 DestX = BltInfo->DestRect.left;
286
287 if (DestX & 0x1)
288 {
289 Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
290
291 if (UsesSource)
292 {
293 Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
294 }
295
296 if (BltInfo->PatternSurface)
297 {
298 Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
299 }
300
301 DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
302
303 DestX++;
304 SourceX++;
305 DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
306 }
307
308 for (; DestX < RoundedRight; DestX += 8, SourceX += 8, DestBits++)
309 {
310 Dest = *DestBits;
311 if (UsesSource)
312 {
313 Source =
314 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 1, SourceY, BltInfo->XlateSourceToDest)) |
315 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 0, SourceY, BltInfo->XlateSourceToDest) << 4) |
316 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 3, SourceY, BltInfo->XlateSourceToDest) << 8) |
317 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 2, SourceY, BltInfo->XlateSourceToDest) << 12) |
318 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 5, SourceY, BltInfo->XlateSourceToDest) << 16) |
319 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 4, SourceY, BltInfo->XlateSourceToDest) << 20) |
320 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 7, SourceY, BltInfo->XlateSourceToDest) << 24) |
321 (DIB_GetSource(BltInfo->SourceSurface, SourceX + 6, SourceY, BltInfo->XlateSourceToDest) << 28);
322 }
323 if (BltInfo->PatternSurface)
324 {
325 Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 1) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
326 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 0) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 4;
327 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 3) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 8;
328 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 2) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 12;
329 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 5) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 16;
330 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 4) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 20;
331 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 7) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 24;
332 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + 6) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << 28;
333 }
334 *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
335 }
336
337 /* Process the rest of pixel on the line */
338 for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
339 {
340 Dest = DIB_4BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
341 if (UsesSource)
342 {
343 Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
344 }
345 if (BltInfo->PatternSurface)
346 {
347 Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
348 }
349 DIB_4BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
350 }
351
352 SourceY++;
353 if (BltInfo->PatternSurface)
354 {
355 PatternY++;
356 PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
357 }
358 }
359
360 return TRUE;
361 }
362
363 /* BitBlt Optimize */
364 BOOLEAN
365 DIB_4BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
366 {
367 ULONG DestY;
368
369 for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
370 {
371 DIB_4BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
372 }
373
374 return TRUE;
375 }
376
377 //NOTE: If you change something here, please do the same in other dibXXbpp.c files!
378 BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
379 RECTL* DestRect, RECTL *SourceRect,
380 POINTL* MaskOrigin, POINTL BrushOrigin,
381 CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
382 ULONG Mode)
383 {
384 LONG SrcSizeY;
385 LONG SrcSizeX;
386 LONG DesSizeY;
387 LONG DesSizeX;
388 LONG sx;
389 LONG sy;
390 LONG DesX;
391 LONG DesY;
392 LONG color;
393
394 SrcSizeY = SourceRect->bottom - SourceRect->top;
395 SrcSizeX = SourceRect->right - SourceRect->left;
396
397 DesSizeY = DestRect->bottom - DestRect->top;
398 DesSizeX = DestRect->right - DestRect->left;
399
400 switch(SourceSurf->iBitmapFormat)
401 {
402 case BMF_1BPP:
403 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
404 /* This is a reference implementation, it hasn't been optimized for speed */
405
406 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
407 {
408 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
409
410 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
411 {
412 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
413
414 if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
415 {
416 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
417 }
418 else
419 {
420 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
421 }
422 }
423 }
424
425 break;
426
427 case BMF_4BPP:
428 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
429 /* This is a reference implementation, it hasn't been optimized for speed */
430
431 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
432 {
433 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
434
435 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
436 {
437 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
438 color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
439 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
440 }
441 }
442 break;
443
444 case BMF_8BPP:
445 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
446 /* This is a reference implementation, it hasn't been optimized for speed */
447
448 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
449 {
450 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
451
452 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
453 {
454 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
455 color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
456 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
457 }
458 }
459 break;
460
461 case BMF_16BPP:
462 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
463 /* This is a reference implementation, it hasn't been optimized for speed */
464
465 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
466 {
467 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
468
469 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
470 {
471 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
472 color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
473 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
474 }
475 }
476 break;
477
478 case BMF_24BPP:
479 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
480 /* This is a reference implementation, it hasn't been optimized for speed */
481
482 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
483 {
484 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
485
486 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
487 {
488 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
489 color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
490 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
491 }
492 }
493 break;
494
495 case BMF_32BPP:
496 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
497 /* This is a reference implementation, it hasn't been optimized for speed */
498
499 for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++)
500 {
501 sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top;
502
503 for (DesX=DestRect->left; DesX<DestRect->right; DesX++)
504 {
505 sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left;
506 color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
507 DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
508 }
509 }
510 break;
511
512 default:
513 //DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
514 return FALSE;
515 }
516
517 return TRUE;
518 }
519
520 BOOLEAN
521 DIB_4BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
522 RECTL* DestRect, POINTL *SourcePoint,
523 XLATEOBJ *ColorTranslation, ULONG iTransColor)
524 {
525 return FALSE;
526 }
527
528 BOOLEAN
529 DIB_4BPP_AlphaBlend(SURFOBJ* Dest, SURFOBJ* Source, RECTL* DestRect,
530 RECTL* SourceRect, CLIPOBJ* ClipRegion,
531 XLATEOBJ* ColorTranslation, BLENDOBJ* BlendObj)
532 {
533 UNIMPLEMENTED;
534 return FALSE;
535 }
536
537 /* EOF */