{
UINT32 x = 0, y = 0;
UINT32 i;
- UINT32 SrcFormat = PIXEL_FORMAT_BGR24;
UINT32 pixelCount;
UINT32 nSrcStep;
UINT32 bitmapDataOffset;
for (i = 0; i < paletteCount; i++)
{
BYTE r, g, b;
- UINT32 color;
Stream_Read_UINT8(s, b);
Stream_Read_UINT8(s, g);
Stream_Read_UINT8(s, r);
- color = GetColor(SrcFormat, r, g, b, 0xFF);
- palette[i] = ConvertColor(color, SrcFormat, DstFormat, NULL);
+ palette[i] = GetColor(DstFormat, r, g, b, 0xFF);
}
pixelIndex = 0;
BYTE* pDstData, UINT32 DstFormat, UINT32 nDstStep,
UINT32 nXDst, UINT32 nYDst,
UINT32 nDstWidth, UINT32 nDstHeight,
- const gdiPalette* palette)
+ const gdiPalette* palette, BYTE** ppGlyphData)
{
UINT16 glyphIndex = 0;
+ if (ppGlyphData)
+ *ppGlyphData = NULL;
+
if ((glyphFlags & CLEARCODEC_FLAG_GLYPH_HIT) &&
!(glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX))
{
if (glyphFlags & CLEARCODEC_FLAG_GLYPH_INDEX)
{
- BYTE* glyphData;
- UINT32 nSrcStep;
+ const UINT32 bpp = GetBytesPerPixel(clear->format);
CLEAR_GLYPH_ENTRY* glyphEntry = &(clear->GlyphCache[glyphIndex]);
glyphEntry->count = nWidth * nHeight;
if (glyphEntry->count > glyphEntry->size)
{
- UINT32* tmp;
+ BYTE* tmp;
glyphEntry->size = glyphEntry->count;
- tmp = (UINT32*) realloc(glyphEntry->pixels, glyphEntry->size * 4);
+ tmp = realloc(glyphEntry->pixels, glyphEntry->size * bpp);
if (!tmp)
{
- WLog_ERR(TAG, "glyphEntry->pixels realloc %lu failed!", glyphEntry->size * 4);
+ WLog_ERR(TAG, "glyphEntry->pixels realloc %lu failed!", glyphEntry->size * bpp);
return FALSE;
}
return FALSE;
}
- glyphData = (BYTE*) glyphEntry->pixels;
- nSrcStep = nWidth * GetBytesPerPixel(clear->format);
+ if (ppGlyphData)
+ *ppGlyphData = glyphEntry->pixels;
- if (!convert_color(pDstData, nDstStep, DstFormat,
- nXDst, nYDst, nWidth, nHeight,
- glyphData, nSrcStep, clear->format,
- nDstWidth, nDstHeight, palette))
- return FALSE;
+ return TRUE;
}
return TRUE;
UINT32 bandsByteCount;
UINT32 subcodecByteCount;
wStream* s;
+ BYTE* glyphData = NULL;
if (!pDstData)
return -1002;
if (!clear_decompress_glyph_data(clear, s, glyphFlags, nWidth,
nHeight, pDstData, DstFormat,
nDstStep, nXDst, nYDst,
- nDstWidth, nDstHeight, palette))
+ nDstWidth, nDstHeight, palette, &glyphData))
{
WLog_ERR(TAG, "clear_decompress_glyph_data failed!");
goto fail;
}
}
+ if (glyphData)
+ {
+ if (!freerdp_image_copy(glyphData, clear->format, 0, 0, 0, nWidth, nHeight,
+ pDstData, DstFormat, nDstStep, nXDst, nYDst, palette,
+ FREERDP_FLIP_NONE))
+ goto fail;
+ }
+
finish:
rc = 0;
fail: