diff options
| author | Cecilio Pardo | 2024-11-04 18:58:40 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2024-11-05 14:37:07 +0200 |
| commit | 4e8bf2977e6d1abf6d3cf82e9c1ae3dee5bfcda0 (patch) | |
| tree | c52d029ee9f13d91f075bf2b34d0380274955d84 /src/w32image.c | |
| parent | 8a7910fb67e3b89de430d3b3e5009b145ec0c602 (diff) | |
| download | emacs-4e8bf2977e6d1abf6d3cf82e9c1ae3dee5bfcda0.tar.gz emacs-4e8bf2977e6d1abf6d3cf82e9c1ae3dee5bfcda0.zip | |
Support :transform-smoothing on images (MS-Windows) (bug#57166)
* src/dispextern.h (struct image): Add field 'smoothing' for
NTGUI.
* src/image.c (image_set_transform): Assign the 'smoothing'
field of the image struct.
* src/w32gdiplus.h: Add references to more GDI+ functions.
* src/w32image.c (gdiplus_init): Add references to more GDI+
functions.
* src/w32term.c (w32_draw_image_foreground): If the image is
marked for smoothing and GDI+ is available, draw it with GDI+
bilinear interpolation.
* etc/NEWS: New entry for this change.
Diffstat (limited to 'src/w32image.c')
| -rw-r--r-- | src/w32image.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/w32image.c b/src/w32image.c index 44eed087528..da4d6843ba9 100644 --- a/src/w32image.c +++ b/src/w32image.c | |||
| @@ -42,6 +42,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 42 | #ifdef WINDOWSNT | 42 | #ifdef WINDOWSNT |
| 43 | GdiplusStartup_Proc fn_GdiplusStartup; | 43 | GdiplusStartup_Proc fn_GdiplusStartup; |
| 44 | GdiplusShutdown_Proc fn_GdiplusShutdown; | 44 | GdiplusShutdown_Proc fn_GdiplusShutdown; |
| 45 | GdipCreateFromHDC_Proc fn_GdipCreateFromHDC; | ||
| 46 | GdipDeleteGraphics_Proc fn_GdipDeleteGraphics; | ||
| 45 | GdipGetPropertyItemSize_Proc fn_GdipGetPropertyItemSize; | 47 | GdipGetPropertyItemSize_Proc fn_GdipGetPropertyItemSize; |
| 46 | GdipGetPropertyItem_Proc fn_GdipGetPropertyItem; | 48 | GdipGetPropertyItem_Proc fn_GdipGetPropertyItem; |
| 47 | GdipImageGetFrameDimensionsCount_Proc fn_GdipImageGetFrameDimensionsCount; | 49 | GdipImageGetFrameDimensionsCount_Proc fn_GdipImageGetFrameDimensionsCount; |
| @@ -53,6 +55,9 @@ GdipCreateBitmapFromStream_Proc fn_GdipCreateBitmapFromStream; | |||
| 53 | GdipCreateBitmapFromScan0_Proc fn_GdipCreateBitmapFromScan0; | 55 | GdipCreateBitmapFromScan0_Proc fn_GdipCreateBitmapFromScan0; |
| 54 | SHCreateMemStream_Proc fn_SHCreateMemStream; | 56 | SHCreateMemStream_Proc fn_SHCreateMemStream; |
| 55 | GdipCreateHBITMAPFromBitmap_Proc fn_GdipCreateHBITMAPFromBitmap; | 57 | GdipCreateHBITMAPFromBitmap_Proc fn_GdipCreateHBITMAPFromBitmap; |
| 58 | GdipCreateBitmapFromHBITMAP_Proc fn_GdipCreateBitmapFromHBITMAP; | ||
| 59 | GdipDrawImageRectRectI_Proc fn_GdipDrawImageRectRectI; | ||
| 60 | GdipSetInterpolationMode_Proc fn_GdipSetInterpolationMode; | ||
| 56 | GdipDisposeImage_Proc fn_GdipDisposeImage; | 61 | GdipDisposeImage_Proc fn_GdipDisposeImage; |
| 57 | GdipGetImageHeight_Proc fn_GdipGetImageHeight; | 62 | GdipGetImageHeight_Proc fn_GdipGetImageHeight; |
| 58 | GdipGetImageWidth_Proc fn_GdipGetImageWidth; | 63 | GdipGetImageWidth_Proc fn_GdipGetImageWidth; |
| @@ -80,6 +85,14 @@ gdiplus_init (void) | |||
| 80 | get_proc_addr (gdiplus_lib, "GdiplusShutdown"); | 85 | get_proc_addr (gdiplus_lib, "GdiplusShutdown"); |
| 81 | if (!fn_GdiplusShutdown) | 86 | if (!fn_GdiplusShutdown) |
| 82 | return false; | 87 | return false; |
| 88 | fn_GdipCreateFromHDC = (GdipCreateFromHDC_Proc) | ||
| 89 | get_proc_addr (gdiplus_lib, "GdipCreateFromHDC"); | ||
| 90 | if (!fn_GdipCreateFromHDC) | ||
| 91 | return false; | ||
| 92 | fn_GdipDeleteGraphics = (GdipDeleteGraphics_Proc) | ||
| 93 | get_proc_addr (gdiplus_lib, "GdipDeleteGraphics"); | ||
| 94 | if (!fn_GdipDeleteGraphics) | ||
| 95 | return false; | ||
| 83 | fn_GdipGetPropertyItemSize = (GdipGetPropertyItemSize_Proc) | 96 | fn_GdipGetPropertyItemSize = (GdipGetPropertyItemSize_Proc) |
| 84 | get_proc_addr (gdiplus_lib, "GdipGetPropertyItemSize"); | 97 | get_proc_addr (gdiplus_lib, "GdipGetPropertyItemSize"); |
| 85 | if (!fn_GdipGetPropertyItemSize) | 98 | if (!fn_GdipGetPropertyItemSize) |
| @@ -120,6 +133,18 @@ gdiplus_init (void) | |||
| 120 | get_proc_addr (gdiplus_lib, "GdipCreateHBITMAPFromBitmap"); | 133 | get_proc_addr (gdiplus_lib, "GdipCreateHBITMAPFromBitmap"); |
| 121 | if (!fn_GdipCreateHBITMAPFromBitmap) | 134 | if (!fn_GdipCreateHBITMAPFromBitmap) |
| 122 | return false; | 135 | return false; |
| 136 | fn_GdipCreateBitmapFromHBITMAP = (GdipCreateBitmapFromHBITMAP_Proc) | ||
| 137 | get_proc_addr (gdiplus_lib, "GdipCreateBitmapFromHBITMAP"); | ||
| 138 | if (!fn_GdipCreateBitmapFromHBITMAP) | ||
| 139 | return false; | ||
| 140 | fn_GdipDrawImageRectRectI = (GdipDrawImageRectRectI_Proc) | ||
| 141 | get_proc_addr (gdiplus_lib, "GdipDrawImageRectRectI"); | ||
| 142 | if (!fn_GdipDrawImageRectRectI) | ||
| 143 | return false; | ||
| 144 | fn_GdipSetInterpolationMode = (GdipSetInterpolationMode_Proc) | ||
| 145 | get_proc_addr (gdiplus_lib, "GdipSetInterpolationMode"); | ||
| 146 | if (!fn_GdipSetInterpolationMode) | ||
| 147 | return false; | ||
| 123 | fn_GdipDisposeImage = (GdipDisposeImage_Proc) | 148 | fn_GdipDisposeImage = (GdipDisposeImage_Proc) |
| 124 | get_proc_addr (gdiplus_lib, "GdipDisposeImage"); | 149 | get_proc_addr (gdiplus_lib, "GdipDisposeImage"); |
| 125 | if (!fn_GdipDisposeImage) | 150 | if (!fn_GdipDisposeImage) |