Chris Reuter  committed 3b2caf6

Added function 'gdImageGetInterpolationMethod()'.

This retrieves the interpolation method set via
gdImageSetInterpolationMethod(). It is a function instead of a macro
for the benefit of VMs that need a function pointer to call.

  • Participants
  • Parent commits 00cd958

Comments (0)

Files changed (2)

 BGD_DECLARE(gdImagePtr) gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold);
 BGD_DECLARE(int) gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id);
+BGD_DECLARE(gdInterpolationMethod) gdImageGetInterpolationMethod(gdImagePtr im);
 BGD_DECLARE(gdImagePtr) gdImageScale(const gdImagePtr src, const unsigned int new_width, const unsigned int new_height);

File src/gd_interpolation.c

 	return 1;
+/* Return the interpolation mode set in 'im'.  This is here so that
+ * the value can be read via a language or VM with an FFI but no
+ * (portable) way to extract the value from the struct. */
+BGD_DECLARE(gdInterpolationMethod) gdImageGetInterpolationMethod(gdImagePtr im)
+    return im->interpolation_id;
 #ifdef _MSC_VER
 # pragma optimize("", on)