windowscodecs: Implement GetPixelFormat for the JPEG decoder.

This commit is contained in:
Vincent Povirk 2009-08-24 12:29:02 -05:00 committed by Alexandre Julliard
parent 5ef3b51756
commit 0ab6e9853c
1 changed files with 7 additions and 2 deletions

View File

@ -399,8 +399,13 @@ static HRESULT WINAPI JpegDecoder_Frame_GetSize(IWICBitmapFrameDecode *iface,
static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface, static HRESULT WINAPI JpegDecoder_Frame_GetPixelFormat(IWICBitmapFrameDecode *iface,
WICPixelFormatGUID *pPixelFormat) WICPixelFormatGUID *pPixelFormat)
{ {
FIXME("(%p,%p)\n", iface, pPixelFormat); JpegDecoder *This = decoder_from_frame(iface);
return E_NOTIMPL; TRACE("(%p,%p)\n", iface, pPixelFormat);
if (This->cinfo.out_color_space == JCS_RGB)
memcpy(pPixelFormat, &GUID_WICPixelFormat24bppBGR, sizeof(GUID));
else /* This->cinfo.out_color_space == JCS_GRAYSCALE */
memcpy(pPixelFormat, &GUID_WICPixelFormat8bppGray, sizeof(GUID));
return S_OK;
} }
static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *iface, static HRESULT WINAPI JpegDecoder_Frame_GetResolution(IWICBitmapFrameDecode *iface,