BALL  1.5.0
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 
20 namespace BALL
21 {
22  namespace VIEW
23  {
29  : public vector<ColorRGBA>
30  {
31  public:
32 
34 
35 
38 
42  ColorMap();
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 
90  Size getNumberOfColors() const;
91 
93  void setAlphaBlending(bool blending);
94 
96  bool getAlphaBlending() const;
97 
101  Size createMap();
102 
105  void setMinMaxColors(ColorRGBA min, ColorRGBA max);
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 
146  vector<Vector4> interpolation_boundaries_;
147  };
148 
149  } // namespace VIEW
150 } // namespace BALL
151 
152 #endif // BALL_VIEW_DATATYPE_COLORMAP_H
ColorRGBA max_color_
Definition: colorMap.h:141
ColorRGBA min_color_
Definition: colorMap.h:140
T max(const T &a, const T &b)
Definition: MATHS/common.h:75
vector< Vector4 > interpolation_boundaries_
Definition: colorMap.h:146
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
T min(const T &a, const T &b)
Definition: MATHS/common.h:102
Definition: constants.h:12
#define BALL_CREATE(name)
Definition: create.h:62