summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd_interpolation.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gd/libgd/gd_interpolation.c')
-rw-r--r--ext/gd/libgd/gd_interpolation.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index 6ea81ea61c..1a7cf209dc 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -2534,6 +2534,29 @@ int gdImageSetInterpolationMethod(gdImagePtr im, gdInterpolationMethod id)
return 1;
}
+/**
+ * Function: gdImageGetInterpolationMethod
+ *
+ * Get the current interpolation method
+ *
+ * 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.
+ *
+ * Parameters:
+ * im - The image.
+ *
+ * Returns:
+ * The current interpolation method.
+ *
+ * See also:
+ * - <gdInterpolationMethod>
+ * - <gdImageSetInterpolationMethod>
+ */
+gdInterpolationMethod gdImageGetInterpolationMethod(gdImagePtr im)
+{
+ return im->interpolation_id;
+}
+
#ifdef _MSC_VER
# pragma optimize("", on)
#endif