Merge branch 'master' of github.com:awakecoding/FreeRDP

This commit is contained in:
Marc-André Moreau 2014-10-14 15:24:36 -04:00
commit 8268c805b5
2 changed files with 82 additions and 0 deletions

View File

@ -2448,7 +2448,83 @@ int freerdp_image24_copy(BYTE* pDstData, DWORD DstFormat, int nDstStep, int nXDs
}
else if (dstBytesPerPixel == 3)
{
BYTE* pSrcPixel;
BYTE* pDstPixel;
if (!invert)
{
if (!vFlip)
{
pSrcPixel = &pSrcData[(nYSrc * nSrcStep) + (nXSrc * 3)];
pDstPixel = &pDstData[(nYDst * nDstStep) + (nXDst * 3)];
for (y = 0; y < nHeight; y++)
{
CopyMemory(pDstPixel, pSrcPixel, nWidth * 3);
pSrcPixel = &pSrcPixel[nSrcStep];
pDstPixel = &pDstPixel[nDstStep];
}
}
else
{
pSrcPixel = &pSrcData[((nYSrc + nHeight - 1) * nSrcStep) + (nXSrc * 3)];
pDstPixel = &pDstData[(nYDst * nDstStep) + (nXDst * 3)];
for (y = 0; y < nHeight; y++)
{
CopyMemory(pDstPixel, pSrcPixel, nWidth * 3);
pSrcPixel = &pSrcPixel[-nSrcStep];
pDstPixel = &pDstPixel[nDstStep];
}
}
}
else
{
if (!vFlip)
{
pSrcPixel = &pSrcData[(nYSrc * nSrcStep) + (nXSrc * 3)];
pDstPixel = &pDstData[(nYDst * nDstStep) + (nXDst * 3)];
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
pDstPixel[0] = pSrcPixel[2];
pDstPixel[1] = pSrcPixel[1];
pDstPixel[2] = pSrcPixel[0];
pSrcPixel += 3;
pDstPixel += 3;
}
pSrcPixel = &pSrcPixel[nSrcPad];
pDstPixel = &pDstPixel[nDstPad];
}
}
else
{
pSrcPixel = &pSrcData[((nYSrc + nHeight - 1) * nSrcStep) + (nXSrc * 3)];
pDstPixel = &pDstData[(nYDst * nDstStep) + (nXDst * 3)];
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
pDstPixel[0] = pSrcPixel[2];
pDstPixel[1] = pSrcPixel[1];
pDstPixel[2] = pSrcPixel[0];
pSrcPixel += 3;
pDstPixel += 3;
}
pSrcPixel = &pSrcPixel[-((nSrcStep - nSrcPad) + nSrcStep)];
pDstPixel = &pDstPixel[nDstPad];
}
}
}
return 1;
}
else if (dstBytesPerPixel == 2)
{

View File

@ -265,11 +265,13 @@ int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcDa
SrcFormat = PIXEL_FORMAT_RGB24_VF;
#if 0
if ((SrcFormat == DstFormat) && !nXDst && !nYDst && (scanline == nDstStep))
{
RleDecompress24to24(pSrcData, SrcSize, pDstData, scanline, nWidth, nHeight);
return 1;
}
#endif
if (BufferSize > interleaved->TempSize)
{
@ -292,11 +294,13 @@ int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcDa
SrcFormat = (bpp == 16) ? PIXEL_FORMAT_RGB16_VF : PIXEL_FORMAT_RGB15_VF;
#if 0
if ((SrcFormat == DstFormat) && !nXDst && !nYDst && (scanline == nDstStep))
{
RleDecompress16to16(pSrcData, SrcSize, pDstData, scanline, nWidth, nHeight);
return 1;
}
#endif
if (BufferSize > interleaved->TempSize)
{
@ -319,11 +323,13 @@ int interleaved_decompress(BITMAP_INTERLEAVED_CONTEXT* interleaved, BYTE* pSrcDa
SrcFormat = PIXEL_FORMAT_RGB8_VF;
#if 0
if ((SrcFormat == DstFormat) && !nXDst && !nYDst && (scanline == nDstStep))
{
RleDecompress8to8(pSrcData, SrcSize, pDstData, scanline, nWidth, nHeight);
return 1;
}
#endif
if (BufferSize > interleaved->TempSize)
{