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