1 \section{\class{wxPalette
}}\label{wxpalette
}
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.
6 TODO: topic overview for wxPalette.
8 \wxheading{Derived from
}
10 \helpref{wxGDIObject
}{wxgdiobject
}\\
11 \helpref{wxObject
}{wxobject
}
15 \helpref{wxDC::SetPalette
}{wxdcsetpalette
},
\helpref{wxBitmap
}{wxbitmap
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxPalette::wxPalette
}\label{wxpaletteconstr
}
21 \func{}{wxPalette
}{\void}
25 \func{}{wxPalette
}{\param{const wxPalette\&
}{ palette
}}
27 Copy constructor. This uses reference counting so is a cheap operation.
29 \func{}{wxPalette
}{\param{const wxPalette*
}{ palette
}}
31 Copy constructor. This uses reference counting so is a cheap operation.
33 \func{}{wxPalette
}{\param{int
}{ n
},
\param{const unsigned char*
}{red
},\\
34 \param{const unsigned char*
}{green
},
\param{const unsigned char*
}{blue
}}
36 Creates a palette from arrays of size
{\it n
}, one for each
37 red, blue or green component.
39 \wxheading{Parameters
}
41 \docparam{palette
}{A pointer or reference to the palette to copy.
}
43 \docparam{n
}{The number of indices in the palette.
}
45 \docparam{red
}{An array of red values.
}
47 \docparam{green
}{An array of green values.
}
49 \docparam{blue
}{An array of blue values.
}
53 \helpref{wxPalette::Create
}{wxpalettecreate
}
55 \membersection{wxPalette::
\destruct{wxPalette
}}
57 \func{}{\destruct{wxPalette
}}{\void}
61 \membersection{wxPalette::Create
}\label{wxpalettecreate
}
63 \func{bool
}{Create
}{\param{int
}{ n
},
\param{const unsigned char*
}{red
},
\rtfsp
64 \param{const unsigned char*
}{green
},
\param{const unsigned char*
}{blue
}}
66 Creates a palette from arrays of size
{\it n
}, one for each
67 red, blue or green component.
69 \wxheading{Parameters
}
71 \docparam{n
}{The number of indices in the palette.
}
73 \docparam{red
}{An array of red values.
}
75 \docparam{green
}{An array of green values.
}
77 \docparam{blue
}{An array of blue values.
}
79 \wxheading{Return value
}
81 TRUE if the creation was successful, FALSE otherwise.
85 \helpref{wxPalette::wxPalette
}{wxpaletteconstr
}
87 \membersection{wxPalette::GetPixel
}\label{wxpalettegetpixel
}
89 \constfunc{int
}{GetPixel
}{\param{const unsigned char
}{red
},
\param{const unsigned char
}{green
},
\rtfsp
90 \param{const unsigned char
}{blue
}}
92 Returns a pixel value (index into the palette) for the given RGB values.
94 \wxheading{Parameters
}
96 \docparam{red
}{Red value.
}
98 \docparam{green
}{Green value.
}
100 \docparam{blue
}{Blue value.
}
102 \wxheading{Return value
}
104 The nearest palette index.
108 \helpref{wxPalette::GetRGB
}{wxpalettegetrgb
}
110 \membersection{wxPalette::GetRGB
}\label{wxpalettegetrgb
}
112 \constfunc{bool
}{GetPixel
}{\param{int
}{ pixel
},
\param{const unsigned char*
}{red
},
\param{const unsigned char*
}{green
},
\rtfsp
113 \param{const unsigned char*
}{blue
}}
115 Returns RGB values for a given palette index.
117 \wxheading{Parameters
}
119 \docparam{pixel
}{The palette index.
}
121 \docparam{red
}{Receives the red value.
}
123 \docparam{green
}{Receives the green value.
}
125 \docparam{blue
}{Receives the blue value.
}
127 \wxheading{Return value
}
129 TRUE if the operation was successful.
133 \helpref{wxPalette::GetPixel
}{wxpalettegetpixel
}
135 \membersection{wxPalette::Ok
}\label{wxpaletteok
}
137 \constfunc{bool
}{Ok
}{\void}
139 Returns TRUE if palette data is present.
141 \membersection{wxPalette::operator $=$
}\label{wxpaletteassignment
}
143 \func{wxPalette\&
}{operator $=$
}{\param{const wxPalette\&
}{palette
}}
145 Assignment operator, using reference counting. Returns a reference
148 \membersection{wxPalette::operator $==$
}\label{wxpaletteequals
}
150 \func{bool
}{operator $==$
}{\param{const wxPalette\&
}{palette
}}
152 Equality operator. Two palettes are equal if they contain pointers
153 to the same underlying palette data. It does not compare each attribute,
154 so two independently-created palettes using the same parameters will
157 \membersection{wxPalette::operator $!=$
}\label{wxpalettenotequals
}
159 \func{bool
}{operator $!=$
}{\param{const wxPalette\&
}{palette
}}
161 Inequality operator. Two palettes are not equal if they contain pointers
162 to different underlying palette data. It does not compare each attribute.