ColorPalette Class Reference

Provides a palette of distinct RGB colors. More...

#include <colorpal.h>

List of all members.

Public Member Functions

 ColorPalette (int _n, bool grays=false)
 The constructor of a palette of a prescribed size.
 ~ColorPalette ()
 The destructor.
int operator[] (int i) const
 Returns the color with the given number.

Private Member Functions

 ColorPalette (const ColorPalette &src)
 The copy constructor is not allowed.
ColorPaletteoperator= (const ColorPalette &src)
 The assignment operator is not allowed.

Static Private Member Functions

static int generateComponent (int bitMask)
 Generates a color component based on the bit mask.

Private Attributes

int n
 The number of colors in the palette.
int * colors
 The RBG colors in the palette.


Detailed Description

Provides a palette of distinct RGB colors.

The first color is black. White is considered a background color and thus is not provided.

Definition at line 44 of file colorpal.h.


Constructor & Destructor Documentation

ColorPalette::ColorPalette ( int  _n,
bool  grays = false 
) [inline]

The constructor of a palette of a prescribed size.

Definition at line 92 of file colorpal.h.

References colors, generateComponent(), and n.

ColorPalette::~ColorPalette (  )  [inline]

The destructor.

Definition at line 155 of file colorpal.h.

References colors.

ColorPalette::ColorPalette ( const ColorPalette src  )  [inline, private]

The copy constructor is not allowed.

Definition at line 162 of file colorpal.h.


Member Function Documentation

int ColorPalette::operator[] ( int  i  )  const [inline]

Returns the color with the given number.

The color is encoded as 0xRRGGBB.

Definition at line 172 of file colorpal.h.

References colors, and n.

ColorPalette & ColorPalette::operator= ( const ColorPalette src  )  [inline, private]

The assignment operator is not allowed.

Definition at line 167 of file colorpal.h.

int ColorPalette::generateComponent ( int  bitMask  )  [inline, static, private]

Generates a color component based on the bit mask.

The nonzero bits are every 3 locations in the mask.

Definition at line 78 of file colorpal.h.

Referenced by ColorPalette().


Member Data Documentation

int ColorPalette::n [private]

The number of colors in the palette.

Definition at line 69 of file colorpal.h.

Referenced by ColorPalette(), and operator[]().

int* ColorPalette::colors [private]

The RBG colors in the palette.

Definition at line 72 of file colorpal.h.

Referenced by ColorPalette(), operator[](), and ~ColorPalette().


The documentation for this class was generated from the following file:
Generated on Sun Mar 28 17:47:58 2010 for The Conley-Morse Graphs Software by  doxygen 1.5.3