Sweden-Number/dlls/gdi32/dibdrv
Zhiyi Zhang 04b4d0f380 gdi32: Partially implement HALFTONE stretch mode.
COLORONCOLOR(STRETCH_DELETESCANS) was used in place of HALFTONE. COLORONCOLOR mode may delete rows
of pixels without trying to preserve information so it will cause Wine to render poorly when the
destination rectangle is small.

According to tests, HALFTONE mode uses box filter when doing integer downscaling and nearest
neighbor interpolation when doing upscaling in both horizontally and vertically. In other cases,
HALFTONE mode uses a lanczos3 like algorithm to interpolate pixels. There are also other heuristics
involved. For example, shrinking a 2x2 image to 1x1 may not use box filter depending on image data.
Since this algorithm is undocumented, it's difficult to reverse engineer the original algorithm and
produce identical results. Instead, this patch uses a naive implementation of bilinear interpolation
to implement HALFTONE mode and it produces good quality images.

For 8-bit and lower color depth images, nulldrv_StretchBlt should resize the images first and then
converts color depth.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46375
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-06-15 20:43:55 +02:00
..
bitblt.c gdi32: Partially implement HALFTONE stretch mode. 2021-06-15 20:43:55 +02:00
dc.c gdi32: Fix typos for GET_DC_PHYSDEV. 2021-05-03 23:32:38 +02:00
dibdrv.h gdi32: Partially implement HALFTONE stretch mode. 2021-06-15 20:43:55 +02:00
graphics.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
objects.c gdi32: Make GDI driver functions cdecl. 2019-07-06 21:47:58 +02:00
opengl.c gdi32: Move OSMesa support to the Unix library. 2020-11-05 10:41:12 +01:00
primitives.c gdi32: Partially implement HALFTONE stretch mode. 2021-06-15 20:43:55 +02:00