#include <colorpal.h>
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. | |
| ColorPalette & | operator= (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. | |
The first color is black. White is considered a background color and thus is not provided.
Definition at line 44 of file colorpal.h.
| 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] |
| ColorPalette::ColorPalette | ( | const ColorPalette & | src | ) | [inline, private] |
| 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.
| ColorPalette & ColorPalette::operator= | ( | const ColorPalette & | src | ) | [inline, private] |
| 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().
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().
1.5.3