Vincent Povirk : windowscodecs: Implement GetSize for BMP decoder.

Alexandre Julliard julliard at winehq.org
Mon Jun 29 09:17:48 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Jun 24 16:20:29 2009 -0500

windowscodecs: Implement GetSize for BMP decoder.

---

 dlls/windowscodecs/bmpdecode.c |   29 +++++++++++++++++++++++++++--
 1 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c
index 5ab8121..7db5dfb 100644
--- a/dlls/windowscodecs/bmpdecode.c
+++ b/dlls/windowscodecs/bmpdecode.c
@@ -116,11 +116,36 @@ static ULONG WINAPI BmpFrameDecode_Release(IWICBitmapFrameDecode *iface)
     return ref;
 }
 
+static HRESULT BmpHeader_GetSize(BITMAPV5HEADER *bih, UINT *puiWidth, UINT *puiHeight)
+{
+    switch (bih->bV5Size)
+    {
+    case sizeof(BITMAPCOREHEADER):
+    {
+        BITMAPCOREHEADER *bch = (BITMAPCOREHEADER*)bih;
+        *puiWidth = bch->bcWidth;
+        *puiHeight = bch->bcHeight;
+        return S_OK;
+    }
+    case sizeof(BITMAPCOREHEADER2):
+    case sizeof(BITMAPINFOHEADER):
+    case sizeof(BITMAPV4HEADER):
+    case sizeof(BITMAPV5HEADER):
+        *puiWidth = bih->bV5Width;
+        *puiHeight = bih->bV5Height;
+        return S_OK;
+    default:
+        return E_FAIL;
+    }
+}
+
 static HRESULT WINAPI BmpFrameDecode_GetSize(IWICBitmapFrameDecode *iface,
     UINT *puiWidth, UINT *puiHeight)
 {
-    FIXME("(%p,%p,%p): stub\n", iface, puiWidth, puiHeight);
-    return E_NOTIMPL;
+    BmpFrameDecode *This = (BmpFrameDecode*)iface;
+    TRACE("(%p,%p,%p)\n", iface, puiWidth, puiHeight);
+
+    return BmpHeader_GetSize(&This->bih, puiWidth, puiHeight);
 }
 
 static HRESULT WINAPI BmpFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,




More information about the wine-cvs mailing list