DGtal  1.5.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)
35 #define HueShadeColorMap_RECURSES
36 
37 #if !defined HueShadeColorMap_h
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 
130 
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)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
HueShadeColorMap & operator=(const HueShadeColorMap &other)
void setCycles(int cycles)
Color operator()(const PValue &value) const
const PValue & min() const
const PValue & max() const
HueShadeColorMap(const HueShadeColorMap &other)
HueShadeColorMap(const PValue &min, const PValue &max, const unsigned int cycles=DefaultCycles)
static Color getColor(const unsigned int cycles, const PValue &min, const PValue &max, const PValue &value)
void selfDisplay(std::ostream &out) const
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)