summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_nnquant.c')
-rw-r--r--Build/source/libs/gd/libgd-src/src/gd_nnquant.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_nnquant.c b/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
index d6b2b275766..19190b7ed84 100644
--- a/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
+++ b/Build/source/libs/gd/libgd-src/src/gd_nnquant.c
@@ -506,9 +506,23 @@ int verbose;
if (verbose) gd_error_ex(GD_NOTICE, "finished 1D learning: final alpha=%f !\n",((float)alpha)/initalpha);
}
-/*
- Function: gdImageNeuQuant
-*/
+/**
+ * Function: gdImageNeuQuant
+ *
+ * Creates a new palette image from a truecolor image
+ *
+ * This is the same as calling <gdImageCreatePaletteFromTrueColor> with the
+ * quantization method <GD_QUANT_NEUQUANT>.
+ *
+ * Parameters:
+ * im - The image.
+ * max_color - The number of desired palette entries.
+ * sample_factor - The quantization precision between 1 (highest quality) and
+ * 10 (fastest).
+ *
+ * Returns:
+ * A newly create palette image; NULL on failure.
+ */
BGD_DECLARE(gdImagePtr) gdImageNeuQuant(gdImagePtr im, const int max_color, int sample_factor)
{
const int newcolors = max_color;