You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Rebase against 812d03129dea53337367789bac8ab523b9fce21d
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user