Optimze DIB32_bitblt for both DGB=0 and DGB=1
[reactos.git] / reactos / subsys / win32k / dib / dib1bpp.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 #include <w32k.h>
21
22 VOID
23 DIB_1BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c)
24 {
25 PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
26
27 if (0 == (c & 0x01))
28 *addr &= ~MASK1BPP(x);
29 else
30 *addr |= MASK1BPP(x);
31 }
32
33 ULONG
34 DIB_1BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y)
35 {
36 PBYTE addr = SurfObj->pvScan0 + y * SurfObj->lDelta + (x >> 3);
37
38 return (*addr & MASK1BPP(x) ? 1 : 0);
39 }
40
41 VOID
42 DIB_1BPP_HLine(SURFOBJ *SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
43 {
44 while(x1 < x2) {
45 DIB_1BPP_PutPixel(SurfObj, x1, y, c);
46 x1++;
47 }
48 }
49
50 VOID
51 DIB_1BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
52 {
53 while(y1 < y2) {
54 DIB_1BPP_PutPixel(SurfObj, x, y1, c);
55 y1++;
56 }
57 }
58
59 static
60 void
61 DIB_1BPP_BitBltSrcCopy_From1BPP (
62 SURFOBJ* DestSurf, SURFOBJ* SourceSurf,
63 PRECTL DestRect, POINTL *SourcePoint )
64 {
65 // the 'window' in this sense is the x-position that corresponds
66 // to the left-edge of the 8-pixel byte we are currently working with.
67 // dwx is current x-window, dwx2 is the 'last' window we need to process
68 int dwx, dwx2; // destination window x-position
69 int swx; // source window y-position
70
71 // left and right edges of source and dest rectangles
72 int dl = DestRect->left; // dest left
73 int dr = DestRect->right-1; // dest right (inclusive)
74 int sl = SourcePoint->x; // source left
75 int sr = sl + dr - dl; // source right (inclusive)
76
77 // which direction are we going?
78 int xinc;
79 int yinc;
80 int ySrcDelta, yDstDelta;
81
82 // following 4 variables are used for the y-sweep
83 int dy; // dest y
84 int dy1; // dest y start
85 int dy2; // dest y end
86 int sy1; // src y start
87
88 int shift;
89 BYTE srcmask, dstmask;
90
91 // 'd' and 's' are the dest & src buffer pointers that I use on my x-sweep
92 // 'pd' and 'ps' are the dest & src buffer pointers used on the inner y-sweep
93 PBYTE d, pd; // dest ptrs
94 PBYTE s, ps; // src ptrs
95
96 shift = (dl-sl)&7;
97
98 if ( DestRect->top <= SourcePoint->y )
99 {
100 // moving up ( scan top -> bottom )
101 dy1 = DestRect->top;
102 dy2 = DestRect->bottom - 1;
103 sy1 = SourcePoint->y;
104 yinc = 1;
105 ySrcDelta = SourceSurf->lDelta;
106 yDstDelta = DestSurf->lDelta;
107 }
108 else
109 {
110 // moving down ( scan bottom -> top )
111 dy1 = DestRect->bottom - 1;
112 dy2 = DestRect->top;
113 sy1 = SourcePoint->y + dy1 - dy2;
114 yinc = -1;
115 ySrcDelta = -SourceSurf->lDelta;
116 yDstDelta = -DestSurf->lDelta;
117 }
118 if ( DestRect->left <= SourcePoint->x )
119 {
120 // moving left ( scan left->right )
121 dwx = dl&~7;
122 swx = (sl-(dl&7))&~7;
123 dwx2 = dr&~7;
124 xinc = 1;
125 }
126 else
127 {
128 // moving right ( scan right->left )
129 dwx = dr&~7;
130 swx = (sr-(dr&7))&~7; //(sr-7)&~7; // we need the left edge of this block... thus the -7
131 dwx2 = dl&~7;
132 xinc = -1;
133 }
134 d = &(((PBYTE)DestSurf->pvScan0)[dy1*DestSurf->lDelta + (dwx>>3)]);
135 s = &(((PBYTE)SourceSurf->pvScan0)[sy1*SourceSurf->lDelta + (swx>>3)]);
136 for ( ;; )
137 {
138 dy = dy1;
139 pd = d;
140 ps = s;
141 srcmask = 0xff;
142 int dx = dwx; /* dest x for this pass */
143 if ( dwx < dl )
144 {
145 int diff = dl-dwx;
146 srcmask &= (1<<(8-diff))-1;
147 dx = dl;
148 }
149 if ( dwx+7 > dr )
150 {
151 int diff = dr-dwx+1;
152 srcmask &= ~((1<<(8-diff))-1);
153 }
154 dstmask = ~srcmask;
155
156 // we unfortunately *must* have 5 different versions of the inner
157 // loop to be certain we don't try to read from memory that is not
158 // needed and may in fact be invalid
159 if ( !shift )
160 {
161 for ( ;; )
162 {
163 *pd = (BYTE)((*pd & dstmask) | (*ps & srcmask));
164
165 // this *must* be here, because we could be going up *or* down...
166 if ( dy == dy2 )
167 break;
168 dy += yinc;
169 pd += yDstDelta;
170 ps += ySrcDelta;
171 }
172 }
173 else if ( !(0xFF00 & (srcmask<<shift) ) ) // check if ps[0] not needed...
174 {
175 for ( ;; )
176 {
177 *pd = (BYTE)((*pd & dstmask)
178 | ( ( ps[1] >> shift ) & srcmask ));
179
180 // this *must* be here, because we could be going up *or* down...
181 if ( dy == dy2 )
182 break;
183 dy += yinc;
184 pd += yDstDelta;
185 ps += ySrcDelta;
186 }
187 }
188 else if ( !(0xFF & (srcmask<<shift) ) ) // check if ps[1] not needed...
189 {
190 for ( ;; )
191 {
192 *pd = (*pd & dstmask)
193 | ( ( ps[0] << ( 8 - shift ) ) & srcmask );
194
195 // this *must* be here, because we could be going up *or* down...
196 if ( dy == dy2 )
197 break;
198 dy += yinc;
199 pd += yDstDelta;
200 ps += ySrcDelta;
201 }
202 }
203 else // both ps[0] and ps[1] are needed
204 {
205 for ( ;; )
206 {
207 *pd = (*pd & dstmask)
208 | ( ( ( (ps[1])|(ps[0]<<8) ) >> shift ) & srcmask );
209
210 // this *must* be here, because we could be going up *or* down...
211 if ( dy == dy2 )
212 break;
213 dy += yinc;
214 pd += yDstDelta;
215 ps += ySrcDelta;
216 }
217 }
218
219 // this *must* be here, because we could be going right *or* left...
220 if ( dwx == dwx2 )
221 break;
222 d += xinc;
223 s += xinc;
224 dwx += xinc<<3;
225 swx += xinc<<3;
226 }
227 }
228
229 BOOLEAN
230 DIB_1BPP_BitBltSrcCopy(PBLTINFO BltInfo)
231 {
232 LONG i, j, sx, sy = BltInfo->SourcePoint.y;
233
234 switch ( BltInfo->SourceSurface->iBitmapFormat )
235 {
236 case BMF_1BPP:
237 DIB_1BPP_BitBltSrcCopy_From1BPP ( BltInfo->DestSurface, BltInfo->SourceSurface, &BltInfo->DestRect, &BltInfo->SourcePoint );
238 break;
239
240 case BMF_4BPP:
241 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
242 {
243 sx = BltInfo->SourcePoint.x;
244 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
245 {
246 if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_4BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
247 {
248 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
249 } else {
250 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
251 }
252 sx++;
253 }
254 sy++;
255 }
256 break;
257
258 case BMF_8BPP:
259 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
260 {
261 sx = BltInfo->SourcePoint.x;
262 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
263 {
264 if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_8BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
265 {
266 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
267 } else {
268 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
269 }
270 sx++;
271 }
272 sy++;
273 }
274 break;
275
276 case BMF_16BPP:
277 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
278 {
279 sx = BltInfo->SourcePoint.x;
280 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
281 {
282 if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_16BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
283 {
284 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
285 } else {
286 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
287 }
288 sx++;
289 }
290 sy++;
291 }
292 break;
293
294 case BMF_24BPP:
295 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
296 {
297 sx = BltInfo->SourcePoint.x;
298 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
299 {
300 if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
301 {
302 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
303 } else {
304 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
305 }
306 sx++;
307 }
308 sy++;
309 }
310 break;
311
312 case BMF_32BPP:
313 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++)
314 {
315 sx = BltInfo->SourcePoint.x;
316 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++)
317 {
318 if(XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, DIB_32BPP_GetPixel(BltInfo->SourceSurface, sx, sy)) == 0)
319 {
320 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 0);
321 } else {
322 DIB_1BPP_PutPixel(BltInfo->DestSurface, i, j, 1);
323 }
324 sx++;
325 }
326 sy++;
327 }
328 break;
329
330 default:
331 DbgPrint("DIB_1BPP_BitBlt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat));
332 return FALSE;
333 }
334
335 return TRUE;
336 }
337
338 BOOLEAN
339 DIB_1BPP_BitBlt(PBLTINFO BltInfo)
340 {
341 ULONG DestX, DestY;
342 ULONG SourceX, SourceY;
343 ULONG PatternY = 0;
344 ULONG Dest, Source = 0, Pattern = 0;
345 ULONG Index;
346 BOOLEAN UsesSource;
347 BOOLEAN UsesPattern;
348 PULONG DestBits;
349 ULONG RoundedRight;
350 /* BYTE NoBits;*/
351
352 UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4);
353 UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4);
354
355 RoundedRight = BltInfo->DestRect.right -
356 ((BltInfo->DestRect.right - BltInfo->DestRect.left) & 31);
357 SourceY = BltInfo->SourcePoint.y;
358
359 if (UsesPattern)
360 {
361 if (BltInfo->PatternSurface)
362 {
363 PatternY = (BltInfo->DestRect.top + BltInfo->BrushOrigin.y) %
364 BltInfo->PatternSurface->sizlBitmap.cy;
365 }
366 else
367 {
368 /* FIXME: Shouldn't it be expanded? */
369 Pattern = BltInfo->Brush->iSolidColor;
370 }
371 }
372
373 for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++)
374 {
375 DestX = BltInfo->DestRect.left;
376 SourceX = BltInfo->SourcePoint.x;
377 DestBits = (PULONG)(
378 BltInfo->DestSurface->pvScan0 +
379 (BltInfo->DestRect.left >> 3) +
380 DestY * BltInfo->DestSurface->lDelta);
381
382 if (DestX & 31)
383 {
384 #if 0
385 /* FIXME: This case is completely untested!!! */
386
387 Dest = *((PBYTE)DestBits);
388 NoBits = 31 - (DestX & 31);
389
390 if (UsesSource)
391 {
392 Source = 0;
393 /* FIXME: This is incorrect! */
394 for (Index = 31 - NoBits; Index >= 0; Index++)
395 Source |= (DIB_GetSource(SourceSurf, SourceX + Index, SourceY, ColorTranslation) << (31 - Index));
396 }
397
398 if (BltInfo->PatternSurface)
399 {
400 Pattern = 0;
401 for (k = 31 - NoBits; k >= 0; k++)
402 Pattern |= (DIB_GetSource(PatternObj, (X + BrushOrigin.x + k) % PatternWidth, PatternY, BltInfo->XlatePatternToDest) << (31 - k));
403 }
404
405 Dest = DIB_DoRop(Rop4, Dest, Source, Pattern);
406 Dest &= ~((1 << (31 - NoBits)) - 1);
407 Dest |= *((PBYTE)DestBits) & ((1 << (31 - NoBits)) - 1);
408
409 *DestBits = Dest;
410
411 DestX += NoBits;
412 SourceX += NoBits;
413 #endif
414 }
415
416 for (; DestX < RoundedRight; DestX += 32, DestBits++, SourceX++)
417 {
418 Dest = *DestBits;
419
420 if (UsesSource)
421 {
422 Source = 0;
423 for (Index = 0; Index < 8; Index++)
424 {
425 Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index, SourceY, BltInfo->XlateSourceToDest) << (7 - Index);
426 Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 8, SourceY, BltInfo->XlateSourceToDest) << (8 + (7 - Index));
427 Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 16, SourceY, BltInfo->XlateSourceToDest) << (16 + (7 - Index));
428 Source |= DIB_GetSource(BltInfo->SourceSurface, SourceX + Index + 24, SourceY, BltInfo->XlateSourceToDest) << (24 + (7 - Index));
429 }
430 }
431
432 if (BltInfo->PatternSurface)
433 {
434 Pattern = 0;
435 for (Index = 0; Index < 8; Index++)
436 {
437 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (7 - Index);
438 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 8) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (8 + (7 - Index));
439 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 16) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (16 + (7 - Index));
440 Pattern |= DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x + Index + 24) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest) << (24 + (7 - Index));
441 }
442 }
443
444 *DestBits = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern);
445 }
446
447 if (DestX < BltInfo->DestRect.right)
448 {
449 // Dest = *DestBits;
450 for (; DestX < BltInfo->DestRect.right; DestX++, SourceX++)
451 {
452 // Dest = *DestBits;
453 Dest = DIB_1BPP_GetPixel(BltInfo->DestSurface, DestX, DestY);
454
455 if (UsesSource)
456 {
457 Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest);
458 }
459
460 if (BltInfo->PatternSurface)
461 {
462 Pattern = DIB_GetSource(BltInfo->PatternSurface, (DestX + BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY, BltInfo->XlatePatternToDest);
463 }
464
465 DIB_1BPP_PutPixel(BltInfo->DestSurface, DestX, DestY, DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xF);
466 // Dest >>= 1;
467 }
468 }
469
470 SourceY++;
471 if (BltInfo->PatternSurface)
472 {
473 PatternY++;
474 PatternY %= BltInfo->PatternSurface->sizlBitmap.cy;
475 }
476 }
477
478 return TRUE;
479 }
480
481 /* Optimze for bitBlt */
482 BOOLEAN
483 DIB_1BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color)
484 {
485 ULONG DestY;
486
487 for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++)
488 {
489 DIB_1BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color);
490 }
491
492 return TRUE;
493 }
494
495 //NOTE: If you change something here, please do the same in other dibXXbpp.c files!
496 BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
497 RECTL* DestRect, RECTL *SourceRect,
498 POINTL* MaskOrigin, POINTL BrushOrigin,
499 CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
500 ULONG Mode)
501 {
502 int SrcSizeY;
503 int SrcSizeX;
504 int DesSizeY;
505 int DesSizeX;
506 int sx;
507 int sy;
508 int DesX;
509 int DesY;
510 int color;
511 int zoomX;
512 int zoomY;
513 int count;
514 int saveX;
515 int saveY;
516 BOOLEAN DesIsBiggerY=FALSE;
517
518 SrcSizeY = SourceRect->bottom;
519 SrcSizeX = SourceRect->right;
520
521 DesSizeY = DestRect->bottom;
522 DesSizeX = DestRect->right;
523
524 zoomX = DesSizeX / SrcSizeX;
525 if (zoomX==0) zoomX=1;
526
527 zoomY = DesSizeY / SrcSizeY;
528 if (zoomY==0) zoomY=1;
529
530 if (DesSizeY>SrcSizeY)
531 DesIsBiggerY = TRUE;
532
533
534 switch(SourceSurf->iBitmapFormat)
535 {
536 case BMF_1BPP:
537 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
538 /* This is a reference implementation, it hasn't been optimized for speed */
539 if (zoomX>1)
540 {
541 /* Draw one Hline on X - Led to the Des Zoom In*/
542 if (DesSizeX>SrcSizeX)
543 {
544 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
545 {
546 if (DesIsBiggerY)
547 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
548 else
549 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
550
551 if (sy > SourceRect->bottom) break;
552
553 saveY = DesY+zoomY;
554
555 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
556 {
557 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
558
559 if (sx > SourceRect->right) break;
560
561 saveX = DesX + zoomX;
562
563 color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
564
565 for (count=DesY;count<saveY;count++)
566 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
567
568
569 }
570 }
571 }
572 else
573 {
574 /* Draw one Hline on X - Led to the Des Zoom Out*/
575
576 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
577 {
578 if (DesIsBiggerY)
579 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
580 else
581 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
582
583 if (sy > SourceRect->bottom) break;
584
585 saveY = DesY+zoomY;
586
587 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
588 {
589 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
590
591 if (sx > SourceRect->right) break;
592
593 saveX = DesX + zoomX;
594
595 color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
596
597 for (count=DesY;count<saveY;count++)
598 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
599
600
601 }
602 }
603 }
604 }
605 else
606 {
607
608 if (DesSizeX>SrcSizeX)
609 {
610 /* Draw one pixel on X - Led to the Des Zoom In*/
611 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
612 {
613 if (DesIsBiggerY)
614 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
615 else
616 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
617
618 if (sy > SourceRect->bottom) break;
619
620 saveY = DesY+zoomY;
621
622 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
623 {
624 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
625
626 if (sx > SourceRect->right) break;
627
628 color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
629
630 for (count=DesY;count<saveY;count++)
631 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
632
633 }
634 }
635 }
636 else
637 {
638 /* Draw one pixel on X - Led to the Des Zoom Out*/
639 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
640 {
641 if (DesIsBiggerY)
642 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
643 else
644 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
645
646 if (sy > SourceRect->bottom) break;
647
648 saveY = DesY+zoomY;
649
650 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
651 {
652 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
653
654 if (sx > SourceRect->right) break;
655
656 color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
657
658 for (count=DesY;count<saveY;count++)
659 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
660
661 }
662 }
663 }
664 }
665 break;
666
667 case BMF_4BPP:
668 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
669 /* This is a reference implementation, it hasn't been optimized for speed */
670 if (zoomX>1)
671 {
672 /* Draw one Hline on X - Led to the Des Zoom In*/
673 if (DesSizeX>SrcSizeX)
674 {
675 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
676 {
677 if (DesIsBiggerY)
678 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
679 else
680 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
681
682 if (sy > SourceRect->bottom) break;
683
684 saveY = DesY+zoomY;
685
686 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
687 {
688 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
689
690 if (sx > SourceRect->right) break;
691
692 color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
693
694 saveX = DesX + zoomX;
695 for (count=DesY;count<saveY;count++)
696 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
697 }
698 }
699 }
700 else
701 {
702 /* Draw one Hline on X - Led to the Des Zoom Out*/
703
704 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
705 {
706 if (DesIsBiggerY)
707 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
708 else
709 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
710
711 if (sy > SourceRect->bottom) break;
712
713 saveY = DesY+zoomY;
714
715 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
716 {
717 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
718
719 if (sx > SourceRect->right) break;
720
721 color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
722
723 saveX = DesX + zoomX;
724 for (count=DesY;count<saveY;count++)
725 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
726 }
727 }
728 }
729 }
730
731 else
732 {
733
734 if (DesSizeX>SrcSizeX)
735 {
736 /* Draw one pixel on X - Led to the Des Zoom In*/
737 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
738 {
739 if (DesIsBiggerY)
740 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
741 else
742 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
743
744 if (sy > SourceRect->bottom) break;
745
746 saveY = DesY+zoomY;
747
748 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
749 {
750 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
751
752 if (sx > SourceRect->right) break;
753
754 color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
755
756 for (count=DesY;count<saveY;count++)
757 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
758 }
759 }
760 }
761 else
762 {
763 /* Draw one pixel on X - Led to the Des Zoom Out*/
764 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
765 {
766 if (DesIsBiggerY)
767 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
768 else
769 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
770
771 if (sy > SourceRect->bottom) break;
772
773 saveY = DesY+zoomY;
774
775 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
776 {
777 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
778
779 if (sx > SourceRect->right) break;
780
781 color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
782
783 for (count=DesY;count<saveY;count++)
784 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
785 }
786 }
787 }
788 }
789 break;
790
791 case BMF_8BPP:
792 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
793 /* This is a reference implementation, it hasn't been optimized for speed */
794 if (zoomX>1)
795 {
796 /* Draw one Hline on X - Led to the Des Zoom In*/
797 if (DesSizeX>SrcSizeX)
798 {
799 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
800 {
801 if (DesIsBiggerY)
802 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
803 else
804 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
805
806 if (sy > SourceRect->bottom) break;
807
808 saveY = DesY+zoomY;
809
810 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
811 {
812 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
813
814 if (sx > SourceRect->right) break;
815
816 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
817
818 saveX = DesX + zoomX;
819 for (count=DesY;count<saveY;count++)
820 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
821 }
822 }
823 }
824 else
825 {
826 /* Draw one Hline on X - Led to the Des Zoom Out*/
827
828 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
829 {
830 if (DesIsBiggerY)
831 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
832 else
833 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
834
835 if (sy > SourceRect->bottom) break;
836
837 saveY = DesY+zoomY;
838
839 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
840 {
841 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
842
843 if (sx > SourceRect->right) break;
844
845 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
846
847 saveX = DesX + zoomX;
848 for (count=DesY;count<saveY;count++)
849 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
850 }
851 }
852 }
853 }
854
855 else
856 {
857
858 if (DesSizeX>SrcSizeX)
859 {
860 /* Draw one pixel on X - Led to the Des Zoom In*/
861 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
862 {
863 if (DesIsBiggerY)
864 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
865 else
866 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
867
868 if (sy > SourceRect->bottom) break;
869
870 saveY = DesY+zoomY;
871
872 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
873 {
874 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
875
876 if (sx > SourceRect->right) break;
877
878 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
879
880 for (count=DesY;count<saveY;count++)
881 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
882 }
883 }
884 }
885 else
886 {
887 /* Draw one pixel on X - Led to the Des Zoom Out*/
888 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
889 {
890 if (DesIsBiggerY)
891 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
892 else
893 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
894
895 if (sy > SourceRect->bottom) break;
896
897 saveY = DesY+zoomY;
898
899 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
900 {
901 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
902
903 if (sx > SourceRect->right) break;
904
905 color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
906
907 for (count=DesY;count<saveY;count++)
908 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
909 }
910 }
911 }
912 }
913 break;
914
915 case BMF_16BPP:
916 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
917 /* This is a reference implementation, it hasn't been optimized for speed */
918 if (zoomX>1)
919 {
920 /* Draw one Hline on X - Led to the Des Zoom In*/
921 if (DesSizeX>SrcSizeX)
922 {
923 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
924 {
925 if (DesIsBiggerY)
926 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
927 else
928 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
929
930 if (sy > SourceRect->bottom) break;
931
932 saveY = DesY+zoomY;
933
934 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
935 {
936 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
937
938 if (sx > SourceRect->right) break;
939
940 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
941
942 saveX = DesX + zoomX;
943 for (count=DesY;count<saveY;count++)
944 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
945 }
946 }
947 }
948 else
949 {
950 /* Draw one Hline on X - Led to the Des Zoom Out*/
951
952 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
953 {
954 if (DesIsBiggerY)
955 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
956 else
957 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
958
959 if (sy > SourceRect->bottom) break;
960
961 saveY = DesY+zoomY;
962
963 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
964 {
965 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
966
967 if (sx > SourceRect->right) break;
968
969 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
970
971 saveX = DesX + zoomX;
972 for (count=DesY;count<saveY;count++)
973 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
974 }
975 }
976 }
977 }
978
979 else
980 {
981
982 if (DesSizeX>SrcSizeX)
983 {
984 /* Draw one pixel on X - Led to the Des Zoom In*/
985 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
986 {
987 if (DesIsBiggerY)
988 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
989 else
990 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
991
992 if (sy > SourceRect->bottom) break;
993
994 saveY = DesY+zoomY;
995
996 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
997 {
998 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
999
1000 if (sx > SourceRect->right) break;
1001
1002 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
1003
1004 for (count=DesY;count<saveY;count++)
1005 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1006 }
1007 }
1008 }
1009 else
1010 {
1011 /* Draw one pixel on X - Led to the Des Zoom Out*/
1012 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1013 {
1014 if (DesIsBiggerY)
1015 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1016 else
1017 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1018
1019 if (sy > SourceRect->bottom) break;
1020
1021 saveY = DesY+zoomY;
1022
1023 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1024 {
1025 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1026
1027 if (sx > SourceRect->right) break;
1028
1029 color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
1030
1031 for (count=DesY;count<saveY;count++)
1032 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1033 }
1034 }
1035 }
1036 }
1037 break;
1038
1039 case BMF_24BPP:
1040 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
1041 /* This is a reference implementation, it hasn't been optimized for speed */
1042 if (zoomX>1)
1043 {
1044 /* Draw one Hline on X - Led to the Des Zoom In*/
1045 if (DesSizeX>SrcSizeX)
1046 {
1047 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1048 {
1049 if (DesIsBiggerY)
1050 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1051 else
1052 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1053
1054 if (sy > SourceRect->bottom) break;
1055
1056 saveY = DesY+zoomY;
1057
1058 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1059 {
1060 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1061
1062 if (sx > SourceRect->right) break;
1063
1064 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1065
1066 saveX = DesX + zoomX;
1067 for (count=DesY;count<saveY;count++)
1068 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
1069 }
1070 }
1071 }
1072 else
1073 {
1074 /* Draw one Hline on X - Led to the Des Zoom Out*/
1075
1076 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1077 {
1078 if (DesIsBiggerY)
1079 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1080 else
1081 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1082
1083 if (sy > SourceRect->bottom) break;
1084
1085 saveY = DesY+zoomY;
1086
1087 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1088 {
1089 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1090
1091 if (sx > SourceRect->right) break;
1092
1093 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1094
1095 saveX = DesX + zoomX;
1096 for (count=DesY;count<saveY;count++)
1097 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
1098 }
1099 }
1100 }
1101 }
1102
1103 else
1104 {
1105
1106 if (DesSizeX>SrcSizeX)
1107 {
1108 /* Draw one pixel on X - Led to the Des Zoom In*/
1109 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1110 {
1111 if (DesIsBiggerY)
1112 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1113 else
1114 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1115
1116 if (sy > SourceRect->bottom) break;
1117
1118 saveY = DesY+zoomY;
1119
1120 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1121 {
1122 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1123
1124 if (sx > SourceRect->right) break;
1125
1126 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1127
1128 for (count=DesY;count<saveY;count++)
1129 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1130 }
1131 }
1132 }
1133 else
1134 {
1135 /* Draw one pixel on X - Led to the Des Zoom Out*/
1136 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1137 {
1138 if (DesIsBiggerY)
1139 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1140 else
1141 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1142
1143 if (sy > SourceRect->bottom) break;
1144
1145 saveY = DesY+zoomY;
1146
1147 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1148 {
1149 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1150
1151 if (sx > SourceRect->right) break;
1152
1153 color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
1154
1155 for (count=DesY;count<saveY;count++)
1156 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1157 }
1158 }
1159 }
1160 }
1161 break;
1162
1163 case BMF_32BPP:
1164 /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
1165 /* This is a reference implementation, it hasn't been optimized for speed */
1166 if (zoomX>1)
1167 {
1168 /* Draw one Hline on X - Led to the Des Zoom In*/
1169 if (DesSizeX>SrcSizeX)
1170 {
1171 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1172 {
1173 if (DesIsBiggerY)
1174 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1175 else
1176 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1177
1178 if (sy > SourceRect->bottom) break;
1179
1180 saveY = DesY+zoomY;
1181
1182 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1183 {
1184 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1185
1186 if (sx > SourceRect->right) break;
1187
1188 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1189
1190 saveX = DesX + zoomX;
1191 for (count=DesY;count<saveY;count++)
1192 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
1193 }
1194 }
1195 }
1196 else
1197 {
1198 /* Draw one Hline on X - Led to the Des Zoom Out*/
1199
1200 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1201 {
1202 if (DesIsBiggerY)
1203 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1204 else
1205 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1206
1207 if (sy > SourceRect->bottom) break;
1208
1209 saveY = DesY+zoomY;
1210
1211 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1212 {
1213 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1214
1215 if (sx > SourceRect->right) break;
1216
1217 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1218
1219 saveX = DesX + zoomX;
1220 for (count=DesY;count<saveY;count++)
1221 DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
1222 }
1223 }
1224 }
1225 }
1226
1227 else
1228 {
1229
1230 if (DesSizeX>SrcSizeX)
1231 {
1232 /* Draw one pixel on X - Led to the Des Zoom In*/
1233 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1234 {
1235 if (DesIsBiggerY)
1236 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1237 else
1238 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1239
1240 if (sy > SourceRect->bottom) break;
1241
1242 saveY = DesY+zoomY;
1243
1244 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1245 {
1246 sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
1247
1248 if (sx > SourceRect->right) break;
1249
1250 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1251
1252 for (count=DesY;count<saveY;count++)
1253 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1254 }
1255 }
1256 }
1257 else
1258 {
1259 /* Draw one pixel on X - Led to the Des Zoom Out*/
1260 for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
1261 {
1262 if (DesIsBiggerY)
1263 sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
1264 else
1265 sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
1266
1267 if (sy > SourceRect->bottom) break;
1268
1269 saveY = DesY+zoomY;
1270
1271 for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
1272 {
1273 sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
1274
1275 if (sx > SourceRect->right) break;
1276
1277 color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
1278
1279 for (count=DesY;count<saveY;count++)
1280 DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
1281 }
1282 }
1283 }
1284 }
1285 break;
1286
1287 default:
1288 //DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
1289 return FALSE;
1290 }
1291
1292 return TRUE;
1293 }
1294
1295 BOOLEAN
1296 DIB_1BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
1297 RECTL* DestRect, POINTL *SourcePoint,
1298 XLATEOBJ *ColorTranslation, ULONG iTransColor)
1299 {
1300 return FALSE;
1301 }
1302
1303 /* EOF */