From a64400ec988ffc43f70eab3a0f868d00a484a083 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Wed, 20 Oct 2010 15:04:10 -0500 Subject: [PATCH] windowscodecs: Add support for 32-bit TGA images. --- dlls/windowscodecs/tgaformat.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index 9de35c2e3f2..e088bbc107f 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -517,6 +517,25 @@ static HRESULT WINAPI TgaDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *ifa case 24: memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID)); break; + case 32: + switch (attribute_type) + { + case ATTRIBUTE_NO_ALPHA: + case ATTRIBUTE_UNDEFINED: + case ATTRIBUTE_UNDEFINED_PRESERVE: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGR, sizeof(GUID)); + break; + case ATTRIBUTE_ALPHA: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGRA, sizeof(GUID)); + break; + case ATTRIBUTE_PALPHA: + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppPBGRA, sizeof(GUID)); + break; + default: + FIXME("Unhandled 32-bit attribute type %u\n", attribute_type); + return E_NOTIMPL; + } + break; default: FIXME("Unhandled truecolor depth %u\n", This->header.depth); return E_NOTIMPL;