aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorCecilio Pardo2024-11-04 18:58:40 +0100
committerEli Zaretskii2024-11-05 14:37:07 +0200
commit4e8bf2977e6d1abf6d3cf82e9c1ae3dee5bfcda0 (patch)
treec52d029ee9f13d91f075bf2b34d0380274955d84 /src/image.c
parent8a7910fb67e3b89de430d3b3e5009b145ec0c602 (diff)
downloademacs-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/image.c')
-rw-r--r--src/image.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c
index 34936977a40..db7f6acd171 100644
--- a/src/image.c
+++ b/src/image.c
@@ -3049,12 +3049,10 @@ image_set_transform (struct frame *f, struct image *img)
3049 flip = !NILP (image_spec_value (img->spec, QCflip, NULL)); 3049 flip = !NILP (image_spec_value (img->spec, QCflip, NULL));
3050 3050
3051# if defined USE_CAIRO || defined HAVE_XRENDER || defined HAVE_NS || defined HAVE_HAIKU \ 3051# if defined USE_CAIRO || defined HAVE_XRENDER || defined HAVE_NS || defined HAVE_HAIKU \
3052 || defined HAVE_ANDROID 3052 || defined HAVE_ANDROID || defined HAVE_NTGUI
3053 /* We want scale up operations to use a nearest neighbor filter to 3053 /* We want scale up operations to use a nearest neighbor filter to
3054 show real pixels instead of munging them, but scale down 3054 show real pixels instead of munging them, but scale down
3055 operations to use a blended filter, to avoid aliasing and the like. 3055 operations to use a blended filter, to avoid aliasing and the like. */
3056
3057 TODO: implement for Windows. */
3058 bool smoothing; 3056 bool smoothing;
3059 Lisp_Object s = image_spec_value (img->spec, QCtransform_smoothing, NULL); 3057 Lisp_Object s = image_spec_value (img->spec, QCtransform_smoothing, NULL);
3060 if (NILP (s)) 3058 if (NILP (s))
@@ -3067,6 +3065,10 @@ image_set_transform (struct frame *f, struct image *img)
3067 img->use_bilinear_filtering = smoothing; 3065 img->use_bilinear_filtering = smoothing;
3068#endif 3066#endif
3069 3067
3068#ifdef HAVE_NTGUI
3069 img->smoothing = smoothing;
3070#endif
3071
3070 /* Perform scale transformation. */ 3072 /* Perform scale transformation. */
3071 3073
3072 matrix3x3 matrix 3074 matrix3x3 matrix