#include "wx/image.h"
#include "wx/quantize.h"
+#ifdef __WXMSW__
+#include <windows.h>
+#endif
+
#include <stdlib.h>
#include <string.h>
return TRUE;
}
+// This version sets a palette in the destination image so you don't
+// have to manage it yourself.
+
+bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, int desiredNoColours,
+ unsigned char** eightBitData, int flags)
+{
+ wxPalette* palette = NULL;
+ if (Quantize(src, dest, & palette, desiredNoColours, eightBitData, flags))
+ {
+ if (palette)
+ {
+ dest.SetPalette(* palette);
+ delete palette;
+ }
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+