]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/quantize.tex
toplevel code transferred to wxTopLevelWindow
[wxWidgets.git] / docs / latex / wx / quantize.tex
... / ...
CommitLineData
1\section{\class{wxQuantize}}\label{wxquantize}
2
3Performs quantization, or colour reduction, on a wxImage.
4
5Functions 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
21Constructor. 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
27Reduce the colours in the source image and put the result into the
28destination image. Both images may be the same, to overwrite the source image.
29Specify an optional palette pointer to receive the resulting palette.
30This palette may be passed to ConvertImageToBitmap, for example.
31
32If 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
36This version sets a palette in the destination image so you don't
37have 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
43Converts input bitmap(s) into 8bit representation with custom palette.
44
45in\_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
48Fills out\_rows with indexes into palette (which is also stored into palette variable).
49