Loading...
Searching...
No Matches
BALL::VIEW::ColorMap Class Reference
Visualisation » Datatypes for the VIEW framework » Format conversion classes used by the color classes

`#include <BALL/VIEW/DATATYPE/colorMap.h>`

Inheritance diagram for BALL::VIEW::ColorMap:

## Public Member Functions

Constructors and Destructors
| ColorMap ()
| ColorMap (Size color_number)
| ColorMap (const ColorMap &color_Map)
| ColorMap (Size size, const ColorRGBA &color, bool alpha_blending=false)
| ColorMap (const ColorMap &color_Map, Index from, Index to, bool alpha_blending=false)
| ColorMap (const ColorRGBA *color_array, Size array_size, bool alpha_blending=false)
virtual | ~ColorMap ()
Accessors
void | createMapJet (const Size color_number)
| Create a colormap similar to the "jet" map of matlab.
void | setBaseColors (const ColorRGBA *color_array, Size array_size)
| Set the base colors for the interpolation.
void | setNumberOfColors (const Size color_number)
| Set the number of colors this Map should contain after interpolation.
Size | getNumberOfColors () const
| Return the number of elements in our color Map.
void | setAlphaBlending (bool blending)
| Decides if we should interpolate the alpha channel as well.
bool | getAlphaBlending () const
| Returns true if the alpha channel is interpolated between colors, false otherwise.
Size | createMap ()
void | setMinMaxColors (ColorRGBA min, ColorRGBA max)
void | setRange (float min, float max)
ColorRGBA & | map (float value)
const ColorRGBA & | map (float value) const
bool | setInterpolationBoundaries (const vector< Vector4 > &boundaries)

## Debugging and Diagnostics

Size | color_number_
bool | alpha_blending_
ColorRGBA | min_color_
ColorRGBA | max_color_
bool | has_min_max_colors_
float | min_
float | max_
vector< Vector4 > | interpolation_boundaries_
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const

## Detailed Description

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

Definition at line 28 of file colorMap.h.

## Constructor & Destructor Documentation

## ColorMap() [1/6]

BALL::VIEW::ColorMap::ColorMap | ( |  | ) |

Default constructor. Create an empty instance of ColorMap.

## ColorMap() [2/6]

BALL::VIEW::ColorMap::ColorMap | ( | Size | color_number | ) |

Alternative constructor. Create an instance of ColorMap.

Parameters

  color_number | The number of colors the Map will contain.

## ColorMap() [3/6]

BALL::VIEW::ColorMap::ColorMap | ( | const ColorMap & | color_Map | ) |

Copy constructor. Create a copy of a ColorMap object.

Parameters

  color_Map | the color Map to be copied

## ColorMap() [4/6]

BALL::VIEW::ColorMap::ColorMap | ( | Size | size,
|  | const ColorRGBA & | color,
|  | bool | alpha_blending = false )

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

## ColorMap() [5/6]

BALL::VIEW::ColorMap::ColorMap | ( | const ColorMap & | color_Map,
|  | Index | from,
|  | Index | to,
|  | bool | alpha_blending = false )

## ColorMap() [6/6]

BALL::VIEW::ColorMap::ColorMap | ( | const ColorRGBA * | color_array,
|  | Size | array_size,
|  | bool | alpha_blending = false )

## ~ColorMap()

virtual BALL::VIEW::ColorMap::~ColorMap | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## createMap()

Size BALL::VIEW::ColorMap::createMap | ( |  | ) |

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.

## createMapJet()

void BALL::VIEW::ColorMap::createMapJet | ( | const Size | color_number | ) |

Create a colormap similar to the "jet" map of matlab.

## dump()

virtual void BALL::VIEW::ColorMap::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

virtual

Dump the content to an ostream

## getAlphaBlending()

bool BALL::VIEW::ColorMap::getAlphaBlending | ( |  | ) | const

Returns true if the alpha channel is interpolated between colors, false otherwise.

## getNumberOfColors()

Size BALL::VIEW::ColorMap::getNumberOfColors | ( |  | ) | const

Return the number of elements in our color Map.

## map() [1/2]

ColorRGBA & BALL::VIEW::ColorMap::map | ( | float | value | ) |

Maps value into the color Map.

## map() [2/2]

const ColorRGBA & BALL::VIEW::ColorMap::map | ( | float | value | ) | const

Maps value into the color Map. (const method)

## setAlphaBlending()

void BALL::VIEW::ColorMap::setAlphaBlending | ( | bool | blending | ) |

Decides if we should interpolate the alpha channel as well.

## setBaseColors()

void BALL::VIEW::ColorMap::setBaseColors | ( | const ColorRGBA * | color_array,
|  | Size | array_size )

Set the base colors for the interpolation.

## setInterpolationBoundaries()

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

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.

## setMinMaxColors()

void BALL::VIEW::ColorMap::setMinMaxColors | ( | ColorRGBA | min,
|  | ColorRGBA | max )

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

## setNumberOfColors()

void BALL::VIEW::ColorMap::setNumberOfColors | ( | const Size | color_number | ) |

Set the number of colors this Map should contain after interpolation.

## setRange()

void BALL::VIEW::ColorMap::setRange | ( | float | min,
|  | float | max )

Sets the range used for the mapping.

## Member Data Documentation

## alpha_blending_

bool BALL::VIEW::ColorMap::alpha_blending_

protected

Definition at line 139 of file colorMap.h.

## color_number_

Size BALL::VIEW::ColorMap::color_number_

protected

Definition at line 138 of file colorMap.h.

## has_min_max_colors_

bool BALL::VIEW::ColorMap::has_min_max_colors_

protected

Definition at line 142 of file colorMap.h.

## interpolation_boundaries_

vector<Vector4> BALL::VIEW::ColorMap::interpolation_boundaries_

protected

Definition at line 146 of file colorMap.h.

## max_

float BALL::VIEW::ColorMap::max_

protected

Definition at line 144 of file colorMap.h.

## max_color_

ColorRGBA BALL::VIEW::ColorMap::max_color_

protected

Definition at line 141 of file colorMap.h.

## min_

float BALL::VIEW::ColorMap::min_

protected

Definition at line 143 of file colorMap.h.

## min_color_

ColorRGBA BALL::VIEW::ColorMap::min_color_

protected

Definition at line 140 of file colorMap.h.