Dmitry Timoshkov : windowscodecs: Add support for 16bppGray and 32bppGrayFloat formats to TIFF decoder.

Alexandre Julliard julliard at winehq.org
Tue Apr 21 15:59:47 CDT 2020


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

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Tue Apr 21 12:01:57 2020 +0800

windowscodecs: Add support for 16bppGray and 32bppGrayFloat formats to TIFF decoder.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/windowscodecs/regsvr.c     |  2 ++
 dlls/windowscodecs/tiffformat.c | 22 ++++++++++++++++++++--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c
index 2c053bc5e4..c15daf2022 100644
--- a/dlls/windowscodecs/regsvr.c
+++ b/dlls/windowscodecs/regsvr.c
@@ -1223,6 +1223,8 @@ static GUID const * const tiff_decode_formats[] = {
     &GUID_WICPixelFormatBlackWhite,
     &GUID_WICPixelFormat4bppGray,
     &GUID_WICPixelFormat8bppGray,
+    &GUID_WICPixelFormat16bppGray,
+    &GUID_WICPixelFormat32bppGrayFloat,
     &GUID_WICPixelFormat1bppIndexed,
     &GUID_WICPixelFormat2bppIndexed,
     &GUID_WICPixelFormat4bppIndexed,
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
index a4c441e706..7354781eed 100644
--- a/dlls/windowscodecs/tiffformat.c
+++ b/dlls/windowscodecs/tiffformat.c
@@ -319,6 +319,8 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
     }
     decode_info->planar = planar;
 
+    TRACE("planar %u, photometric %u, samples %u, bps %u\n", planar, photometric, samples, bps);
+
     switch(photometric)
     {
     case 0: /* WhiteIsZero */
@@ -383,9 +385,25 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info)
                 }
             }
             break;
+        case 16:
+            if (samples != 1)
+            {
+                FIXME("unhandled 16bpp grayscale sample count %u\n", samples);
+                return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT;
+            }
+            decode_info->format = &GUID_WICPixelFormat16bppGray;
+            break;
+        case 32:
+            if (samples != 1)
+            {
+                FIXME("unhandled 32bpp grayscale sample count %u\n", samples);
+                return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT;
+            }
+            decode_info->format = &GUID_WICPixelFormat32bppGrayFloat;
+            break;
         default:
-            FIXME("unhandled greyscale bit count %u\n", bps);
-            return E_FAIL;
+            WARN("unhandled greyscale bit count %u\n", bps);
+            return WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT;
         }
         break;
     case 2: /* RGB */




More information about the wine-cvs mailing list