Palette Class Reference

#include <Palette.hpp>

List of all members.


Detailed Description

This class defines a simple interpolated palette of colors.

Each entry in the pallete is a color at a certain position. Indexes into this palette can be anywhere within its range and the corresponding color will be interpolated.

Examples:

example13.cpp.

Definition at line 46 of file Palette.hpp.

Public Member Functions

 Palette (const Color &base=Color::BLACK, double imin=0.0, double imax=1.0)
 Constructor.
 Palette (const Palette &p)
 Copy Constructor.
Paletteoperator= (Palette p)
 Copy Operator.
 ~Palette ()
 Destructor.
void setRange (double imin, double imax)
 Set the range Note: Does not change indicies already in the palette.
void setColor (double val, const Color &c)
 Set the color a val to c.
Color getColor (double val) const
 Get the color at val.
double getMin () const
 Get the minimum.
double getMax () const
 Get the maximum.
int getNumColors () const
 Get number of entries.

Protected Member Functions

void clamp (double &val) const
 Clamp the value between the minimum and maximum.

Protected Attributes

double min
 Minimum.
double width
 Width of the palette (such that: max = min+width).
std::list< std::pair< double,
Color > > 
palette
 The (index,color) pairs of the palette.


Constructor & Destructor Documentation

Palette const Color base = Color::BLACK,
double  imin = 0.0,
double  imax = 1.0
 

Constructor.

Parameters:
base Color to put at the extremes of the palette
imin Minimum value of the palette's indicies
imax Maximum value of the palette's indicies

Palette const Palette p  ) 
 

Copy Constructor.

~Palette  )  [inline]
 

Destructor.

Definition at line 64 of file Palette.hpp.


Member Function Documentation

void clamp double &  val  )  const [inline, protected]
 

Clamp the value between the minimum and maximum.

Definition at line 110 of file Palette.hpp.

Color getColor double  val  )  const
 

Get the color at val.

Referenced by ColorMap::ColorMap(), and PNG::plte().

double getMax  )  const [inline]
 

Get the maximum.

Definition at line 94 of file Palette.hpp.

double getMin  )  const [inline]
 

Get the minimum.

Definition at line 91 of file Palette.hpp.

int getNumColors  )  const [inline]
 

Get number of entries.

Definition at line 97 of file Palette.hpp.

Palette& operator= Palette  p  ) 
 

Copy Operator.

void setColor double  val,
const Color c
 

Set the color a val to c.

void setRange double  imin,
double  imax
[inline]
 

Set the range Note: Does not change indicies already in the palette.

Definition at line 70 of file Palette.hpp.


Member Data Documentation

double min [protected]
 

Minimum.

Definition at line 101 of file Palette.hpp.

std::list<std::pair<double,Color> > palette [protected]
 

The (index,color) pairs of the palette.

Definition at line 107 of file Palette.hpp.

double width [protected]
 

Width of the palette (such that: max = min+width).

Definition at line 104 of file Palette.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Feb 7 03:31:25 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1