codec/color: support for 16bpp color pointer

This commit is contained in:
Norbert Federa 2015-06-11 13:12:21 +02:00
parent e8d41c8516
commit 86d398f0a3
1 changed files with 11 additions and 1 deletions

View File

@ -1512,7 +1512,7 @@ int freerdp_image_copy_from_pointer_data(BYTE* pDstData, UINT32 DstFormat, int n
return 1;
}
else if (xorBpp == 24 || xorBpp == 32)
else if (xorBpp == 24 || xorBpp == 32 || xorBpp == 16)
{
int xorBytesPerPixel = xorBpp >> 3;
xorStep = nWidth * xorBytesPerPixel;
@ -1536,9 +1536,19 @@ int freerdp_image_copy_from_pointer_data(BYTE* pDstData, UINT32 DstFormat, int n
for (x = 0; x < nWidth; x++)
{
if (xorBpp == 32)
{
xorPixel = *((UINT32*) xorBits);
}
else if (xorBpp == 16)
{
UINT16 r, g, b;
GetRGB16(r, g, b, *(UINT16*)xorBits);
xorPixel = ARGB32(0xFF, r, g, b);
}
else
{
xorPixel = xorBits[0] | xorBits[1] << 8 | xorBits[2] << 16 | 0xFF << 24;
}
xorBits += xorBytesPerPixel;