Sweden-Number/dlls/gdi32
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
..
dibdrv gdi32: Partially implement HALFTONE stretch mode. 2021-06-15 20:43:55 +02:00
enhmfdrv gdi32: Use a common helper for emf StretchBlt and AlphaBlend. 2021-06-07 21:32:00 +02:00
mfdrv gdi32: Implement MFDRV_SetLayout(). 2021-06-07 21:31:57 +02:00
tests gdi32: Fix SetPixel error return value. 2021-06-14 10:05:10 +02:00
uniscribe gdi32/uniscribe: Get rid of shaping group values in Arabic shaping data table. 2021-01-20 22:11:40 +01:00
Makefile.in gdi32: Introduce new opentype font parsing helpers. 2020-12-03 20:18:38 +01:00
bidi.c gdi32: Fix some leaks on error paths. 2021-04-19 22:06:55 +02:00
bitblt.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
bitmap.c
brush.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
clipping.c
dc.c gdi32: Reselect font and pen when changing world transforms for enhanced metafiles. 2021-04-20 21:07:10 +02:00
dib.c gdi32: Avoid exceeding the actual bitmap height. 2020-11-12 13:58:33 +01:00
driver.c gdi32: Return correct color depth for display DCs in GetDeviceCaps(). 2021-06-07 21:31:54 +02:00
enhmetafile.c gdi32: Use wide-character string literals. 2020-11-06 17:34:27 +01:00
font.c gdi32: Don't override FontSubstitutes on a DPI only change. 2021-05-27 11:32:51 +02:00
freetype.c gdi32: Fix a memory leak. 2021-05-13 10:41:55 +02:00
gdi32.rc
gdi32.spec gdi32: Merge in Uniscribe functionality. 2020-11-09 20:15:11 +01:00
gdi_private.h gdi32: Get rid of redundant ntmCellHeight member. 2021-04-07 22:36:11 +02:00
gdiobj.c gdi32: Implement GdiDllInitialize stub. 2020-11-06 18:20:32 +01:00
icm.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
mapping.c
metafile.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
opengl.c gdi32: Use wide-character string literals. 2020-11-06 17:34:27 +01:00
opentype.c gdi32: Add a missing break (Coverity). 2021-04-19 22:06:55 +02:00
painting.c gdi32: Fix SetPixel error return value. 2021-06-14 10:05:10 +02:00
palette.c
path.c gdi32: Fix a leak on error path (Coverity). 2021-04-19 22:06:55 +02:00
pen.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00
printdrv.c
region.c gdi32: Merge rectangles horizontally when possible in CreatePolyPolygonRgn. 2021-01-22 11:12:21 +01:00
resource.h
vertical.c
vulkan.c gdi32: Build with msvcrt. 2020-11-05 10:44:16 +01:00