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;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
SourceBits_4BPP = SourceSurf->pvBits + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x;
|
sy = SourcePoint->y;
|
||||||
|
|
||||||
for (j=DestRect->top; j<DestRect->bottom; j++)
|
for (j=DestRect->top; j<DestRect->bottom; j++)
|
||||||
{
|
{
|
||||||
SourceLine_4BPP = SourceBits_4BPP;
|
|
||||||
DestLine = DestBits;
|
|
||||||
sx = SourcePoint->x;
|
sx = SourcePoint->x;
|
||||||
f1 = sx & 1;
|
|
||||||
f2 = DestRect->left & 1;
|
|
||||||
|
|
||||||
// FIXME: handle odd begin pixel
|
|
||||||
|
|
||||||
for (i=DestRect->left; i<DestRect->right; i++)
|
for (i=DestRect->left; i<DestRect->right; i++)
|
||||||
{
|
{
|
||||||
if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; }
|
DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)));
|
||||||
if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; *DestLine = *SourceLine_4BPP; }
|
|
||||||
sx++;
|
sx++;
|
||||||
}
|
}
|
||||||
|
sy++;
|
||||||
// FIXME: handle odd end pixel
|
|
||||||
|
|
||||||
SourceBits_4BPP += SourceSurf->lDelta;
|
|
||||||
DestBits += DestSurf->lDelta;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -232,6 +232,9 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj,
|
||||||
PALGDI *PalGDI;
|
PALGDI *PalGDI;
|
||||||
XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj);
|
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)
|
if(XlateObj->flXlate & XO_TRIVIAL)
|
||||||
{
|
{
|
||||||
return Color;
|
return Color;
|
||||||
|
|
Loading…
Reference in a new issue