Fixed alpha channel for color formats without.

This commit is contained in:
Armin Novak 2017-01-23 09:26:56 +01:00
parent 6ceb574402
commit 00c32f62d3

View File

@ -250,18 +250,32 @@ static INLINE BOOL writeLine(BYTE** ppRgba, UINT32 DstFormat, UINT32 width, cons
*(*ppRgba)++ = *(*ppB)++;
*(*ppRgba)++ = *(*ppG)++;
*(*ppRgba)++ = *(*ppR)++;
*(*ppRgba)++ = *(*ppA)++;
*(*ppRgba)++ = 0xFF;
}
return TRUE;
default:
for (x = 0; x < width; x++)
if (ppA)
{
BYTE alpha = (ppA) ? *(*ppA)++ : 0xFF;
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
WriteColor(*ppRgba, DstFormat, color);
*ppRgba += GetBytesPerPixel(DstFormat);
for (x = 0; x < width; x++)
{
BYTE alpha = *(*ppA)++;
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
WriteColor(*ppRgba, DstFormat, color);
*ppRgba += GetBytesPerPixel(DstFormat);
}
}
else
{
const BYTE alpha = 0xFF;
for (x = 0; x < width; x++)
{
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
WriteColor(*ppRgba, DstFormat, color);
*ppRgba += GetBytesPerPixel(DstFormat);
}
}
return TRUE;