__pixelFormat, __outDim.width, __outDim.height, scalingMethod);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, null, r, "[%s] Propagated.", GetErrorMessage(r));
+ if (__pDec->GetPixelFormat() == MEDIA_PIXEL_FORMAT_BGRA8888 && __pixelFormat == MEDIA_PIXEL_FORMAT_RGB565LE)
+ {
+ _ImageUtil::PremultiplyAlpha(pRawBuf.get(), rawLength, MEDIA_PIXEL_FORMAT_BGRA8888);
+ }
// Convert to output format
pOutBuf.reset(cvt.ConvertN(pRawBuf.get(), rawLength, outLength));
r = GetLastResult();
return E_SUCCESS;
}
+result
+_ImageUtil::PremultiplyAlpha(byte* data, int length, MediaPixelFormat pixelFormat)
+{
+ unsigned int *pPixel = (unsigned int*)data;
+ for (int i = 0; i < length / 4; i++)
+ {
+ unsigned int a = 1 + (*pPixel >> 24);
+ *pPixel = (*pPixel & 0xff000000) +
+ (((((*pPixel) >> 8) & 0xff) * a) & 0xff00) +
+ (((((*pPixel) & 0x00ff00ff) * a) >> 8) & 0x00ff00ff);
+ pPixel++;
+ }
+}
+
}} // Tizen::Media
float dstWidth, float dstHeight,
float &outWidth, float &outHeight);
+
+ static result PremultiplyAlpha(byte* data, int length, MediaPixelFormat pixelFormat);
+
private:
_ImageUtil();