Commit a0f9a251 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Use predefined WICBitmapPaletteTypeFixedBW palette instead of a hand-made one.

parent a9d0f897
......@@ -103,24 +103,19 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
IWICPalette *palette;
UINT actualcolors;
if (source_format == format_1bppIndexed)
{
res = PaletteImpl_Create(&palette);
if (FAILED(res)) return res;
res = PaletteImpl_Create(&palette);
if (FAILED(res)) return res;
if (source_format == format_1bppIndexed)
res = IWICBitmapSource_CopyPalette(This->source, palette);
if (SUCCEEDED(res))
res = IWICPalette_GetColors(palette, 2, colors, &actualcolors);
else
res = IWICPalette_InitializePredefined(palette, WICBitmapPaletteTypeFixedBW, FALSE);
IWICPalette_Release(palette);
if (SUCCEEDED(res))
res = IWICPalette_GetColors(palette, 2, colors, &actualcolors);
if (FAILED(res)) return res;
}
else
{
colors[0] = 0xff000000;
colors[1] = 0xffffffff;
}
IWICPalette_Release(palette);
if (FAILED(res)) return res;
srcstride = (prc->Width+7)/8;
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