mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Perform color translation for 4BPP to 4BPP DIBs
svn path=/trunk/; revision=3573
This commit is contained in:
parent
d166ac40b1
commit
dc908bafd1
2 changed files with 6 additions and 14 deletions
|
@ -87,29 +87,18 @@ BOOLEAN DIB_To_4BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
break;
|
||||
|
||||
case 4:
|
||||
SourceBits_4BPP = SourceSurf->pvBits + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x;
|
||||
sy = SourcePoint->y;
|
||||
|
||||
for (j=DestRect->top; j<DestRect->bottom; j++)
|
||||
{
|
||||
SourceLine_4BPP = SourceBits_4BPP;
|
||||
DestLine = DestBits;
|
||||
sx = SourcePoint->x;
|
||||
f1 = sx & 1;
|
||||
f2 = DestRect->left & 1;
|
||||
|
||||
// FIXME: handle odd begin pixel
|
||||
|
||||
for (i=DestRect->left; i<DestRect->right; i++)
|
||||
{
|
||||
if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
|
||||
if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; *DestLine = *SourceLine_4BPP; }
|
||||
DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)));
|
||||
sx++;
|
||||
}
|
||||
|
||||
// FIXME: handle odd end pixel
|
||||
|
||||
SourceBits_4BPP += SourceSurf->lDelta;
|
||||
DestBits += DestSurf->lDelta;
|
||||
sy++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -232,6 +232,9 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj,
|
|||
PALGDI *PalGDI;
|
||||
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
||||
|
||||
// Return the original color if there's no color translation object
|
||||
if(!XlateObj) return Color;
|
||||
|
||||
if(XlateObj->flXlate & XO_TRIVIAL)
|
||||
{
|
||||
return Color;
|
||||
|
|
Loading…
Reference in a new issue