DGtal  1.5.beta
GrayscaleColorMap.h
1 
17 #pragma once
18 
31 #if defined(GrayscaleColorMap_RECURSES)
32 #error Recursive header files inclusion detected in GrayscaleColorMap.h
33 #else // defined(GrayscaleColorMap_RECURSES)
35 #define GrayscaleColorMap_RECURSES
36 
37 #if !defined GrayscaleColorMap_h
39 #define GrayscaleColorMap_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 
48 #ifdef _MSC_VER
49 #if defined( max )
50 #undef max
51 #define _HAS_MSVC_MAX_ true
52 #endif
53 #if defined( min )
54 #undef min
55 #define _HAS_MSVC_MIN_ true
56 #endif
57 #endif
58 
60 
61 namespace DGtal
62 {
63 
65  // template class GrayscaleColorMap
92  template <typename PValue>
94  {
95 
96  public:
97 
98  typedef PValue Value;
99 
100  // ----------------------- Standard services ------------------------------
101  public:
102 
109  GrayscaleColorMap( const PValue & min,
110  const PValue & max );
111 
112 
120  Color operator()( const PValue & value ) const;
121 
126 
132 
139 
140  // ----------------------- Interface --------------------------------------
141  public:
142 
147  void selfDisplay ( std::ostream & out ) const;
148 
153  bool isValid() const;
154 
160  const PValue & min() const;
161 
167  const PValue & max() const;
168 
169  // ----------------------- Static methods ---------------------------------
170 
171 
181  static Color getColor( const PValue & min,
182  const PValue & max,
183  const PValue & value );
184 
185  // ------------------------- Protected Datas ------------------------------
186  private:
187 
188  // ------------------------- Private Datas --------------------------------
189  private:
190 
191  // ------------------------- Hidden services ------------------------------
192  protected:
193 
194  PValue myMin;
195  PValue myMax;
202 
203  // ------------------------- Internals ------------------------------------
204  private:
205 
206  }; // end of class GrayscaleColorMap
207 
208 
215  template <typename PValue>
216  std::ostream&
217  operator<< ( std::ostream & out, const GrayscaleColorMap<PValue> & object );
218 
219 } // namespace DGtal
220 
221 
223 // Includes inline functions.
224 #include "DGtal/io/colormaps/GrayscaleColorMap.ih"
225 
226 // //
228 
229 #endif // !defined GrayscaleColorMap_h
230 
231 #undef GrayscaleColorMap_RECURSES
232 #endif // else defined(GrayscaleColorMap_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 gray l...
GrayscaleColorMap & operator=(const GrayscaleColorMap &other)
void selfDisplay(std::ostream &out) const
static Color getColor(const PValue &min, const PValue &max, const PValue &value)
Color operator()(const PValue &value) const
GrayscaleColorMap(const GrayscaleColorMap &other)
const PValue & min() const
const PValue & max() const
GrayscaleColorMap(const PValue &min, const PValue &max)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)