COLORPALETTE Class Reference

Color palette container. More...

#include <colorpal.h>

List of all members.

Public Member Functions

 COLORPALETTE ()
 COLORPALETTE (const COLORPALETTE &)
 ~COLORPALETTE ()
COLORPALETTEoperator= (const 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 COLOREXTGetItem (int index) const
const MISTRINGGetItemName (int index) const
const COLORGetItemColor (int index, COLORMODEL model=COLORMODEL_COUNT) const
const SIMPLE_ARRAY< WPOINT2D > & GetLayout () const
const MISTRINGGetName () const
int GetNumItems () const
ERRVALUE Load (const FILEPATH &filepath)


Detailed Description

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 (COLORMODEL). Color palettes are stored externally in an XML file.

Definition at line 89 of file colorpal.h.


Constructor & Destructor Documentation

COLORPALETTE::COLORPALETTE  ) 
 

Default constructor.

COLORPALETTE::COLORPALETTE const COLORPALETTE  ) 
 

Copy constructor.

COLORPALETTE::~COLORPALETTE  ) 
 

Destructor.


Member Function Documentation

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.

Returns:
Index to first matching item, -1 if none found.
Parameters:
color  Color to search for

int COLORPALETTE::GetGridHeight  )  const [inline]
 

Get layout grid height in rows.

Definition at line 124 of file colorpal.h.

int COLORPALETTE::GetGridWidth  )  const [inline]
 

Get layout grid width in columns.

Definition at line 128 of file colorpal.h.

const COLOREXT& COLORPALETTE::GetItem int  index  )  const
 

Get palette item.

Parameters:
index  Index to item

const COLOR& COLORPALETTE::GetItemColor int  index,
COLORMODEL  model = COLORMODEL_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.

Parameters:
index  Index to item
model  Preferred color model, default will return first available

Definition at line 144 of file colorpal.h.

const MISTRING& COLORPALETTE::GetItemName int  index  )  const [inline]
 

Get name of specified item.

Returns:
Name as MISTRING.
Parameters:
index  Index to item

Definition at line 138 of file colorpal.h.

const SIMPLE_ARRAY<WPOINT2D>& COLORPALETTE::GetLayout  )  const [inline]
 

Get palette layout for user interface.

Definition at line 150 of file colorpal.h.

const MISTRING& COLORPALETTE::GetName  )  const
 

Get palette name.

int COLORPALETTE::GetNumItems  )  const
 

Get number of palette items.

ERRVALUE COLORPALETTE::Load const FILEPATH filepath  ) 
 

Load palette from (XML) file.

COLORPALETTE& COLORPALETTE::operator= const COLORPALETTE  ) 
 

Assignment.


The documentation for this class was generated from the following file:
Generated on Thu Aug 12 06:26:14 2004 for TNTsdk by doxygen 1.3.4-20031026