Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::ColorMap Class Reference
[Format conversion classes used by the color classes]

This class is used to implement a color Map that can be used to map a floating point value into a color. More...

#include <colorMap.h>

List of all members.

Public Member Functions

Constructors and Destructors
 ColorMap () throw ()
 Default constructor.
 ColorMap (Size color_number) throw ()
 Alternative constructor.
 ColorMap (const ColorMap &color_Map) throw ()
 Copy constructor.
 ColorMap (Size size, const ColorRGBA &color, bool alpha_blending=false) throw ()
 Detailed constructor.
 ColorMap (const ColorMap &color_Map, Index from, Index to, bool alpha_blending=false) throw ()
 ColorMap (const ColorRGBA *color_array, Size array_size, bool alpha_blending=false) throw ()
virtual ~ColorMap () throw ()
 Destructor.
Accessors
void createMapJet (const Size color_number) throw ()
 Create a colormap similar to the "jet" map of matlab.
void setBaseColors (const ColorRGBA *color_array, Size array_size) throw ()
 Set the base colors for the interpolation.
void setNumberOfColors (const Size color_number) throw ()
 Set the number of colors this Map should contain after interpolation.
Size getNumberOfColors () const throw ()
 Return the number of elements in our color Map.
void setAlphaBlending (bool blending) throw ()
 Decides if we should interpolate the alpha channel as well.
bool getAlphaBlending () const throw ()
 Returns true if the alpha channel is interpolated between colors, false otherwise.
Size createMap () throw ()
 Build the Map, i.e.
void setMinMaxColors (ColorRGBA min, ColorRGBA max) throw ()
 Sets the colors that are used for values below min and above max.
void setRange (float min, float max) throw ()
 Sets the range used for the mapping.
ColorRGBAmap (float value) throw ()
 Maps value into the color Map.
const ColorRGBAmap (float value) const throw ()
 Maps value into the color Map.
bool setInterpolationBoundaries (const vector< Vector4 > &boundaries) throw ()
 Set the interpolation boundary points.
Debugging and Diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const
 Dump the content to an ostream.

Protected Attributes

Size color_number_
bool alpha_blending_
ColorRGBA min_color_
ColorRGBA max_color_
bool has_min_max_colors_
float min_
float max_
vector< Vector4interpolation_boundaries_


Detailed Description

This class is used to implement a color Map that can be used to map a floating point value into a color.


Constructor & Destructor Documentation

VIEW::ColorMap::ColorMap  )  throw ()
 

Default constructor.

Create an empty instance of ColorMap.

VIEW::ColorMap::ColorMap Size  color_number  )  throw ()
 

Alternative constructor.

Create an instance of ColorMap.

Parameters:
color_number The number of colors the Map will contain.

VIEW::ColorMap::ColorMap const ColorMap color_Map  )  throw ()
 

Copy constructor.

Create a copy of a ColorMap object.

Parameters:
color_Map the color Map to be copied

VIEW::ColorMap::ColorMap Size  size,
const ColorRGBA color,
bool  alpha_blending = false
throw ()
 

Detailed constructor.

Parameters:
size the number of elements in the color Map
color an array of colors, used to initialize the Map
alpha_blending decides whether the alpha channel should be interpolated between colors

virtual VIEW::ColorMap::~ColorMap  )  throw () [virtual]
 

Destructor.


Member Function Documentation

Size VIEW::ColorMap::createMap  )  throw ()
 

Build the Map, i.e.

interpolate between the colors to obtain the desired number of colors. Returns the actual size of the Map after interpolation.

const ColorRGBA& VIEW::ColorMap::map float  value  )  const throw ()
 

Maps value into the color Map.

(const method)

ColorRGBA& VIEW::ColorMap::map float  value  )  throw ()
 

Maps value into the color Map.

bool VIEW::ColorMap::setInterpolationBoundaries const vector< Vector4 > &  boundaries  )  throw ()
 

Set the interpolation boundary points.

This allows different slopes in the interpolation of the R, G, B, and A components. The color vector must be initialized prior to this function. If the number of colors does not match the number of interpolation points we return false and do nothing.

void VIEW::ColorMap::setMinMaxColors ColorRGBA  min,
ColorRGBA  max
throw ()
 

Sets the colors that are used for values below min and above max.

void VIEW::ColorMap::setRange float  min,
float  max
throw ()
 

Sets the range used for the mapping.