Module: wine Branch: master Commit: 83807312b9cb269324b9eee78dd5f2e3354a26c9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=83807312b9cb269324b9eee78d...
Author: Vincent Povirk vincent@codeweavers.com Date: Thu Aug 13 12:46:44 2009 -0500
windowscodecs: Implement conversion to 32bppBGR.
---
dlls/windowscodecs/converter.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index 0f851bc..efb997e 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -88,8 +88,23 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe } }
+static HRESULT copypixels_to_32bppBGR(struct FormatConverter *This, const WICRect *prc, + UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer, enum pixelformat source_format) +{ + switch (source_format) + { + case format_32bppBGR: + case format_32bppBGRA: + if (prc) + return IWICBitmapSource_CopyPixels(This->source, prc, cbStride, cbBufferSize, pbBuffer); + return S_OK; + default: + return copypixels_to_32bppBGRA(This, prc, cbStride, cbBufferSize, pbBuffer, source_format); + } +} + static const struct pixelformatinfo supported_formats[] = { - {format_32bppBGR, &GUID_WICPixelFormat32bppBGR, NULL}, + {format_32bppBGR, &GUID_WICPixelFormat32bppBGR, copypixels_to_32bppBGR}, {format_32bppBGRA, &GUID_WICPixelFormat32bppBGRA, copypixels_to_32bppBGRA}, {0} };