Commit 045ac64c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Use predefined WICBitmapPaletteTypeFixedGray4 palette instead of a handmade one.

parent 9fce6a37
...@@ -185,21 +185,19 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe ...@@ -185,21 +185,19 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
IWICPalette *palette; IWICPalette *palette;
UINT actualcolors; UINT actualcolors;
if (source_format == format_2bppIndexed) res = PaletteImpl_Create(&palette);
{ if (FAILED(res)) return res;
res = PaletteImpl_Create(&palette);
if (FAILED(res)) return res;
if (source_format == format_2bppIndexed)
res = IWICBitmapSource_CopyPalette(This->source, palette); res = IWICBitmapSource_CopyPalette(This->source, palette);
if (SUCCEEDED(res)) else
res = IWICPalette_GetColors(palette, 4, colors, &actualcolors); res = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedGray4, FALSE);
IWICPalette_Release(palette); if (SUCCEEDED(res))
res = IWICPalette_GetColors(palette, 4, colors, &actualcolors);
if (FAILED(res)) return res; IWICPalette_Release(palette);
} if (FAILED(res)) return res;
else
make_grayscale_palette(colors, 4);
srcstride = (prc->Width+3)/4; srcstride = (prc->Width+3)/4;
srcdatasize = srcstride * prc->Height; srcdatasize = srcstride * prc->Height;
......
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