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