]> git.saurik.com Git - wxWidgets.git/blame - interface/quantize.h
mac paths updated
[wxWidgets.git] / interface / quantize.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: quantize.h
e54c96f1 3// Purpose: interface of wxQuantize
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxQuantize
11 @wxheader{quantize.h}
7c913512 12
23324ae1 13 Performs quantization, or colour reduction, on a wxImage.
7c913512 14
23324ae1
FM
15 Functions in this class are static and so a wxQuantize object need not be
16 created.
7c913512 17
23324ae1
FM
18 @library{wxcore}
19 @category{misc}
20*/
21class wxQuantize : public wxObject
22{
23public:
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.
3ed3a1c8
BP
32 @a in_rows and @a out_rows are arrays [0..h-1] of pointer to rows
33 (@a in_rows contains @a w * 3 bytes per row, @a out_rows @a w bytes per row).
34 Fills @a out_rows with indexes into palette (which is also stored into @a palette
23324ae1
FM
35 variable).
36 */
37 void DoQuantize(unsigned w, unsigned h, unsigned char** in_rows,
3ed3a1c8 38 unsigned char** out_rows, unsigned char* palette,
23324ae1
FM
39 int desiredNoColours);
40
23324ae1 41 /**
3ed3a1c8
BP
42 Reduce the colours in the source image and put the result into the destination image.
43 Both images may be the same, to overwrite the source image.
44
45 Specify an optional palette pointer to receive the resulting palette.
46 This palette may be passed to ConvertImageToBitmap, for example.
23324ae1
FM
47 */
48 bool Quantize(const wxImage& src, wxImage& dest,
3ed3a1c8 49 wxPalette** pPalette, int desiredNoColours = 236,
23324ae1 50 unsigned char** eightBitData = 0,
3ed3a1c8
BP
51 int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS
52 |wxQUANTIZE_FILL_DESTINATION_IMAGE
53 |wxQUANTIZE_RETURN_8BIT_DATA);
54
55 /**
56 This version sets a palette in the destination image so you don't
57 have to manage it yourself.
58 */
7c913512
FM
59 bool Quantize(const wxImage& src, wxImage& dest,
60 int desiredNoColours = 236,
61 unsigned char** eightBitData = 0,
3ed3a1c8
BP
62 int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS
63 |wxQUANTIZE_FILL_DESTINATION_IMAGE
64 |wxQUANTIZE_RETURN_8BIT_DATA);
23324ae1 65};
e54c96f1 66