A palette is a table that maps pixel values to RGB colours.
It allows the colours of a low-depth bitmap, for example, to be mapped to the available colours in a display. The notion of palettes is becoming more and more obsolete nowadays and only the MSW port is still using a native palette. All other ports use generic code which is basically just an array of colours.
It is likely that in the future the only use for palettes within wxWidgets will be for representing colour indices 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
- See Also
- wxDC::SetPalette(), wxBitmap
|
| wxPalette () |
| Default constructor.
|
|
| wxPalette (const wxPalette &palette) |
| Copy constructor, uses Reference Counting.
|
|
| 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.
|
|
virtual | ~wxPalette () |
| Destructor.
|
|
bool | 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.
|
|
virtual int | GetColoursCount () const |
| Returns number of entries in palette.
|
|
int | GetPixel (unsigned char red, unsigned char green, unsigned char blue) const |
| Returns a pixel value (index into the palette) for the given RGB values.
|
|
bool | GetRGB (int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const |
| Returns RGB values for a given palette index.
|
|
virtual bool | IsOk () const |
| Returns true if palette data is present.
|
|
wxPalette & | operator= (const wxPalette &palette) |
| Assignment operator, using Reference Counting.
|
|
| wxGDIObject () |
| Default constructor.
|
|
| wxObject () |
| Default ctor; initializes to NULL the internal reference data.
|
|
| wxObject (const wxObject &other) |
| Copy ctor.
|
|
virtual | ~wxObject () |
| Destructor.
|
|
virtual wxClassInfo * | GetClassInfo () const |
| This virtual function is redefined for every class that requires run-time type information, when using the wxDECLARE_CLASS macro (or similar).
|
|
wxObjectRefData * | GetRefData () const |
| Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
|
|
bool | IsKindOf (const wxClassInfo *info) const |
| Determines whether this class is a subclass of (or the same class as) the given class.
|
|
bool | IsSameAs (const wxObject &obj) const |
| Returns true if this object has the same data pointer as obj.
|
|
void | Ref (const wxObject &clone) |
| Makes this object refer to the data in clone.
|
|
void | SetRefData (wxObjectRefData *data) |
| Sets the wxObject::m_refData pointer.
|
|
void | UnRef () |
| Decrements the reference count in the associated data, and if it is zero, deletes the data.
|
|
void | UnShare () |
| This is the same of AllocExclusive() but this method is public.
|
|
void | operator delete (void *buf) |
| The delete operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|
void * | operator new (size_t size, const wxString &filename=NULL, int lineNum=0) |
| The new operator is defined for debugging versions of the library only, when the identifier WXDEBUG is defined.
|
|