A class representing a logical palette of colours.
![]() | PPalette () Create a new empty palette. |
![]() | Compare ( const PObject & obj ) const Compare two palette objects for equality. |
![]() | GetSize () const Get the current size of the palette, ie the total number of colours added to this logical palette. |
![]() | SetSize ( PINDEX newSize ) Set the new size of the palette. |
![]() | AddColour ( const PColour & colour ) Add a colour specification into the palette, if the colour already exists in the palette, no new entry is added. |
![]() | RemoveColour ( const PColour & colour ) Remove from the palette the colour at the specified index or of the exact RGB value specified. |
![]() | HasColour ( const PColour & colour ) const Determine if the palette contains an exact match for the colour |
![]() | GetIndex ( const PColour & colour ) const Locate the index in the palette of the nearest match to the specified colour that is in the palette. |
![]() | GetColour ( PINDEX indx ) const Get the colour specification for the specified index value. |
![]() | SetColour ( PINDEX idx, const PColour & colour ) Set a colour specification into the palette at the specified index. |
![]() | Overrides from class PObject |
![]() | Overrides from class PContainer |
![]() | New functions for class |
Construction
Common functions for containers
Run Time Type functions
Comparison functions
I/O functions
Miscellaneous functions
A class representing a logical palette of colours.A palette is a look up table for converting an index into a full RGB colour specification. A palette typically has a small number of colours eg 16 or 256.
Note when a colour is removed any indexes to colours after the remove
one will correspond to a different colour that before, ie all colours
are moved up one entry in the palettes ärray" of colours.
Note that of there is more than one colour that is identical to the
one being searched for, the particular matching index that is returned
is not defined, it could be any one of them.
Overrides from class PObject
virtual Comparison Compare( const PObject & obj ) const
Overrides from class PContainer
virtual PINDEX GetSize() const
virtual BOOL SetSize( PINDEX newSize )
New functions for class
PINDEX AddColour( const PColour & colour )
BOOL RemoveColour( const PColour & colour )
BOOL HasColour( const PColour & colour ) const
PINDEX GetIndex( const PColour & colour ) const
PColour GetColour( PINDEX indx ) const
BOOL SetColour( PINDEX idx, const PColour & colour )
colour - New colour to set at index in palette.
Alphabetic index HTML hierarchy of classes or Java