Commit 8e694423 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Implement IWICBitmapFrameEncode::SetPalette in PNG encoder.

parent 961e1e68
......@@ -1363,6 +1363,8 @@ typedef struct PngEncoder {
BYTE *data;
UINT stride;
UINT passes;
WICColor palette[256];
UINT colors;
} PngEncoder;
static inline PngEncoder *impl_from_IWICBitmapEncoder(IWICBitmapEncoder *iface)
......@@ -1554,10 +1556,24 @@ static HRESULT WINAPI PngFrameEncode_SetColorContexts(IWICBitmapFrameEncode *ifa
}
static HRESULT WINAPI PngFrameEncode_SetPalette(IWICBitmapFrameEncode *iface,
IWICPalette *pIPalette)
IWICPalette *palette)
{
FIXME("(%p,%p): stub\n", iface, pIPalette);
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
PngEncoder *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 PngFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface,
......@@ -2081,6 +2097,7 @@ HRESULT PngEncoder_CreateInstance(REFIID iid, void** ppv)
This->frame_committed = FALSE;
This->committed = FALSE;
This->data = NULL;
This->colors = 0;
InitializeCriticalSection(&This->lock);
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PngEncoder.lock");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment