]> git.saurik.com Git - wxWidgets.git/blob - interface/quantize.h
200c91ff4a160223f29d6daf50de47b1d8857242
[wxWidgets.git] / interface / quantize.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: quantize.h
3 // Purpose: documentation for wxQuantize class
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxQuantize
11 @wxheader{quantize.h}
12
13 Performs quantization, or colour reduction, on a wxImage.
14
15 Functions in this class are static and so a wxQuantize object need not be
16 created.
17
18 @library{wxcore}
19 @category{misc}
20 */
21 class wxQuantize : public wxObject
22 {
23 public:
24 /**
25 Constructor. You do not need to construct a wxQuantize object since its
26 functions are static.
27 */
28 wxQuantize();
29
30 /**
31 Converts input bitmap(s) into 8bit representation with custom palette.
32
33 in_rows and out_rows are arrays [0..h-1] of pointer to rows
34 (in_rows contains w * 3 bytes per row, out_rows w bytes per row).
35
36 Fills out_rows with indexes into palette (which is also stored into palette
37 variable).
38 */
39 void DoQuantize(unsigned w, unsigned h, unsigned char** in_rows,
40 unsigned char** out_rows,
41 unsigned char* palette,
42 int desiredNoColours);
43
44 //@{
45 /**
46 This version sets a palette in the destination image so you don't
47 have to manage it yourself.
48 */
49 bool Quantize(const wxImage& src, wxImage& dest,
50 wxPalette** pPalette,
51 int desiredNoColours = 236,
52 unsigned char** eightBitData = 0,
53 int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA);
54 bool Quantize(const wxImage& src, wxImage& dest,
55 int desiredNoColours = 236,
56 unsigned char** eightBitData = 0,
57 int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA);
58 //@}
59 };