Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=20694
The conversion was tested with Mozart 11, by exporting to GIF image format:
![Mozart_Duet_1](/uploads/749ee278a43f7234f422471f819027f1/Mozart_Duet_1.gif)
From: Bartosz Kosiorek gang65@poczta.onet.pl
Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=20694 --- dlls/gdiplus/image.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 56a3cfa1d18..0056dae1880 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -617,6 +617,19 @@ GpStatus convert_pixels(INT width, INT height, return Ok; \ } while (0);
+#define convert_indexed_to_indexed(getpixel_function, setpixel_function) do { \ + for (y=0; y<height; y++) \ + for (x=0; x<width; x++) { \ + BYTE index; \ + ARGB argb; \ + BYTE *color = (BYTE *)&argb; \ + getpixel_function(&index, src_bits+src_stride*y, x); \ + argb = (src_palette && index < src_palette->Count) ? src_palette->Entries[index] : 0; \ + setpixel_function(color[2], color[1], color[0], color[3], dst_bits+dst_stride*y, x, dst_palette); \ + } \ + return Ok; \ +} while (0); + #define convert_rgb_to_rgb(getpixel_function, setpixel_function) do { \ for (y=0; y<height; y++) \ for (x=0; x<width; x++) { \ @@ -642,6 +655,10 @@ GpStatus convert_pixels(INT width, INT height, case PixelFormat1bppIndexed: switch (dst_format) { + case PixelFormat4bppIndexed: + convert_indexed_to_indexed(getpixel_1bppIndexed, setpixel_4bppIndexed); + case PixelFormat8bppIndexed: + convert_indexed_to_indexed(getpixel_1bppIndexed, setpixel_8bppIndexed); case PixelFormat16bppGrayScale: convert_indexed_to_rgb(getpixel_1bppIndexed, setpixel_16bppGrayScale); case PixelFormat16bppRGB555: @@ -669,6 +686,10 @@ GpStatus convert_pixels(INT width, INT height, case PixelFormat4bppIndexed: switch (dst_format) { + case PixelFormat1bppIndexed: + convert_indexed_to_indexed(getpixel_4bppIndexed, setpixel_1bppIndexed); + case PixelFormat8bppIndexed: + convert_indexed_to_indexed(getpixel_4bppIndexed, setpixel_8bppIndexed); case PixelFormat16bppGrayScale: convert_indexed_to_rgb(getpixel_4bppIndexed, setpixel_16bppGrayScale); case PixelFormat16bppRGB555: @@ -696,6 +717,10 @@ GpStatus convert_pixels(INT width, INT height, case PixelFormat8bppIndexed: switch (dst_format) { + case PixelFormat1bppIndexed: + convert_indexed_to_indexed(getpixel_8bppIndexed, setpixel_1bppIndexed); + case PixelFormat4bppIndexed: + convert_indexed_to_indexed(getpixel_8bppIndexed, setpixel_4bppIndexed); case PixelFormat16bppGrayScale: convert_indexed_to_rgb(getpixel_8bppIndexed, setpixel_16bppGrayScale); case PixelFormat16bppRGB555: @@ -1067,7 +1092,9 @@ GpStatus convert_pixels(INT width, INT height, }
#undef convert_indexed_to_rgb +#undef convert_indexed_to_indexed #undef convert_rgb_to_rgb +#undef convert_rgb_to_indexed
return NotImplemented; }
This merge request was approved by Esme Povirk.
@madewokherd What needs to be done to be able to modify the bug reports available at: https://bugs.winehq.org/ ?