Loading...
Searching...
No Matches
colorMap.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: colorMap.h,v 1.2.18.1 2007/03/25 21:25:40 oliver Exp $
//
#ifndef BALL_VIEW_DATATYPE_COLORMAP_H
#define BALL_VIEW_DATATYPE_COLORMAP_H
#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
# include <BALL/VIEW/DATATYPE/colorRGBA.h>
#endif
#ifndef BALL_MATHS_VECTOR4_H
# include <BALL/MATHS/vector4.h>
#endif
#include <vector>
namespace BALL
{
namespace VIEW
{
class BALL_VIEW_EXPORT ColorMap
: public vector<ColorRGBA>
{
public:
BALL_CREATE(ColorMap)
//@{
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();
void createMapJet(const Size color_number);
void setBaseColors(const ColorRGBA* color_array, Size array_size);
void setNumberOfColors(const Size color_number);
Size getNumberOfColors() const;
void setAlphaBlending(bool blending);
bool getAlphaBlending() const;
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);
virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
protected:
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_;
};
} // namespace VIEW
} // namespace BALL
#endif // BALL_VIEW_DATATYPE_COLORMAP_H
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::VIEW::ColorMap::max_
float max_
Definition colorMap.h:144
BALL::VIEW::ColorMap::ColorMap
ColorMap()
BALL::VIEW::ColorMap::getAlphaBlending
bool getAlphaBlending() const
Returns true if the alpha channel is interpolated between colors, false otherwise.
BALL::VIEW::ColorMap::max_color_
ColorRGBA max_color_
Definition colorMap.h:141
BALL::VIEW::ColorMap::color_number_
Size color_number_
Definition colorMap.h:138
BALL::VIEW::ColorMap::interpolation_boundaries_
vector< Vector4 > interpolation_boundaries_
Definition colorMap.h:146
BALL::VIEW::ColorMap::createMapJet
void createMapJet(const Size color_number)
Create a colormap similar to the "jet" map of matlab.
BALL::VIEW::ColorMap::has_min_max_colors_
bool has_min_max_colors_
Definition colorMap.h:142
BALL::VIEW::ColorMap::setInterpolationBoundaries
bool setInterpolationBoundaries(const vector< Vector4 > &boundaries)
BALL::VIEW::ColorMap::setRange
void setRange(float min, float max)
BALL::VIEW::ColorMap::getNumberOfColors
Size getNumberOfColors() const
Return the number of elements in our color Map.
BALL::VIEW::ColorMap::min_
float min_
Definition colorMap.h:143
BALL::VIEW::ColorMap::setAlphaBlending
void setAlphaBlending(bool blending)
Decides if we should interpolate the alpha channel as well.
BALL::VIEW::ColorMap::min_color_
ColorRGBA min_color_
Definition colorMap.h:140
BALL::VIEW::ColorMap::setBaseColors
void setBaseColors(const ColorRGBA *color_array, Size array_size)
Set the base colors for the interpolation.
BALL::VIEW::ColorMap::setMinMaxColors
void setMinMaxColors(ColorRGBA min, ColorRGBA max)
BALL::VIEW::ColorMap::map
ColorRGBA & map(float value)
BALL::VIEW::ColorMap::setNumberOfColors
void setNumberOfColors(const Size color_number)
Set the number of colors this Map should contain after interpolation.
BALL::VIEW::ColorMap::alpha_blending_
bool alpha_blending_
Definition colorMap.h:139
BALL::VIEW::ColorMap::dump
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
BALL::VIEW::ColorMap::createMap
Size createMap()
BALL::VIEW::ColorRGBA
Definition colorRGBA.h:32
colorRGBA.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13
BALL::Size
BALL_SIZE_TYPE Size
Definition COMMON/global.h:114
BALL::Vector4
TVector4< float > Vector4
Definition vector4.h:815
BALL::Index
BALL_INDEX_TYPE Index
Definition COMMON/global.h:105
std
STL namespace.
vector4.h