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 19d57982ecb4520453a1b77ace386c625312e265.
This commit is contained in:
@@ -1,62 +0,0 @@
|
||||
From 69942a5f16dff9ea123fd9e8819cde00c7fbf3ae Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sun, 16 Oct 2016 17:32:48 +0800
|
||||
Subject: windowscodecs: Implement IWICBitmapFrameEncode::SetPalette in JPEG
|
||||
encoder,
|
||||
|
||||
---
|
||||
dlls/windowscodecs/jpegformat.c | 23 ++++++++++++++++++++---
|
||||
1 file changed, 20 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
|
||||
index b7998be..9ec64e7 100644
|
||||
--- a/dlls/windowscodecs/jpegformat.c
|
||||
+++ b/dlls/windowscodecs/jpegformat.c
|
||||
@@ -861,6 +861,8 @@ typedef struct JpegEncoder {
|
||||
double xres, yres;
|
||||
const jpeg_compress_format *format;
|
||||
IStream *stream;
|
||||
+ WICColor palette[256];
|
||||
+ UINT colors;
|
||||
CRITICAL_SECTION lock;
|
||||
BYTE dest_buffer[1024];
|
||||
} JpegEncoder;
|
||||
@@ -1063,10 +1065,24 @@ static HRESULT WINAPI JpegEncoder_Frame_SetColorContexts(IWICBitmapFrameEncode *
|
||||
}
|
||||
|
||||
static HRESULT WINAPI JpegEncoder_Frame_SetPalette(IWICBitmapFrameEncode *iface,
|
||||
- IWICPalette *pIPalette)
|
||||
+ IWICPalette *palette)
|
||||
{
|
||||
- FIXME("(%p,%p): stub\n", iface, pIPalette);
|
||||
- return WINCODEC_ERR_UNSUPPORTEDOPERATION;
|
||||
+ JpegEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ TRACE("(%p,%p)\n", iface, palette);
|
||||
+
|
||||
+ if (!palette) return E_INVALIDARG;
|
||||
+
|
||||
+ EnterCriticalSection(&This->lock);
|
||||
+
|
||||
+ if (This->frame_initialized)
|
||||
+ hr = IWICPalette_GetColors(palette, 256, This->palette, &This->colors);
|
||||
+ else
|
||||
+ hr = WINCODEC_ERR_NOTINITIALIZED;
|
||||
+
|
||||
+ LeaveCriticalSection(&This->lock);
|
||||
+ return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI JpegEncoder_Frame_SetThumbnail(IWICBitmapFrameEncode *iface,
|
||||
@@ -1516,6 +1532,7 @@ HRESULT JpegEncoder_CreateInstance(REFIID iid, void** ppv)
|
||||
This->xres = This->yres = 0.0;
|
||||
This->format = NULL;
|
||||
This->stream = NULL;
|
||||
+ This->colors = 0;
|
||||
InitializeCriticalSection(&This->lock);
|
||||
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JpegEncoder.lock");
|
||||
|
||||
--
|
||||
2.9.0
|
||||
|
Reference in New Issue
Block a user