1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxQuantize
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 Performs quantization, or colour reduction, on a wxImage.
15 Functions in this class are static and so a wxQuantize object need not be
21 class wxQuantize
: public wxObject
25 Constructor. You do not need to construct a wxQuantize object since its
31 Converts input bitmap(s) into 8bit representation with custom palette.
32 in_rows and out_rows are arrays [0..h-1] of pointer to rows
33 (in_rows contains w * 3 bytes per row, out_rows w bytes per row).
34 Fills out_rows with indexes into palette (which is also stored into palette
37 void DoQuantize(unsigned w
, unsigned h
, unsigned char** in_rows
,
38 unsigned char** out_rows
,
39 unsigned char* palette
,
40 int desiredNoColours
);
44 This version sets a palette in the destination image so you don't
45 have to manage it yourself.
47 bool Quantize(const wxImage
& src
, wxImage
& dest
,
49 int desiredNoColours
= 236,
50 unsigned char** eightBitData
= 0,
51 int flags
= wxQUANTIZE_INCLUDE_WINDOWS_COLOURS
|wxQUANTIZE_FILL_DESTINATION_IMAGE
|wxQUANTIZE_RETURN_8BIT_DATA
);
52 bool Quantize(const wxImage
& src
, wxImage
& dest
,
53 int desiredNoColours
= 236,
54 unsigned char** eightBitData
= 0,
55 int flags
= wxQUANTIZE_INCLUDE_WINDOWS_COLOURS
|wxQUANTIZE_FILL_DESTINATION_IMAGE
|wxQUANTIZE_RETURN_8BIT_DATA
);