Fixed PNG transparent issue of RGB565 decoding
authorJungYumin <y_m.jung@samsung.com>
Tue, 25 Jun 2013 06:27:19 +0000 (15:27 +0900)
committerJungYumin <y_m.jung@samsung.com>
Tue, 25 Jun 2013 07:12:32 +0000 (16:12 +0900)
Change-Id: I5f37c7b78d5426789a4617664a1734709660f46e
Signed-off-by: JungYumin <y_m.jung@samsung.com>
src/FMedia_ImageBufferImpl.cpp

index e280ddc..72b063f 100644 (file)
@@ -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));