Vincent Povirk : windowscodecs: Support 8-bit RGB (as opposed to BGR) bitfields bitmaps.

Alexandre Julliard julliard at winehq.org
Tue Jan 11 10:08:25 CST 2011


Module: wine
Branch: master
Commit: b00c2979cf1ef1e7780db7856641e4493586c1fd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b00c2979cf1ef1e7780db7856641e4493586c1fd

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Mon Jan 10 15:24:08 2011 -0600

windowscodecs: Support 8-bit RGB (as opposed to BGR) bitfields bitmaps.

---

 dlls/windowscodecs/bmpdecode.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c
index 5131f47..04e300d 100644
--- a/dlls/windowscodecs/bmpdecode.c
+++ b/dlls/windowscodecs/bmpdecode.c
@@ -399,6 +399,27 @@ fail:
     return hr;
 }
 
+static HRESULT BmpFrameDecode_ReadRGB8(BmpDecoder* This)
+{
+    HRESULT hr;
+    UINT width, height;
+
+    hr = IWICBitmapFrameDecode_GetSize((IWICBitmapFrameDecode*)&This->lpFrameVtbl, &width, &height);
+
+    if (SUCCEEDED(hr))
+    {
+        hr = BmpFrameDecode_ReadUncompressed(This);
+    }
+
+    if (SUCCEEDED(hr))
+    {
+        reverse_bgr8(This->bitsperpixel/8, This->imagedatastart,
+            width, height, This->stride);
+    }
+
+    return hr;
+}
+
 static HRESULT ReadByte(IStream *stream, BYTE *buffer, ULONG buffer_size,
     ULONG *cursor, ULONG *bytesread, BYTE *result)
 {
@@ -705,6 +726,7 @@ static const struct bitfields_format bitfields_formats[] = {
     {16,0xf800,0x7e0,0x1f,0,&GUID_WICPixelFormat16bppBGR565,BmpFrameDecode_ReadUncompressed},
     {32,0xff0000,0xff00,0xff,0,&GUID_WICPixelFormat32bppBGR,BmpFrameDecode_ReadUncompressed},
     {32,0xff0000,0xff00,0xff,0xff000000,&GUID_WICPixelFormat32bppBGRA,BmpFrameDecode_ReadUncompressed},
+    {32,0xff,0xff00,0xff0000,0,&GUID_WICPixelFormat32bppBGR,BmpFrameDecode_ReadRGB8},
     {0}
 };
 




More information about the wine-cvs mailing list