Color palette container. More...
#include <mi32/colorpal.h>
Public Member Functions | |
| COLORPALETTE (const COLORPALETTE &) | |
| COLORPALETTE () | |
| ~COLORPALETTE () | |
| void | ComputeGridFromIndex (int index, int &x, int &y) const |
| int | ComputeIndexFromGrid (int x, int y) const |
| int | FindColor (const COLOR &color) const |
| int | GetGridHeight () const |
| int | GetGridWidth () const |
| const COLOREXT & | GetItem (int index) const |
| const COLOR & | GetItemColor (int index, COLOR::MODEL model=COLOR::MODEL_COUNT) const |
| const MISTRING & | GetItemName (int index) const |
| const SIMPLE_ARRAY< WPOINT2D > & | GetLayout () const |
| const MISTRING & | GetName () const |
| int | GetNumItems () const |
| ERRVALUE | Load (const FILEPATH &filepath) |
| COLORPALETTE & | operator= (const COLORPALETTE &) |
Color palette container.
A color palette contains a set of items. Each item can have a name as well as a list of one or more representations of a particular color in various color models (COLOR::MODEL). Color palettes are stored externally in an XML file.
| COLORPALETTE::COLORPALETTE | ( | ) |
Default constructor.
| COLORPALETTE::COLORPALETTE | ( | const COLORPALETTE & | ) |
Copy constructor.
| COLORPALETTE::~COLORPALETTE | ( | ) |
Destructor.
| void COLORPALETTE::ComputeGridFromIndex | ( | int | index, | |
| int & | x, | |||
| int & | y | |||
| ) | const |
Compute grid x,y from palette index based on layout.
| int COLORPALETTE::ComputeIndexFromGrid | ( | int | x, | |
| int | y | |||
| ) | const |
Compute palette index from grid x,y based on layout.
| int COLORPALETTE::FindColor | ( | const COLOR & | color | ) | const |
Find matching color in palette.
| color | Color to search for |
| int COLORPALETTE::GetGridHeight | ( | ) | const [inline] |
Get layout grid height in rows.
| int COLORPALETTE::GetGridWidth | ( | ) | const [inline] |
Get layout grid width in columns.
| const COLOREXT& COLORPALETTE::GetItem | ( | int | index | ) | const |
Get palette item.
| index | Index to item |
| const COLOR& COLORPALETTE::GetItemColor | ( | int | index, | |
| COLOR::MODEL | model = COLOR::MODEL_COUNT | |||
| ) | const [inline] |
Get color of specified item.
If the color is not available in the specified model it will be returned in the first available model.
| index | Index to item | |
| model | Preferred color model, default will return first available |
| const MISTRING& COLORPALETTE::GetItemName | ( | int | index | ) | const [inline] |
| const SIMPLE_ARRAY<WPOINT2D>& COLORPALETTE::GetLayout | ( | ) | const [inline] |
Get palette layout for user interface.
| const MISTRING& COLORPALETTE::GetName | ( | ) | const |
Get palette name.
| int COLORPALETTE::GetNumItems | ( | ) | const |
Get number of palette items.
| COLORPALETTE& COLORPALETTE::operator= | ( | const COLORPALETTE & | ) |
Assignment.
1.6.1