Vincent Povirk : windowscodecs: Support more formats in the BMP encoder.

Alexandre Julliard julliard at winehq.org
Fri Oct 9 09:24:14 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Wed Sep 23 13:26:25 2009 -0500

windowscodecs: Support more formats in the BMP encoder.

---

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

diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
index abe9977..b79a19b 100644
--- a/dlls/windowscodecs/bmpencode.c
+++ b/dlls/windowscodecs/bmpencode.c
@@ -47,6 +47,13 @@ struct bmp_pixelformat {
 
 static const struct bmp_pixelformat formats[] = {
     {&GUID_WICPixelFormat24bppBGR, 24, BI_RGB},
+    {&GUID_WICPixelFormat16bppBGR555, 16, BI_RGB},
+    {&GUID_WICPixelFormat16bppBGR565, 16, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0},
+    {&GUID_WICPixelFormat32bppBGR, 32, BI_RGB},
+#if 0
+    /* Windows doesn't seem to support this one. */
+    {&GUID_WICPixelFormat32bppBGRA, 32, BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000},
+#endif
     {NULL}
 };
 
@@ -338,6 +345,19 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface)
     bih.bV5ClrUsed = 0;
     bih.bV5ClrImportant = 0;
 
+    if (This->format->compression == BI_BITFIELDS)
+    {
+        if (This->format->alphamask)
+            bih.bV5Size = info_size = sizeof(BITMAPV4HEADER);
+        else
+            info_size = sizeof(BITMAPINFOHEADER)+12;
+        bih.bV5RedMask = This->format->redmask;
+        bih.bV5GreenMask = This->format->greenmask;
+        bih.bV5BlueMask = This->format->bluemask;
+        bih.bV5AlphaMask = This->format->alphamask;
+        bih.bV5AlphaMask = LCS_DEVICE_RGB;
+    }
+
     bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage;
     bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size;
 




More information about the wine-cvs mailing list