DGtal  1.3.beta
HueShadeColorMap.h
1 
17 #pragma once
18 
31 #if defined(HueShadeColorMap_RECURSES)
32 #error Recursive header files inclusion detected in HueShadeColorMap.h
33 #else // defined(HueShadeColorMap_RECURSES)
34 
35 #define HueShadeColorMap_RECURSES
36 
37 #if !defined HueShadeColorMap_h
38 
39 #define HueShadeColorMap_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "Board/Board.h"
46 #include "DGtal/io/Color.h"
47 
49 
50 namespace DGtal
51 {
52 
54  // template class HueShadeColorMap
89  template <typename PValue, int DefaultCycles = 1 >
91  {
92 
93  public:
94 
95  typedef PValue Value;
96 
97  // ----------------------- Standard services ------------------------------
98  public:
99 
107  HueShadeColorMap( const PValue & min,
108  const PValue & max,
109  const unsigned int cycles = DefaultCycles );
110 
118  Color operator()( const PValue & value ) const;
119 
124 
129  HueShadeColorMap ( const HueShadeColorMap & other );
130 
136  HueShadeColorMap & operator= ( const HueShadeColorMap & other );
137 
138  // ----------------------- Interface --------------------------------------
139  public:
140 
145  void selfDisplay ( std::ostream & out ) const;
146 
151  bool isValid() const;
152 
158  const PValue & min() const;
159 
165  const PValue & max() const;
166 
167 
173  void setCycles( int cycles );
174 
175  // ----------------------- Static methods ---------------------------------
176 
177 
188  static Color getColor( const unsigned int cycles,
189  const PValue & min,
190  const PValue & max,
191  const PValue & value );
192 
193  // ------------------------- Protected Datas ------------------------------
194  private:
195 
196  // ------------------------- Private Datas --------------------------------
197  private:
198 
199  // ------------------------- Hidden services ------------------------------
200  protected:
201 
202  PValue myMin;
203  PValue myMax;
204  unsigned int myCycles;
211 
212  // ------------------------- Internals ------------------------------------
213  private:
214 
215 
216 
217  }; // end of class HueShadeColorMap
218 
219 
226  template <typename PValue, int DefaultCycles >
227  std::ostream&
228  operator<< ( std::ostream & out, const HueShadeColorMap<PValue,DefaultCycles> & object );
229 
230 } // namespace DGtal
231 
232 
234 // Includes inline functions.
235 #include "DGtal/io/colormaps/HueShadeColorMap.ih"
236 
237 // //
239 
240 #endif // !defined HueShadeColorMap_h
241 
242 #undef HueShadeColorMap_RECURSES
243 #endif // else defined(HueShadeColorMap_RECURSES)
DGtal::HueShadeColorMap::setCycles
void setCycles(int cycles)
DGtal::Color
Structure representing an RGB triple with alpha component.
Definition: Color.h:67
DGtal::HueShadeColorMap
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Definition: HueShadeColorMap.h:90
DGtal::HueShadeColorMap::HueShadeColorMap
HueShadeColorMap()
DGtal::HueShadeColorMap::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::HueShadeColorMap::operator=
HueShadeColorMap & operator=(const HueShadeColorMap &other)
DGtal::HueShadeColorMap::myMin
PValue myMin
Definition: HueShadeColorMap.h:202
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::HueShadeColorMap::isValid
bool isValid() const
DGtal::HueShadeColorMap::Value
PValue Value
Definition: HueShadeColorMap.h:95
DGtal::HueShadeColorMap::min
const PValue & min() const
DGtal::HueShadeColorMap::getColor
static Color getColor(const unsigned int cycles, const PValue &min, const PValue &max, const PValue &value)
DGtal::HueShadeColorMap::operator()
Color operator()(const PValue &value) const
DGtal::HueShadeColorMap::myCycles
unsigned int myCycles
Definition: HueShadeColorMap.h:204
DGtal::HueShadeColorMap::myMax
PValue myMax
Definition: HueShadeColorMap.h:203
DGtal::HueShadeColorMap::max
const PValue & max() const
DGtal::HueShadeColorMap::~HueShadeColorMap
~HueShadeColorMap()