windowscodecs: Implement IWICBitmapFrameEncode::SetPalette in JPEG encoder.
Signed-off-by: Vincent Povirk <vincent@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
0f94101716
commit
a901fa9dc3
|
@ -868,6 +868,8 @@ typedef struct JpegEncoder {
|
||||||
double xres, yres;
|
double xres, yres;
|
||||||
const jpeg_compress_format *format;
|
const jpeg_compress_format *format;
|
||||||
IStream *stream;
|
IStream *stream;
|
||||||
|
WICColor palette[256];
|
||||||
|
UINT colors;
|
||||||
CRITICAL_SECTION lock;
|
CRITICAL_SECTION lock;
|
||||||
BYTE dest_buffer[1024];
|
BYTE dest_buffer[1024];
|
||||||
} JpegEncoder;
|
} JpegEncoder;
|
||||||
|
@ -1070,10 +1072,24 @@ static HRESULT WINAPI JpegEncoder_Frame_SetColorContexts(IWICBitmapFrameEncode *
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI JpegEncoder_Frame_SetPalette(IWICBitmapFrameEncode *iface,
|
static HRESULT WINAPI JpegEncoder_Frame_SetPalette(IWICBitmapFrameEncode *iface,
|
||||||
IWICPalette *pIPalette)
|
IWICPalette *palette)
|
||||||
{
|
{
|
||||||
FIXME("(%p,%p): stub\n", iface, pIPalette);
|
JpegEncoder *This = impl_from_IWICBitmapFrameEncode(iface);
|
||||||
return WINCODEC_ERR_UNSUPPORTEDOPERATION;
|
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,
|
static HRESULT WINAPI JpegEncoder_Frame_SetThumbnail(IWICBitmapFrameEncode *iface,
|
||||||
|
@ -1543,6 +1559,7 @@ HRESULT JpegEncoder_CreateInstance(REFIID iid, void** ppv)
|
||||||
This->xres = This->yres = 0.0;
|
This->xres = This->yres = 0.0;
|
||||||
This->format = NULL;
|
This->format = NULL;
|
||||||
This->stream = NULL;
|
This->stream = NULL;
|
||||||
|
This->colors = 0;
|
||||||
InitializeCriticalSection(&This->lock);
|
InitializeCriticalSection(&This->lock);
|
||||||
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JpegEncoder.lock");
|
This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JpegEncoder.lock");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue