]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/palette.tex
Misc small changes
[wxWidgets.git] / docs / latex / wx / palette.tex
CommitLineData
a660d684
KB
1\section{\class{wxPalette}}\label{wxpalette}
2
3A palette is a table that maps pixel values to RGB colours. It allows the colours
4of a low-depth bitmap, for example, to be mapped to the available colours in a display.
5
5b6aa0ff 6%TODO: topic overview for wxPalette.
a660d684
KB
7\wxheading{Derived from}
8
9\helpref{wxGDIObject}{wxgdiobject}\\
10\helpref{wxObject}{wxobject}
11
954b8ae6
JS
12\wxheading{Include files}
13
14<wx/palette.h>
15
20e85460
JS
16\wxheading{Predefined objects}
17
18Objects:
19
20{\bf wxNullPalette}
21
a660d684
KB
22\wxheading{See also}
23
24\helpref{wxDC::SetPalette}{wxdcsetpalette}, \helpref{wxBitmap}{wxbitmap}
25
26\latexignore{\rtfignore{\wxheading{Members}}}
27
28\membersection{wxPalette::wxPalette}\label{wxpaletteconstr}
29
30\func{}{wxPalette}{\void}
31
32Default constructor.
33
34\func{}{wxPalette}{\param{const wxPalette\&}{ palette}}
35
36Copy constructor. This uses reference counting so is a cheap operation.
37
eaaa6a06 38\func{}{wxPalette}{\param{int}{ n}, \param{const unsigned char* }{red},\\
a660d684
KB
39 \param{const unsigned char* }{green}, \param{const unsigned char* }{blue}}
40
41Creates a palette from arrays of size {\it n}, one for each
42red, blue or green component.
43
44\wxheading{Parameters}
45
46\docparam{palette}{A pointer or reference to the palette to copy.}
47
48\docparam{n}{The number of indices in the palette.}
49
50\docparam{red}{An array of red values.}
51
52\docparam{green}{An array of green values.}
53
54\docparam{blue}{An array of blue values.}
55
56\wxheading{See also}
57
58\helpref{wxPalette::Create}{wxpalettecreate}
59
60\membersection{wxPalette::\destruct{wxPalette}}
61
62\func{}{\destruct{wxPalette}}{\void}
63
64Destructor.
65
66\membersection{wxPalette::Create}\label{wxpalettecreate}
67
eaaa6a06 68\func{bool}{Create}{\param{int}{ n}, \param{const unsigned char* }{red},\rtfsp
a660d684
KB
69 \param{const unsigned char* }{green}, \param{const unsigned char* }{blue}}
70
71Creates a palette from arrays of size {\it n}, one for each
72red, blue or green component.
73
74\wxheading{Parameters}
75
76\docparam{n}{The number of indices in the palette.}
77
78\docparam{red}{An array of red values.}
79
80\docparam{green}{An array of green values.}
81
82\docparam{blue}{An array of blue values.}
83
84\wxheading{Return value}
85
86TRUE if the creation was successful, FALSE otherwise.
87
88\wxheading{See also}
89
90\helpref{wxPalette::wxPalette}{wxpaletteconstr}
91
92\membersection{wxPalette::GetPixel}\label{wxpalettegetpixel}
93
94\constfunc{int}{GetPixel}{\param{const unsigned char }{red}, \param{const unsigned char }{green},\rtfsp
95 \param{const unsigned char }{blue}}
96
97Returns a pixel value (index into the palette) for the given RGB values.
98
99\wxheading{Parameters}
100
101\docparam{red}{Red value.}
102
103\docparam{green}{Green value.}
104
105\docparam{blue}{Blue value.}
106
107\wxheading{Return value}
108
109The nearest palette index.
110
111\wxheading{See also}
112
113\helpref{wxPalette::GetRGB}{wxpalettegetrgb}
114
115\membersection{wxPalette::GetRGB}\label{wxpalettegetrgb}
116
eaaa6a06 117\constfunc{bool}{GetPixel}{\param{int}{ pixel}, \param{const unsigned char* }{red}, \param{const unsigned char* }{green},\rtfsp
a660d684
KB
118 \param{const unsigned char* }{blue}}
119
120Returns RGB values for a given palette index.
121
122\wxheading{Parameters}
123
124\docparam{pixel}{The palette index.}
125
126\docparam{red}{Receives the red value.}
127
128\docparam{green}{Receives the green value.}
129
130\docparam{blue}{Receives the blue value.}
131
132\wxheading{Return value}
133
134TRUE if the operation was successful.
135
136\wxheading{See also}
137
138\helpref{wxPalette::GetPixel}{wxpalettegetpixel}
139
140\membersection{wxPalette::Ok}\label{wxpaletteok}
141
142\constfunc{bool}{Ok}{\void}
143
144Returns TRUE if palette data is present.
145
146\membersection{wxPalette::operator $=$}\label{wxpaletteassignment}
147
148\func{wxPalette\&}{operator $=$}{\param{const wxPalette\& }{palette}}
149
150Assignment operator, using reference counting. Returns a reference
151to `this'.
152
153\membersection{wxPalette::operator $==$}\label{wxpaletteequals}
154
155\func{bool}{operator $==$}{\param{const wxPalette\& }{palette}}
156
157Equality operator. Two palettes are equal if they contain pointers
158to the same underlying palette data. It does not compare each attribute,
159so two independently-created palettes using the same parameters will
160fail the test.
161
162\membersection{wxPalette::operator $!=$}\label{wxpalettenotequals}
163
164\func{bool}{operator $!=$}{\param{const wxPalette\& }{palette}}
165
166Inequality operator. Two palettes are not equal if they contain pointers
167to different underlying palette data. It does not compare each attribute.
168
169