? BITMAP_PIXEL_FORMAT_RGB565 : BITMAP_PIXEL_FORMAT_ARGB8888;
r = pBitmap->Construct(*pByteBuffer.get(), dim, pixelFormat, bufferScaling);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, null,r, "pBmp->Construct:%s", GetErrorMessage(r));
+
+ // Set transparency in case of rgb565 format
+ if (pixelFormat == BITMAP_PIXEL_FORMAT_RGB565)
+ {
+ short rgb565Chroma = 0;
+ Boolean transparency(false);
+ Integer chromaKey(0);
+ byte red = 0;
+ byte green = 0;
+ byte blue = 0;
+ Color *pMaskingColor = null;
+
+ r = __pGifDecoder->GetValue(L"transparency", transparency);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, pBitmap.release(), E_SUCCESS, "[%s] Propagated.", GetErrorMessage(r));
+ if (transparency.ToBool() == true)
+ {
+ r = __pGifDecoder->GetValue(L"chromaKey", chromaKey);
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, pBitmap.release(), E_SUCCESS, "[%s] Propagated.", GetErrorMessage(r));
+
+ rgb565Chroma = chromaKey.ToShort();
+ red = (rgb565Chroma & 0xf800) >> 8;
+ red = red | (red >> 5);
+ green = (rgb565Chroma & 0x07e0) >> 3;
+ green = green | (green >> 6);
+ blue = (rgb565Chroma & 0x001f) << 3;
+ blue = blue | (blue >> 5);
+
+ pMaskingColor = new Color(red, green, blue);
+ SysTryReturn(NID_MEDIA, pMaskingColor != null, pBitmap.release(), E_SUCCESS,
+ "[%s] Could not apply masking color.", GetErrorMessage(r));
+ r = pBitmap->SetMaskingColor(pMaskingColor);
+ delete pMaskingColor;
+ SysTryReturn(NID_MEDIA, r == E_SUCCESS, pBitmap.release(), E_SUCCESS,
+ "[%s] Could not set masking color.", GetErrorMessage(r));
+ }
+ }
}
SetLastResult(E_SUCCESS);
return pBitmap.release();
Tizen::Graphics::Rectangle transformRegion;
int orientationInfo = 0;
Boolean transparency(false);
- Integer chromaKey;
+ Integer chromaKey(0);
r = dec.Construct(srcImageBuf);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Decoder construct failed.", GetErrorMessage(r));
}
else
{
- __maskColor = chromaKey.ToInt();
+ __maskColor = chromaKey.value;
}
}
}
}
else
{
- __maskColor = chromaKey.ToInt();
+ __maskColor = chromaKey.value;
}
}
}
}
else
{
- __maskColor = chromaKey.ToInt();
+ __maskColor = chromaKey.value;
}
}
}
std::unique_ptr<byte[]> pDstBuf;
Tizen::Graphics::Rectangle transformRegion;
Boolean transparency(false);
- Integer chromaKey;
+ Integer chromaKey(0);
r = dec.Construct(srcImageBuf);
SysTryReturn(NID_MEDIA, r == E_SUCCESS, r, r, "[%s] Decoder construct failed.", GetErrorMessage(r));
}
else
{
- __maskColor = chromaKey.ToInt();
+ __maskColor = chromaKey.value;
}
}
}