Correct sizes if origin is not (0, 0)
[reactos.git] / reactos / subsys / 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 int SrcSizeY;
385 int SrcSizeX;
386 int DesSizeY;
387 int DesSizeX;
388 int sx;
389 int sy;
390 int DesX;
391 int DesY;
392 int color;
393 int zoomX;
394 int zoomY;
395 int count;
396 int saveX;
397 int saveY;
398 BOOLEAN DesIsBiggerY=FALSE;
399
400 SrcSizeY = SourceRect->bottom - SourceRect->top;
401 SrcSizeX = SourceRect->right - SourceRect->left;
402
403 DesSizeY = DestRect->bottom - DestRect->top;
404 DesSizeX = DestRect->right - DestRect->left;
405
406 zoomX = DesSizeX / SrcSizeX;
407 if (zoomX==0) zoomX=1;
408
409 zoomY = DesSizeY / SrcSizeY;
410 if (zoomY==0) zoomY=1;
411
412 if (DesSizeY>SrcSizeY)
413 DesIsBiggerY = TRUE;
414
415 switch(SourceSurf->iBitmapFormat)
416 {
417 case BMF_1BPP:
418 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
419 /* This is a reference implementation, it hasn't been optimized for speed */
420 if (zoomX>1)
421 {
422 /* Draw one Hline on X - Led to the Des Zoom In*/
423 if (DesSizeX>SrcSizeX)
424 {
425 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
426 {
427 if (DesIsBiggerY)
428 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
429 else
430 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
431
432 if (sy > SourceRect->bottom) break;
433
434 saveY = DesY+zoomY;
435
436 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
437 {
438 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
439
440 if (sx > SourceRect->right) break;
441
442 saveX = DesX + zoomX;
443
444 if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
445 for (count=DesY;count<saveY;count++)
446 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 0);
447 else
448 for (count=DesY;count<saveY;count++)
449 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 1);
450
451 }
452 }
453 }
454 else
455 {
456 /* Draw one Hline on X - Led to the Des Zoom Out*/
457
458 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
459 {
460 if (DesIsBiggerY)
461 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
462 else
463 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
464
465 if (sy > SourceRect->bottom) break;
466
467 saveY = DesY+zoomY;
468
469 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
470 {
471 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
472
473 if (sx > SourceRect->right) break;
474
475 saveX = DesX + zoomX;
476
477 if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
478 for (count=DesY;count<saveY;count++)
479 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 0);
480 else
481 for (count=DesY;count<saveY;count++)
482 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 1);
483
484 }
485 }
486 }
487 }
488 else
489 {
490
491 if (DesSizeX>SrcSizeX)
492 {
493 /* Draw one pixel on X - Led to the Des Zoom In*/
494 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
495 {
496 if (DesIsBiggerY)
497 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
498 else
499 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
500
501 if (sy > SourceRect->bottom) break;
502
503 saveY = DesY+zoomY;
504
505 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
506 {
507 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
508
509 if (sx > SourceRect->right) break;
510
511 if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
512 for (count=DesY;count<saveY;count++)
513 DIB_4BPP_PutPixel(DestSurf, DesX, count, 0);
514 else
515 for (count=DesY;count<saveY;count++)
516 DIB_4BPP_PutPixel(DestSurf, DesX, count, 1);
517
518
519 }
520 }
521 }
522 else
523 {
524 /* Draw one pixel on X - Led to the Des Zoom Out*/
525 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
526 {
527 if (DesIsBiggerY)
528 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
529 else
530 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
531
532 if (sy > SourceRect->bottom) break;
533
534 saveY = DesY+zoomY;
535
536 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
537 {
538 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
539
540 if (sx > SourceRect->right) break;
541
542 if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
543 for (count=DesY;count<saveY;count++)
544 DIB_4BPP_PutPixel(DestSurf, DesX, count, 0);
545 else
546 for (count=DesY;count<saveY;count++)
547 DIB_4BPP_PutPixel(DestSurf, DesX, count, 1);
548
549 }
550 }
551 }
552 }
553 break;
554
555 case BMF_4BPP:
556 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
557 /* This is a reference implementation, it hasn't been optimized for speed */
558 if (zoomX>1)
559 {
560 /* Draw one Hline on X - Led to the Des Zoom In*/
561 if (DesSizeX>SrcSizeX)
562 {
563 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
564 {
565 if (DesIsBiggerY)
566 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
567 else
568 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
569
570 if (sy > SourceRect->bottom) break;
571
572 saveY = DesY+zoomY;
573
574 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
575 {
576 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
577
578 if (sx > SourceRect->right) break;
579
580 color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
581
582 saveX = DesX + zoomX;
583 for (count=DesY;count<saveY;count++)
584 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
585 }
586 }
587 }
588 else
589 {
590 /* Draw one Hline on X - Led to the Des Zoom Out*/
591
592 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
593 {
594 if (DesIsBiggerY)
595 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
596 else
597 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
598
599 if (sy > SourceRect->bottom) break;
600
601 saveY = DesY+zoomY;
602
603 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
604 {
605 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
606
607 if (sx > SourceRect->right) break;
608
609 color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
610
611 saveX = DesX + zoomX;
612 for (count=DesY;count<saveY;count++)
613 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
614 }
615 }
616 }
617 }
618
619 else
620 {
621
622 if (DesSizeX>SrcSizeX)
623 {
624 /* Draw one pixel on X - Led to the Des Zoom In*/
625 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
626 {
627 if (DesIsBiggerY)
628 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
629 else
630 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
631
632 if (sy > SourceRect->bottom) break;
633
634 saveY = DesY+zoomY;
635
636 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
637 {
638 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
639
640 if (sx > SourceRect->right) break;
641
642 color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
643
644 for (count=DesY;count<saveY;count++)
645 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
646 }
647 }
648 }
649 else
650 {
651 /* Draw one pixel on X - Led to the Des Zoom Out*/
652 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
653 {
654 if (DesIsBiggerY)
655 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
656 else
657 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
658
659 if (sy > SourceRect->bottom) break;
660
661 saveY = DesY+zoomY;
662
663 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
664 {
665 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
666
667 if (sx > SourceRect->right) break;
668
669 color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
670
671 for (count=DesY;count<saveY;count++)
672 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
673 }
674 }
675 }
676 }
677 break;
678
679 case BMF_8BPP:
680 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
681 /* This is a reference implementation, it hasn't been optimized for speed */
682 if (zoomX>1)
683 {
684 /* Draw one Hline on X - Led to the Des Zoom In*/
685 if (DesSizeX>SrcSizeX)
686 {
687 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
688 {
689 if (DesIsBiggerY)
690 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
691 else
692 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
693
694 if (sy > SourceRect->bottom) break;
695
696 saveY = DesY+zoomY;
697
698 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
699 {
700 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
701
702 if (sx > SourceRect->right) break;
703
704 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
705
706 saveX = DesX + zoomX;
707 for (count=DesY;count<saveY;count++)
708 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
709 }
710 }
711 }
712 else
713 {
714 /* Draw one Hline on X - Led to the Des Zoom Out*/
715
716 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
717 {
718 if (DesIsBiggerY)
719 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
720 else
721 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
722
723 if (sy > SourceRect->bottom) break;
724
725 saveY = DesY+zoomY;
726
727 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
728 {
729 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
730
731 if (sx > SourceRect->right) break;
732
733 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
734
735 saveX = DesX + zoomX;
736 for (count=DesY;count<saveY;count++)
737 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
738 }
739 }
740 }
741 }
742
743 else
744 {
745
746 if (DesSizeX>SrcSizeX)
747 {
748 /* Draw one pixel on X - Led to the Des Zoom In*/
749 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
750 {
751 if (DesIsBiggerY)
752 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
753 else
754 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
755
756 if (sy > SourceRect->bottom) break;
757
758 saveY = DesY+zoomY;
759
760 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
761 {
762 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
763
764 if (sx > SourceRect->right) break;
765
766 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
767
768 for (count=DesY;count<saveY;count++)
769 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
770 }
771 }
772 }
773 else
774 {
775 /* Draw one pixel on X - Led to the Des Zoom Out*/
776 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
777 {
778 if (DesIsBiggerY)
779 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
780 else
781 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
782
783 if (sy > SourceRect->bottom) break;
784
785 saveY = DesY+zoomY;
786
787 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
788 {
789 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
790
791 if (sx > SourceRect->right) break;
792
793 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
794
795 for (count=DesY;count<saveY;count++)
796 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
797 }
798 }
799 }
800 }
801 break;
802
803 case BMF_16BPP:
804 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
805 /* This is a reference implementation, it hasn't been optimized for speed */
806 if (zoomX>1)
807 {
808 /* Draw one Hline on X - Led to the Des Zoom In*/
809 if (DesSizeX>SrcSizeX)
810 {
811 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
812 {
813 if (DesIsBiggerY)
814 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
815 else
816 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
817
818 if (sy > SourceRect->bottom) break;
819
820 saveY = DesY+zoomY;
821
822 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
823 {
824 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
825
826 if (sx > SourceRect->right) break;
827
828 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
829
830 saveX = DesX + zoomX;
831 for (count=DesY;count<saveY;count++)
832 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
833 }
834 }
835 }
836 else
837 {
838 /* Draw one Hline on X - Led to the Des Zoom Out*/
839
840 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
841 {
842 if (DesIsBiggerY)
843 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
844 else
845 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
846
847 if (sy > SourceRect->bottom) break;
848
849 saveY = DesY+zoomY;
850
851 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
852 {
853 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
854
855 if (sx > SourceRect->right) break;
856
857 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
858
859 saveX = DesX + zoomX;
860 for (count=DesY;count<saveY;count++)
861 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
862 }
863 }
864 }
865 }
866
867 else
868 {
869
870 if (DesSizeX>SrcSizeX)
871 {
872 /* Draw one pixel on X - Led to the Des Zoom In*/
873 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
874 {
875 if (DesIsBiggerY)
876 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
877 else
878 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
879
880 if (sy > SourceRect->bottom) break;
881
882 saveY = DesY+zoomY;
883
884 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
885 {
886 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
887
888 if (sx > SourceRect->right) break;
889
890 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
891
892 for (count=DesY;count<saveY;count++)
893 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
894 }
895 }
896 }
897 else
898 {
899 /* Draw one pixel on X - Led to the Des Zoom Out*/
900 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
901 {
902 if (DesIsBiggerY)
903 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
904 else
905 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
906
907 if (sy > SourceRect->bottom) break;
908
909 saveY = DesY+zoomY;
910
911 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
912 {
913 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
914
915 if (sx > SourceRect->right) break;
916
917 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
918
919 for (count=DesY;count<saveY;count++)
920 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
921 }
922 }
923 }
924 }
925 break;
926
927 case BMF_24BPP:
928 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
929 /* This is a reference implementation, it hasn't been optimized for speed */
930 if (zoomX>1)
931 {
932 /* Draw one Hline on X - Led to the Des Zoom In*/
933 if (DesSizeX>SrcSizeX)
934 {
935 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
936 {
937 if (DesIsBiggerY)
938 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
939 else
940 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
941
942 if (sy > SourceRect->bottom) break;
943
944 saveY = DesY+zoomY;
945
946 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
947 {
948 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
949
950 if (sx > SourceRect->right) break;
951
952 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
953
954 saveX = DesX + zoomX;
955 for (count=DesY;count<saveY;count++)
956 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
957 }
958 }
959 }
960 else
961 {
962 /* Draw one Hline on X - Led to the Des Zoom Out*/
963
964 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
965 {
966 if (DesIsBiggerY)
967 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
968 else
969 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
970
971 if (sy > SourceRect->bottom) break;
972
973 saveY = DesY+zoomY;
974
975 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
976 {
977 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
978
979 if (sx > SourceRect->right) break;
980
981 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
982
983 saveX = DesX + zoomX;
984 for (count=DesY;count<saveY;count++)
985 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
986 }
987 }
988 }
989 }
990
991 else
992 {
993
994 if (DesSizeX>SrcSizeX)
995 {
996 /* Draw one pixel on X - Led to the Des Zoom In*/
997 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
998 {
999 if (DesIsBiggerY)
1000 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1001 else
1002 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1003
1004 if (sy > SourceRect->bottom) break;
1005
1006 saveY = DesY+zoomY;
1007
1008 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1009 {
1010 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1011
1012 if (sx > SourceRect->right) break;
1013
1014 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1015
1016 for (count=DesY;count<saveY;count++)
1017 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
1018 }
1019 }
1020 }
1021 else
1022 {
1023 /* Draw one pixel on X - Led to the Des Zoom Out*/
1024 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1025 {
1026 if (DesIsBiggerY)
1027 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1028 else
1029 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1030
1031 if (sy > SourceRect->bottom) break;
1032
1033 saveY = DesY+zoomY;
1034
1035 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1036 {
1037 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1038
1039 if (sx > SourceRect->right) break;
1040
1041 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1042
1043 for (count=DesY;count<saveY;count++)
1044 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
1045 }
1046 }
1047 }
1048 }
1049 break;
1050
1051 case BMF_32BPP:
1052 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
1053 /* This is a reference implementation, it hasn't been optimized for speed */
1054 if (zoomX>1)
1055 {
1056 /* Draw one Hline on X - Led to the Des Zoom In*/
1057 if (DesSizeX>SrcSizeX)
1058 {
1059 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1060 {
1061 if (DesIsBiggerY)
1062 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1063 else
1064 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1065
1066 if (sy > SourceRect->bottom) break;
1067
1068 saveY = DesY+zoomY;
1069
1070 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1071 {
1072 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1073
1074 if (sx > SourceRect->right) break;
1075
1076 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1077
1078 saveX = DesX + zoomX;
1079 for (count=DesY;count<saveY;count++)
1080 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
1081 }
1082 }
1083 }
1084 else
1085 {
1086 /* Draw one Hline on X - Led to the Des Zoom Out*/
1087
1088 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1089 {
1090 if (DesIsBiggerY)
1091 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1092 else
1093 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1094
1095 if (sy > SourceRect->bottom) break;
1096
1097 saveY = DesY+zoomY;
1098
1099 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1100 {
1101 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1102
1103 if (sx > SourceRect->right) break;
1104
1105 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1106
1107 saveX = DesX + zoomX;
1108 for (count=DesY;count<saveY;count++)
1109 DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
1110 }
1111 }
1112 }
1113 }
1114
1115 else
1116 {
1117
1118 if (DesSizeX>SrcSizeX)
1119 {
1120 /* Draw one pixel on X - Led to the Des Zoom In*/
1121 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1122 {
1123 if (DesIsBiggerY)
1124 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1125 else
1126 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1127
1128 if (sy > SourceRect->bottom) break;
1129
1130 saveY = DesY+zoomY;
1131
1132 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1133 {
1134 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1135
1136 if (sx > SourceRect->right) break;
1137
1138 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1139
1140 for (count=DesY;count<saveY;count++)
1141 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
1142 }
1143 }
1144 }
1145 else
1146 {
1147 /* Draw one pixel on X - Led to the Des Zoom Out*/
1148 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1149 {
1150 if (DesIsBiggerY)
1151 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1152 else
1153 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1154
1155 if (sy > SourceRect->bottom) break;
1156
1157 saveY = DesY+zoomY;
1158
1159 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1160 {
1161 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1162
1163 if (sx > SourceRect->right) break;
1164
1165 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1166
1167 for (count=DesY;count<saveY;count++)
1168 DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
1169 }
1170 }
1171 }
1172 }
1173 break;
1174
1175
1176 default:
1177 //DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
1178 return FALSE;
1179 }
1180
1181 return TRUE;
1182 }
1183
1184 BOOLEAN
1185 DIB_4BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
1186 RECTL* DestRect, POINTL *SourcePoint,
1187 XLATEOBJ *ColorTranslation, ULONG iTransColor)
1188 {
1189 return FALSE;
1190 }
1191
1192 /* EOF */