From b82023b7c280e7becfb208ddfd7b83797e70df77 Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Fri, 13 Jul 2012 10:08:58 +0900 Subject: [PATCH] windowscodecs: Use predefined WICBitmapPaletteTypeFixedGray16 palette instead of a handmade one. --- dlls/windowscodecs/converter.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/dlls/windowscodecs/converter.c b/dlls/windowscodecs/converter.c index bd83be35c1..98e727e258 100644 --- a/dlls/windowscodecs/converter.c +++ b/dlls/windowscodecs/converter.c @@ -82,16 +82,6 @@ static inline FormatConverter *impl_from_IWICFormatConverter(IWICFormatConverter return CONTAINING_RECORD(iface, FormatConverter, IWICFormatConverter_iface); } -static void make_grayscale_palette(WICColor *colors, UINT num_colors) -{ - int i, v; - for (i=0; isource, palette); - if (SUCCEEDED(res)) - res = IWICPalette_GetColors(palette, 16, colors, &actualcolors); + else + res = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray16, FALSE); - IWICPalette_Release(palette); + if (SUCCEEDED(res)) + res = IWICPalette_GetColors(palette, 16, colors, &actualcolors); - if (FAILED(res)) return res; - } - else - make_grayscale_palette(colors, 16); + IWICPalette_Release(palette); + if (FAILED(res)) return res; srcstride = (prc->Width+1)/2; srcdatasize = srcstride * prc->Height; -- 2.32.0.93.g670b81a890