Rebase against 812d03129dea53337367789bac8ab523b9fce21d

This commit is contained in:
Alistair Leslie-Hughes 2019-02-22 08:51:56 +11:00
parent 778998c66e
commit 38aa047cad
3 changed files with 8 additions and 89 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "c0cc126d579e078f2804112c14f0c18b38f68937"
echo "812d03129dea53337367789bac8ab523b9fce21d"
}
# Show version information
@ -6546,10 +6546,8 @@ fi
# |
if test "$enable_windowscodecs_JPEG_Decoder" -eq 1; then
patch_apply windowscodecs-JPEG_Decoder/0004-windowscodecs-Move-JPEG-frame-image-data-initializat.patch
patch_apply windowscodecs-JPEG_Decoder/0005-windowscodecs-Add-support-for-CMYK-to-BGR-conversion.patch
(
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Move JPEG frame image data initialization from Frame::CopyPixels to Decoder::Initialize.", 2 },';
printf '%s\n' '+ { "Dmitry Timoshkov", "windowscodecs: Add support for CMYK to BGR conversion.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,30 +1,17 @@
From 11fa0f222539e2dedaed99783ad6af4577eae250 Mon Sep 17 00:00:00 2001
From bbfed73428278d26bd202fb559a14c11ec923c63 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Fri, 18 Aug 2017 12:17:52 +0800
Subject: [PATCH 714/851] windowscodecs: Move JPEG frame image data
initialization from Frame::CopyPixels to Decoder::Initialize. (v2)
Subject: [PATCH] windowscodecs: Move JPEG frame image data initialization from
Frame::CopyPixels to Decoder::Initialize. (v2)
This is how PNG decoder does things, and it avoids image data corruption
in some cases (presumably when libjpeg reuses existing scanline data).
---
dlls/windowscodecs/converter.c | 1 +
dlls/windowscodecs/jpegformat.c | 152 ++++++++++++--------------------
2 files changed, 57 insertions(+), 96 deletions(-)
dlls/windowscodecs/jpegformat.c | 152 +++++++++++++++-------------------------
1 file changed, 56 insertions(+), 96 deletions(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index d23c26250c..39c926c5ca 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -30,6 +30,7 @@
#include "wincodecs_private.h"
+#include "wine/heap.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
index c846e6191c..3fb52661a8 100644
index 54f77a7..1df898f 100644
--- a/dlls/windowscodecs/jpegformat.c
+++ b/dlls/windowscodecs/jpegformat.c
@@ -50,6 +50,7 @@
@ -217,5 +204,5 @@ index c846e6191c..3fb52661a8 100644
}
--
2.19.1
1.9.1

View File

@ -1,66 +0,0 @@
From 042ed16cde1e29daecdeead7bbfbe876a2b5a067 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 17 Aug 2017 14:57:18 +0800
Subject: [PATCH] windowscodecs: Add support for CMYK to BGR conversion.
Content-Type: text/plain; charset=UTF-8
---
dlls/windowscodecs/converter.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c
index 5dccb70b1f..525e1838b8 100644
--- a/dlls/windowscodecs/converter.c
+++ b/dlls/windowscodecs/converter.c
@@ -1085,6 +1085,48 @@ static HRESULT copypixels_to_24bppBGR(struct FormatConverter *This, const WICRec
}
return S_OK;
+ case format_32bppCMYK:
+ if (prc)
+ {
+ BYTE *srcdata;
+ UINT srcstride, srcdatasize;
+
+ srcstride = 4 * prc->Width;
+ srcdatasize = srcstride * prc->Height;
+
+ srcdata = heap_alloc(srcdatasize);
+ if (!srcdata) return E_OUTOFMEMORY;
+
+ hr = IWICBitmapSource_CopyPixels(This->source, prc, srcstride, srcdatasize, srcdata);
+ if (SUCCEEDED(hr))
+ {
+ INT x, y;
+ BYTE *src = srcdata, *dst = pbBuffer;
+
+ for (y = 0; y < prc->Height; y++)
+ {
+ BYTE *cmyk = src;
+ BYTE *bgr = dst;
+
+ for (x = 0; x < prc->Width; x++)
+ {
+ BYTE c = cmyk[0], m = cmyk[1], y = cmyk[2], k = cmyk[3];
+ bgr[0] = (255 - y) * (255 - k) / 255; /* B */
+ bgr[1] = (255 - m) * (255 - k) / 255; /* G */
+ bgr[2] = (255 - c) * (255 - k) / 255; /* R */
+ cmyk += 4;
+ bgr += 3;
+ }
+ src += srcstride;
+ dst += cbStride;
+ }
+ }
+
+ heap_free(srcdata);
+ return hr;
+ }
+ return S_OK;
+
default:
FIXME("Unimplemented conversion path!\n");
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
--
2.16.2