BALL 1.5.0
Loading...
Searching...
No Matches
colorMap.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: colorMap.h,v 1.2.18.1 2007/03/25 21:25:40 oliver Exp $
5//
6
7#ifndef BALL_VIEW_DATATYPE_COLORMAP_H
8#define BALL_VIEW_DATATYPE_COLORMAP_H
9
10#ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
12#endif
13
14#ifndef BALL_MATHS_VECTOR4_H
15# include <BALL/MATHS/vector4.h>
16#endif
17
18#include <vector>
19
20namespace BALL
21{
22 namespace VIEW
23 {
29 : public vector<ColorRGBA>
30 {
31 public:
32
34
35
37 //@{
38
39
43
48 ColorMap(Size color_number);
49
54 ColorMap(const ColorMap& color_Map);
55
61 ColorMap(Size size, const ColorRGBA& color, bool alpha_blending=false);
62
65 ColorMap(const ColorMap& color_Map, Index from, Index to, bool alpha_blending=false);
66
69 ColorMap(const ColorRGBA* color_array, Size array_size, bool alpha_blending=false);
70
73 virtual ~ColorMap();
75
79
81 void createMapJet(const Size color_number);
82
84 void setBaseColors(const ColorRGBA* color_array, Size array_size);
85
87 void setNumberOfColors(const Size color_number);
88
91
93 void setAlphaBlending(bool blending);
94
96 bool getAlphaBlending() const;
97
102
106
109 void setRange(float min, float max);
110
113 ColorRGBA& map(float value);
114
117 const ColorRGBA& map(float value) const;
118
124 bool setInterpolationBoundaries(const vector<Vector4>& boundaries);
125
127
130
133 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
135
136 protected:
137
143 float min_;
144 float max_;
145
147 };
148
149 } // namespace VIEW
150} // namespace BALL
151
152#endif // BALL_VIEW_DATATYPE_COLORMAP_H
#define BALL_VIEW_EXPORT
bool getAlphaBlending() const
Returns true if the alpha channel is interpolated between colors, false otherwise.
ColorRGBA max_color_
Definition colorMap.h:141
vector< Vector4 > interpolation_boundaries_
Definition colorMap.h:146
void createMapJet(const Size color_number)
Create a colormap similar to the "jet" map of matlab.
bool setInterpolationBoundaries(const vector< Vector4 > &boundaries)
void setRange(float min, float max)
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.
ColorRGBA min_color_
Definition colorMap.h:140
void setBaseColors(const ColorRGBA *color_array, Size array_size)
Set the base colors for the interpolation.
void setMinMaxColors(ColorRGBA min, ColorRGBA max)
ColorRGBA & map(float value)
void setNumberOfColors(const Size color_number)
Set the number of colors this Map should contain after interpolation.
virtual void dump(std::ostream &s=std::cout, Size depth=0) const
#define BALL_CREATE(name)
Definition create.h:62
BALL_SIZE_TYPE Size
TVector4< float > Vector4
Definition vector4.h:815
BALL_INDEX_TYPE Index
STL namespace.