+//---------------------------------------------------------------------------
+
+%{
+#include <wx/quantize.h>
+%}
+
+enum {
+ wxQUANTIZE_INCLUDE_WINDOWS_COLOURS,
+// wxQUANTIZE_RETURN_8BIT_DATA,
+ wxQUANTIZE_FILL_DESTINATION_IMAGE
+};
+
+
+DocStr(wxQuantize,
+ "Performs quantization, or colour reduction, on a wxImage.", "");
+
+class wxQuantize /*: public wxObject */
+{
+public:
+
+ %extend {
+ DocStr(
+ Quantize,
+ "Reduce the colours in the source image and put the result into the
+destination image, setting the palette in the destination if
+needed. Both images may be the same, to overwrite the source image.", "
+:todo: Create a version that returns the wx.Palette used.");
+
+ static bool Quantize(const wxImage& src, wxImage& dest, int desiredNoColours = 236,
+ int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE)
+ {
+ return wxQuantize::Quantize(src, dest,
+ //NULL, // palette
+ desiredNoColours,
+ NULL, // eightBitData
+ flags);
+ }
+ }
+};
+
+