#include <wx/palette.h>

It is likely that in the future the only use for palettes within wxWidgets will be for representing colour indeces from images (such as GIF or PNG). The image handlers for these formats have been modified to create a palette if there is such information in the original image file (usually 256 or less colour images). See wxImage for more information.
Predefined objects/pointers: wxNullPalette
Public Member Functions | |
| wxPalette () | |
| wxPalette (const wxPalette &palette) | |
| wxPalette (int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) | |
| virtual | ~wxPalette () |
| bool | Create (int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) |
| virtual int | GetColoursCount () const |
| int | GetPixel (unsigned char red, unsigned char green, unsigned char blue) const |
| bool | GetRGB (int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const |
| virtual bool | IsOk () const |
| wxPalette & | operator= (const wxPalette &palette) |
| wxPalette::wxPalette | ( | ) |
Default constructor.
| wxPalette::wxPalette | ( | const wxPalette & | palette | ) |
| wxPalette::wxPalette | ( | int | n, | |
| const unsigned char * | red, | |||
| const unsigned char * | green, | |||
| const unsigned char * | blue | |||
| ) |
Creates a palette from arrays of size n, one for each red, blue or green component.
| n | The number of indices in the palette. | |
| red | An array of red values. | |
| green | An array of green values. | |
| blue | An array of blue values. |
| virtual wxPalette::~wxPalette | ( | ) | [virtual] |
| bool wxPalette::Create | ( | int | n, | |
| const unsigned char * | red, | |||
| const unsigned char * | green, | |||
| const unsigned char * | blue | |||
| ) |
Creates a palette from arrays of size n, one for each red, blue or green component.
| n | The number of indices in the palette. | |
| red | An array of red values. | |
| green | An array of green values. | |
| blue | An array of blue values. |
| virtual int wxPalette::GetColoursCount | ( | ) | const [virtual] |
Returns number of entries in palette.
| int wxPalette::GetPixel | ( | unsigned char | red, | |
| unsigned char | green, | |||
| unsigned char | blue | |||
| ) | const |
Returns a pixel value (index into the palette) for the given RGB values.
| red | Red value. | |
| green | Green value. | |
| blue | Blue value. |
wxNOT_FOUND for unexpected errors.| bool wxPalette::GetRGB | ( | int | pixel, | |
| unsigned char * | red, | |||
| unsigned char * | green, | |||
| unsigned char * | blue | |||
| ) | const |
Returns RGB values for a given palette index.
| pixel | The palette index. | |
| red | Receives the red value. | |
| green | Receives the green value. | |
| blue | Receives the blue value. |
| virtual bool wxPalette::IsOk | ( | ) | const [virtual] |
Returns true if palette data is present.
Assignment operator, using Reference Counting.
|
[ top ] |