libfreerdp-codec: return ARGB32/ABGR32 for dstBpp 32 with alpha

This commit is contained in:
Jean-Louis Dupond 2012-10-11 00:07:56 +02:00
parent ddf495a79f
commit 8b70615b30
1 changed files with 24 additions and 3 deletions

View File

@ -426,7 +426,14 @@ BYTE* freerdp_image_convert_8bpp(BYTE* srcData, BYTE* dstData, int width, int he
red = clrconv->palette->entries[pixel].red; red = clrconv->palette->entries[pixel].red;
green = clrconv->palette->entries[pixel].green; green = clrconv->palette->entries[pixel].green;
blue = clrconv->palette->entries[pixel].blue; blue = clrconv->palette->entries[pixel].blue;
if (clrconv->alpha)
{
pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue);
}
else
{
pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue);
}
*dst32 = pixel; *dst32 = pixel;
dst32++; dst32++;
} }
@ -468,7 +475,14 @@ BYTE* freerdp_image_convert_15bpp(BYTE* srcData, BYTE* dstData, int width, int h
pixel = *src16; pixel = *src16;
src16++; src16++;
GetBGR15(red, green, blue, pixel); GetBGR15(red, green, blue, pixel);
if (clrconv->alpha)
{
pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue);
}
else
{
pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue);
}
*dst32 = pixel; *dst32 = pixel;
dst32++; dst32++;
} }
@ -582,7 +596,14 @@ BYTE* freerdp_image_convert_16bpp(BYTE* srcData, BYTE* dstData, int width, int h
pixel = *src16; pixel = *src16;
src16++; src16++;
GetBGR16(red, green, blue, pixel); GetBGR16(red, green, blue, pixel);
if (clrconv->alpha)
{
pixel = (clrconv->invert) ? ARGB32(0xFF, red, green, blue) : ABGR32(0xFF, red, green, blue);
}
else
{
pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue); pixel = (clrconv->invert) ? RGB32(red, green, blue) : BGR32(red, green, blue);
}
*dst32 = pixel; *dst32 = pixel;
dst32++; dst32++;
} }