Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygendib24bpp.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: Win32 subsystem 00003 * LICENSE: See COPYING in the top level directory 00004 * FILE: subsystems/win32/win32k/dib/dib24bpp.c 00005 * PURPOSE: Device Independant Bitmap functions, 24bpp 00006 * PROGRAMMERS: Jason Filby 00007 * Thomas Bluemel 00008 * Gregor Anich 00009 */ 00010 00011 #include <win32k.h> 00012 00013 #define NDEBUG 00014 #include <debug.h> 00015 00016 VOID 00017 DIB_24BPP_PutPixel(SURFOBJ *SurfObj, LONG x, LONG y, ULONG c) 00018 { 00019 PBYTE addr = (PBYTE)SurfObj->pvScan0 + (y * SurfObj->lDelta) + (x << 1) + x; 00020 *(PUSHORT)(addr) = c & 0xFFFF; 00021 *(addr + 2) = (c >> 16) & 0xFF; 00022 } 00023 00024 ULONG 00025 DIB_24BPP_GetPixel(SURFOBJ *SurfObj, LONG x, LONG y) 00026 { 00027 PBYTE addr = (PBYTE)SurfObj->pvScan0 + y * SurfObj->lDelta + (x << 1) + x; 00028 return *(PUSHORT)(addr) + (*(addr + 2) << 16); 00029 } 00030 00031 00032 00033 VOID 00034 DIB_24BPP_VLine(SURFOBJ *SurfObj, LONG x, LONG y1, LONG y2, ULONG c) 00035 { 00036 PBYTE addr = (PBYTE)SurfObj->pvScan0 + y1 * SurfObj->lDelta + (x << 1) + x; 00037 LONG lDelta = SurfObj->lDelta; 00038 00039 c &= 0xFFFFFF; 00040 while(y1++ < y2) 00041 { 00042 *(PUSHORT)(addr) = c & 0xFFFF; 00043 *(addr + 2) = (BYTE)(c >> 16); 00044 00045 addr += lDelta; 00046 } 00047 } 00048 00049 BOOLEAN 00050 DIB_24BPP_BitBltSrcCopy(PBLTINFO BltInfo) 00051 { 00052 LONG i, j, sx, sy, xColor, f1; 00053 PBYTE SourceBits, DestBits, SourceLine, DestLine; 00054 PBYTE SourceBits_4BPP, SourceLine_4BPP; 00055 PWORD SourceBits_16BPP, SourceLine_16BPP; 00056 00057 DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + (BltInfo->DestRect.top * BltInfo->DestSurface->lDelta) + BltInfo->DestRect.left * 3; 00058 00059 switch(BltInfo->SourceSurface->iBitmapFormat) 00060 { 00061 case BMF_1BPP: 00062 sx = BltInfo->SourcePoint.x; 00063 sy = BltInfo->SourcePoint.y; 00064 00065 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++) 00066 { 00067 sx = BltInfo->SourcePoint.x; 00068 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++) 00069 { 00070 if(DIB_1BPP_GetPixel(BltInfo->SourceSurface, sx, sy) == 0) 00071 { 00072 DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 0)); 00073 } else { 00074 DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 1)); 00075 } 00076 sx++; 00077 } 00078 sy++; 00079 } 00080 break; 00081 00082 case BMF_4BPP: 00083 SourceBits_4BPP = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + (BltInfo->SourcePoint.x >> 1); 00084 00085 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++) 00086 { 00087 SourceLine_4BPP = SourceBits_4BPP; 00088 DestLine = DestBits; 00089 sx = BltInfo->SourcePoint.x; 00090 f1 = sx & 1; 00091 00092 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++) 00093 { 00094 xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, 00095 (*SourceLine_4BPP & altnotmask[f1]) >> (4 * (1 - f1))); 00096 *DestLine++ = xColor & 0xff; 00097 *(PWORD)DestLine = (WORD)(xColor >> 8); 00098 DestLine += 2; 00099 if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; } 00100 sx++; 00101 } 00102 00103 SourceBits_4BPP += BltInfo->SourceSurface->lDelta; 00104 DestBits += BltInfo->DestSurface->lDelta; 00105 } 00106 break; 00107 00108 case BMF_8BPP: 00109 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + BltInfo->SourcePoint.x; 00110 DestLine = DestBits; 00111 00112 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++) 00113 { 00114 SourceBits = SourceLine; 00115 DestBits = DestLine; 00116 00117 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++) 00118 { 00119 xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceBits); 00120 *DestBits = xColor & 0xff; 00121 *(PWORD)(DestBits + 1) = (WORD)(xColor >> 8); 00122 SourceBits += 1; 00123 DestBits += 3; 00124 } 00125 00126 SourceLine += BltInfo->SourceSurface->lDelta; 00127 DestLine += BltInfo->DestSurface->lDelta; 00128 } 00129 break; 00130 00131 case BMF_16BPP: 00132 SourceBits_16BPP = (PWORD)((PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 2 * BltInfo->SourcePoint.x); 00133 00134 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++) 00135 { 00136 SourceLine_16BPP = SourceBits_16BPP; 00137 DestLine = DestBits; 00138 00139 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++) 00140 { 00141 xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *SourceLine_16BPP); 00142 *DestLine++ = xColor & 0xff; 00143 *(PWORD)DestLine = (WORD)(xColor >> 8); 00144 DestLine += 2; 00145 SourceLine_16BPP++; 00146 } 00147 00148 SourceBits_16BPP = (PWORD)((PBYTE)SourceBits_16BPP + BltInfo->SourceSurface->lDelta); 00149 DestBits += BltInfo->DestSurface->lDelta; 00150 } 00151 break; 00152 00153 case BMF_24BPP: 00154 if (NULL == BltInfo->XlateSourceToDest || 0 != (BltInfo->XlateSourceToDest->flXlate & XO_TRIVIAL)) 00155 { 00156 if (BltInfo->DestRect.top < BltInfo->SourcePoint.y) 00157 { 00158 SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x; 00159 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++) 00160 { 00161 RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left)); 00162 SourceBits += BltInfo->SourceSurface->lDelta; 00163 DestBits += BltInfo->DestSurface->lDelta; 00164 } 00165 } 00166 else 00167 { 00168 SourceBits = (PBYTE)BltInfo->SourceSurface->pvScan0 + ((BltInfo->SourcePoint.y + BltInfo->DestRect.bottom - BltInfo->DestRect.top - 1) * BltInfo->SourceSurface->lDelta) + 3 * BltInfo->SourcePoint.x; 00169 DestBits = (PBYTE)BltInfo->DestSurface->pvScan0 + ((BltInfo->DestRect.bottom - 1) * BltInfo->DestSurface->lDelta) + 3 * BltInfo->DestRect.left; 00170 for (j = BltInfo->DestRect.bottom - 1; BltInfo->DestRect.top <= j; j--) 00171 { 00172 RtlMoveMemory(DestBits, SourceBits, 3 * (BltInfo->DestRect.right - BltInfo->DestRect.left)); 00173 SourceBits -= BltInfo->SourceSurface->lDelta; 00174 DestBits -= BltInfo->DestSurface->lDelta; 00175 } 00176 } 00177 } 00178 else 00179 { 00180 sx = BltInfo->SourcePoint.x; 00181 sy = BltInfo->SourcePoint.y; 00182 00183 for (j=BltInfo->DestRect.top; j<BltInfo->DestRect.bottom; j++) 00184 { 00185 sx = BltInfo->SourcePoint.x; 00186 for (i=BltInfo->DestRect.left; i<BltInfo->DestRect.right; i++) 00187 { 00188 DWORD pixel = DIB_24BPP_GetPixel(BltInfo->SourceSurface, sx, sy); 00189 DIB_24BPP_PutPixel(BltInfo->DestSurface, i, j, XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, pixel)); 00190 sx++; 00191 } 00192 sy++; 00193 } 00194 } 00195 break; 00196 00197 case BMF_32BPP: 00198 SourceLine = (PBYTE)BltInfo->SourceSurface->pvScan0 + (BltInfo->SourcePoint.y * BltInfo->SourceSurface->lDelta) + 4 * BltInfo->SourcePoint.x; 00199 DestLine = DestBits; 00200 00201 for (j = BltInfo->DestRect.top; j < BltInfo->DestRect.bottom; j++) 00202 { 00203 SourceBits = SourceLine; 00204 DestBits = DestLine; 00205 00206 for (i = BltInfo->DestRect.left; i < BltInfo->DestRect.right; i++) 00207 { 00208 xColor = XLATEOBJ_iXlate(BltInfo->XlateSourceToDest, *((PDWORD) SourceBits)); 00209 *DestBits = xColor & 0xff; 00210 *(PWORD)(DestBits + 1) = (WORD)(xColor >> 8); 00211 SourceBits += 4; 00212 DestBits += 3; 00213 } 00214 00215 SourceLine += BltInfo->SourceSurface->lDelta; 00216 DestLine += BltInfo->DestSurface->lDelta; 00217 } 00218 break; 00219 00220 default: 00221 DbgPrint("DIB_24BPP_Bitblt: Unhandled Source BPP: %u\n", BitsPerFormat(BltInfo->SourceSurface->iBitmapFormat)); 00222 return FALSE; 00223 } 00224 00225 return TRUE; 00226 } 00227 00228 BOOLEAN 00229 DIB_24BPP_BitBlt(PBLTINFO BltInfo) 00230 { 00231 LONG DestX, DestY; 00232 LONG SourceX, SourceY; 00233 LONG PatternY = 0; 00234 ULONG Dest, Source = 0, Pattern = 0; 00235 BOOL UsesSource; 00236 BOOL UsesPattern; 00237 PBYTE DestBits; 00238 00239 UsesSource = ROP4_USES_SOURCE(BltInfo->Rop4); 00240 UsesPattern = ROP4_USES_PATTERN(BltInfo->Rop4); 00241 00242 SourceY = BltInfo->SourcePoint.y; 00243 DestBits = (PBYTE)( 00244 (PBYTE)BltInfo->DestSurface->pvScan0 + 00245 (BltInfo->DestRect.left << 1) + BltInfo->DestRect.left + 00246 BltInfo->DestRect.top * BltInfo->DestSurface->lDelta); 00247 00248 if (UsesPattern) 00249 { 00250 if (BltInfo->PatternSurface) 00251 { 00252 PatternY = (BltInfo->DestRect.top - BltInfo->BrushOrigin.y) % 00253 BltInfo->PatternSurface->sizlBitmap.cy; 00254 } 00255 else 00256 { 00257 if (BltInfo->Brush) 00258 Pattern = BltInfo->Brush->iSolidColor; 00259 } 00260 } 00261 00262 for (DestY = BltInfo->DestRect.top; DestY < BltInfo->DestRect.bottom; DestY++) 00263 { 00264 SourceX = BltInfo->SourcePoint.x; 00265 00266 for (DestX = BltInfo->DestRect.left; DestX < BltInfo->DestRect.right; DestX++, DestBits += 3, SourceX++) 00267 { 00268 Dest = *((PUSHORT)DestBits) + (*(DestBits + 2) << 16); 00269 00270 if (UsesSource) 00271 { 00272 Source = DIB_GetSource(BltInfo->SourceSurface, SourceX, SourceY, BltInfo->XlateSourceToDest); 00273 } 00274 00275 if (BltInfo->PatternSurface) 00276 { 00277 Pattern = DIB_GetSourceIndex(BltInfo->PatternSurface, (DestX - BltInfo->BrushOrigin.x) % BltInfo->PatternSurface->sizlBitmap.cx, PatternY); 00278 } 00279 00280 Dest = DIB_DoRop(BltInfo->Rop4, Dest, Source, Pattern) & 0xFFFFFF; 00281 *(PUSHORT)(DestBits) = Dest & 0xFFFF; 00282 *(DestBits + 2) = (BYTE)(Dest >> 16); 00283 } 00284 00285 SourceY++; 00286 if (BltInfo->PatternSurface) 00287 { 00288 PatternY++; 00289 PatternY %= BltInfo->PatternSurface->sizlBitmap.cy; 00290 } 00291 DestBits -= (BltInfo->DestRect.right - BltInfo->DestRect.left) * 3; 00292 DestBits += BltInfo->DestSurface->lDelta; 00293 } 00294 00295 return TRUE; 00296 } 00297 00298 /* BitBlt Optimize */ 00299 BOOLEAN 00300 DIB_24BPP_ColorFill(SURFOBJ* DestSurface, RECTL* DestRect, ULONG color) 00301 { 00302 LONG DestY; 00303 00304 #if defined(_M_IX86) && !defined(_MSC_VER) 00305 PBYTE xaddr = (PBYTE)DestSurface->pvScan0 + DestRect->top * DestSurface->lDelta + (DestRect->left << 1) + DestRect->left; 00306 PBYTE addr; 00307 ULONG Count; 00308 ULONG xCount=DestRect->right - DestRect->left; 00309 00310 for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) 00311 { 00312 Count = xCount; 00313 addr = xaddr; 00314 xaddr = (PBYTE)((ULONG_PTR)addr + DestSurface->lDelta); 00315 00316 if (Count < 8) 00317 { 00318 /* For small fills, don't bother doing anything fancy */ 00319 while (Count--) 00320 { 00321 *(PUSHORT)(addr) = color; 00322 addr += 2; 00323 *(addr) = color >> 16; 00324 addr += 1; 00325 } 00326 } 00327 else 00328 { 00329 /* Align to 4-byte address */ 00330 while (0 != ((ULONG_PTR) addr & 0x3)) 00331 { 00332 *(PUSHORT)(addr) = color; 00333 addr += 2; 00334 *(addr) = color >> 16; 00335 addr += 1; 00336 Count--; 00337 } 00338 /* If the color we need to fill with is 0ABC, then the final mem pattern 00339 * (note little-endianness) would be: 00340 * 00341 * |C.B.A|C.B.A|C.B.A|C.B.A| <- pixel borders 00342 * |C.B.A.C|B.A.C.B|A.C.B.A| <- ULONG borders 00343 * 00344 * So, taking endianness into account again, we need to fill with these 00345 * ULONGs: CABC BCAB ABCA */ 00346 00347 /* This is about 30% faster than the generic C code below */ 00348 __asm__ __volatile__ ( 00349 "movl %1, %%ecx\n\t" 00350 "andl $0xffffff, %%ecx\n\t" /* 0ABC */ 00351 "movl %%ecx, %%ebx\n\t" /* Construct BCAB in ebx */ 00352 "shrl $8, %%ebx\n\t" 00353 "movl %%ecx, %%eax\n\t" 00354 "shll $16, %%eax\n\t" 00355 "orl %%eax, %%ebx\n\t" 00356 "movl %%ecx, %%edx\n\t" /* Construct ABCA in edx */ 00357 "shll $8, %%edx\n\t" 00358 "movl %%ecx, %%eax\n\t" 00359 "shrl $16, %%eax\n\t" 00360 "orl %%eax, %%edx\n\t" 00361 "movl %%ecx, %%eax\n\t" /* Construct CABC in eax */ 00362 "shll $24, %%eax\n\t" 00363 "orl %%ecx, %%eax\n\t" 00364 "movl %2, %%ecx\n\t" /* Load count */ 00365 "shr $2, %%ecx\n\t" 00366 "movl %3, %%edi\n" /* Load dest */ 00367 "1:\n\t" 00368 "movl %%eax, (%%edi)\n\t" /* Store 4 pixels, 12 bytes */ 00369 "movl %%ebx, 4(%%edi)\n\t" 00370 "movl %%edx, 8(%%edi)\n\t" 00371 "addl $12, %%edi\n\t" 00372 "dec %%ecx\n\t" 00373 "jnz 1b\n\t" 00374 "movl %%edi, %0" 00375 : "=m"(addr) 00376 : "m"(color), "m"(Count), "m"(addr) 00377 : "%eax", "%ebx", "%ecx", "%edx", "%edi"); 00378 Count = Count & 0x03; 00379 while (0 != Count--) 00380 { 00381 *(PUSHORT)(addr) = color; 00382 addr += 2; 00383 *(addr) = color >> 16; 00384 addr += 1; 00385 } 00386 } 00387 } 00388 #else 00389 00390 for (DestY = DestRect->top; DestY< DestRect->bottom; DestY++) 00391 { 00392 DIB_24BPP_HLine(DestSurface, DestRect->left, DestRect->right, DestY, color); 00393 } 00394 #endif 00395 return TRUE; 00396 } 00397 00398 BOOLEAN 00399 DIB_24BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, 00400 RECTL* DestRect, RECTL *SourceRect, 00401 XLATEOBJ *ColorTranslation, ULONG iTransColor) 00402 { 00403 LONG X, Y, SourceX, SourceY = 0, wd; 00404 ULONG Source = 0, Dest; 00405 BYTE *DestBits; 00406 00407 LONG DstHeight; 00408 LONG DstWidth; 00409 LONG SrcHeight; 00410 LONG SrcWidth; 00411 00412 DstHeight = DestRect->bottom - DestRect->top; 00413 DstWidth = DestRect->right - DestRect->left; 00414 SrcHeight = SourceRect->bottom - SourceRect->top; 00415 SrcWidth = SourceRect->right - SourceRect->left; 00416 00417 DestBits = (BYTE*)((PBYTE)DestSurf->pvScan0 + 00418 (DestRect->left * 3) + 00419 DestRect->top * DestSurf->lDelta); 00420 wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) * 3); 00421 00422 for(Y = DestRect->top; Y < DestRect->bottom; Y++) 00423 { 00424 SourceY = SourceRect->top+(Y - DestRect->top) * SrcHeight / DstHeight; 00425 for(X = DestRect->left; X < DestRect->right; X++, DestBits += 3) 00426 { 00427 SourceX = SourceRect->left+(X - DestRect->left) * SrcWidth / DstWidth; 00428 if (SourceX >= 0 && SourceY >= 0 && 00429 SourceSurf->sizlBitmap.cx > SourceX && SourceSurf->sizlBitmap.cy > SourceY) 00430 { 00431 Source = DIB_GetSourceIndex(SourceSurf, SourceX, SourceY); 00432 if(Source != iTransColor) 00433 { 00434 Dest = (BYTE)XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFFFFFF; 00435 *(PUSHORT)(DestBits) = Dest & 0xFFFF; 00436 *(DestBits + 2) = (BYTE)(Dest >> 16); 00437 } 00438 } 00439 } 00440 00441 DestBits = (BYTE*)((ULONG_PTR)DestBits + wd); 00442 } 00443 00444 return TRUE; 00445 } 00446 00447 typedef union { 00448 ULONG ul; 00449 struct { 00450 UCHAR red; 00451 UCHAR green; 00452 UCHAR blue; 00453 UCHAR alpha; 00454 } col; 00455 } NICEPIXEL32; 00456 00457 static __inline UCHAR 00458 Clamp8(ULONG val) 00459 { 00460 return (val > 255) ? 255 : (UCHAR)val; 00461 } 00462 00463 BOOLEAN 00464 DIB_24BPP_AlphaBlend(SURFOBJ* Dest, SURFOBJ* Source, RECTL* DestRect, 00465 RECTL* SourceRect, CLIPOBJ* ClipRegion, 00466 XLATEOBJ* ColorTranslation, BLENDOBJ* BlendObj) 00467 { 00468 INT Rows, Cols, SrcX, SrcY; 00469 register PUCHAR Dst; 00470 BLENDFUNCTION BlendFunc; 00471 register NICEPIXEL32 DstPixel, SrcPixel; 00472 UCHAR Alpha; 00473 //UCHAR SrcBpp; 00474 00475 DPRINT("DIB_24BPP_AlphaBlend: srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", 00476 SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, 00477 DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); 00478 00479 BlendFunc = BlendObj->BlendFunction; 00480 if (BlendFunc.BlendOp != AC_SRC_OVER) 00481 { 00482 DPRINT1("BlendOp != AC_SRC_OVER\n"); 00483 return FALSE; 00484 } 00485 if (BlendFunc.BlendFlags != 0) 00486 { 00487 DPRINT1("BlendFlags != 0\n"); 00488 return FALSE; 00489 } 00490 if ((BlendFunc.AlphaFormat & ~AC_SRC_ALPHA) != 0) 00491 { 00492 DPRINT1("Unsupported AlphaFormat (0x%x)\n", BlendFunc.AlphaFormat); 00493 return FALSE; 00494 } 00495 if ((BlendFunc.AlphaFormat & AC_SRC_ALPHA) != 0 && 00496 BitsPerFormat(Source->iBitmapFormat) != 32) 00497 { 00498 DPRINT1("Source bitmap must be 32bpp when AC_SRC_ALPHA is set\n"); 00499 return FALSE; 00500 } 00501 00502 Dst = (PUCHAR)((ULONG_PTR)Dest->pvScan0 + (DestRect->top * Dest->lDelta) + 00503 (DestRect->left * 3)); 00504 //SrcBpp = BitsPerFormat(Source->iBitmapFormat); 00505 00506 Rows = 0; 00507 SrcY = SourceRect->top; 00508 while (++Rows <= DestRect->bottom - DestRect->top) 00509 { 00510 Cols = 0; 00511 SrcX = SourceRect->left; 00512 while (++Cols <= DestRect->right - DestRect->left) 00513 { 00514 SrcPixel.ul = DIB_GetSource(Source, SrcX, SrcY, ColorTranslation); 00515 SrcPixel.col.red = (SrcPixel.col.red * BlendFunc.SourceConstantAlpha) / 255; 00516 SrcPixel.col.green = (SrcPixel.col.green * BlendFunc.SourceConstantAlpha) / 255; 00517 SrcPixel.col.blue = (SrcPixel.col.blue * BlendFunc.SourceConstantAlpha) / 255; 00518 if (!(BlendFunc.AlphaFormat & AC_SRC_ALPHA)) 00519 { 00520 Alpha = BlendFunc.SourceConstantAlpha ; 00521 } 00522 else 00523 { 00524 Alpha = (SrcPixel.col.alpha * BlendFunc.SourceConstantAlpha) / 255; 00525 } 00526 00527 DstPixel.col.red = Clamp8((*Dst * (255 - Alpha)) / 255 + SrcPixel.col.red) ; 00528 DstPixel.col.green = Clamp8((*(Dst+1) * (255 - Alpha) / 255 + SrcPixel.col.green)) ; 00529 DstPixel.col.blue = Clamp8((*(Dst+2) * (255 - Alpha)) / 255 + SrcPixel.col.blue) ; 00530 *Dst++ = DstPixel.col.red; 00531 *Dst++ = DstPixel.col.green; 00532 *Dst++ = DstPixel.col.blue; 00533 SrcX = SourceRect->left + (Cols*(SourceRect->right - SourceRect->left))/(DestRect->right - DestRect->left); 00534 } 00535 Dst = (PUCHAR)((ULONG_PTR)Dest->pvScan0 + ((DestRect->top + Rows) * Dest->lDelta) + 00536 (DestRect->left*3)); 00537 SrcY = SourceRect->top + (Rows*(SourceRect->bottom - SourceRect->top))/(DestRect->bottom - DestRect->top); 00538 } 00539 00540 return TRUE; 00541 } 00542 00543 /* EOF */ Generated on Sun May 27 2012 04:38:15 for ReactOS by
1.7.6.1
|