From efbe1fc1e7e6e2e91fec490fb3aee675ef854ab0 Mon Sep 17 00:00:00 2001 From: JungYumin Date: Tue, 25 Jun 2013 15:27:19 +0900 Subject: [PATCH] Fixed PNG transparent issue of RGB565 decoding Change-Id: I5f37c7b78d5426789a4617664a1734709660f46e Signed-off-by: JungYumin --- src/FMedia_ImageBufferImpl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/FMedia_ImageBufferImpl.cpp b/src/FMedia_ImageBufferImpl.cpp index e280ddc..72b063f 100644 --- a/src/FMedia_ImageBufferImpl.cpp +++ b/src/FMedia_ImageBufferImpl.cpp @@ -887,6 +887,11 @@ _ImageBufferImpl::GetBitmapN(BitmapPixelFormat pixelFormat, const FloatDimension r = cvt.Construct(__pixelFormat, __width, __height, inPixelFormat, convertDim.width, convertDim.height); SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated.", GetErrorMessage(r)); + if (__pixelFormat == MEDIA_PIXEL_FORMAT_BGRA8888 && inPixelFormat == MEDIA_PIXEL_FORMAT_RGB565LE) + { + _ImageUtil::PremultiplyAlpha(pTmpByteBuffer->GetPointer(), __bufSize, MEDIA_PIXEL_FORMAT_BGRA8888); + } + pOutBuf.reset(cvt.ConvertN(*pTmpByteBuffer)); r = GetLastResult(); SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated.", GetErrorMessage(r)); @@ -956,6 +961,10 @@ _ImageBufferImpl::GetByteBufferN(MediaPixelFormat inPixelFormat) const inPixelFormat, __width, __height); SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated.", GetErrorMessage(r)); + if (__pixelFormat == MEDIA_PIXEL_FORMAT_BGRA8888 && inPixelFormat == MEDIA_PIXEL_FORMAT_RGB565LE) + { + _ImageUtil::PremultiplyAlpha(pTmpByteBuffer->GetPointer(), __bufSize, MEDIA_PIXEL_FORMAT_BGRA8888); + } pOutBuf.reset(cvt.ConvertN(*pTmpByteBuffer)); r = GetLastResult(); SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated.", GetErrorMessage(r)); -- 2.7.4