]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/quantize.tex
corrected the completely wrong example (bug 545427)
[wxWidgets.git] / docs / latex / wx / quantize.tex
1 \section{\class{wxQuantize}}\label{wxquantize}
2
3 Performs quantization, or colour reduction, on a wxImage.
4
5 Functions in this class are static and so a wxQuantize object need not be created.
6
7 \wxheading{Derived from}
8
9 \helpref{wxObject}{wxobject}
10
11 \wxheading{Include files}
12
13 <wx/quantize.h>
14
15 \latexignore{\rtfignore{\wxheading{Members}}}
16
17 \membersection{wxQuantize::wxQuantize}\label{wxquantizewxquantize}
18
19 \func{}{wxQuantize}{\void}
20
21 Constructor. You do not need to construct a wxQuantize object since its functions are static.
22
23 \membersection{wxQuantize::Quantize}\label{wxquantizequantize}
24
25 \func{bool}{Quantize}{\param{const wxImage\& }{src}, \param{wxImage\& }{dest}, \param{wxPalette** }{pPalette}, \param{int }{desiredNoColours = 236}, \param{unsigned char** }{eightBitData = 0}, \param{int }{flags = wxQUANTIZE\_INCLUDE\_WINDOWS\_COLOURS|wxQUANTIZE\_FILL\_DESTINATION\_IMAGE|wxQUANTIZE\_RETURN\_8BIT\_DATA}}
26
27 Reduce the colours in the source image and put the result into the
28 destination image. Both images may be the same, to overwrite the source image.
29 Specify an optional palette pointer to receive the resulting palette.
30 This palette may be passed to ConvertImageToBitmap, for example.
31
32 If you pass a palette pointer, you must free the palette yourself.
33
34 \func{bool}{Quantize}{\param{const wxImage\& }{src}, \param{wxImage\& }{dest}, \param{int }{desiredNoColours = 236}, \param{unsigned char** }{eightBitData = 0}, \param{int }{flags = wxQUANTIZE\_INCLUDE\_WINDOWS\_COLOURS|wxQUANTIZE\_FILL\_DESTINATION\_IMAGE|wxQUANTIZE\_RETURN\_8BIT\_DATA}}
35
36 This version sets a palette in the destination image so you don't
37 have to manage it yourself.
38
39 \membersection{wxQuantize::DoQuantize}\label{wxquantizedoquantize}
40
41 \func{void}{DoQuantize}{\param{unsigned }{w}, \param{unsigned }{h}, \param{unsigned char** }{in\_rows}, \param{unsigned char** }{out\_rows}, \param{unsigned char* }{palette}, \param{int }{desiredNoColours}}
42
43 Converts input bitmap(s) into 8bit representation with custom palette.
44
45 in\_rows and out\_rows are arrays [0..h-1] of pointer to rows
46 (in\_rows contains w * 3 bytes per row, out\_rows w bytes per row).
47
48 Fills out\_rows with indexes into palette (which is also stored into palette variable).
49