COLORPALETTE Class Reference

Color palette container. More...

#include <mi32/colorpal.h>

List of all members.

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

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


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.

int COLORPALETTE::GetGridWidth (  )  const [inline]

Get layout grid width in columns.

const COLOREXT& COLORPALETTE::GetItem ( int  index  )  const

Get palette item.

Parameters:
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.

Parameters:
index Index to item
model Preferred color model, default will return first available
const MISTRING& COLORPALETTE::GetItemName ( int  index  )  const [inline]

Get name of specified item.

Returns:
Name as MISTRING.
Parameters:
index Index to item
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.

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 Sun Oct 7 21:33:16 2012 for TNTsdk 2012 by  doxygen 1.6.1