DGtal  0.9.2
CColorMap.h
1 
17 #pragma once
18 
31 #if defined(CColorMap_RECURSES)
32 #error Recursive header files inclusion detected in CColorMap.h
33 #else // defined(CColorMap_RECURSES)
34 
35 #define CColorMap_RECURSES
36 
37 #if !defined CColorMap_h
38 
39 #define CColorMap_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "boost/concept_check.hpp"
45 #include "DGtal/base/ConceptUtils.h"
46 #include "DGtal/base/CLabel.h"
47 #include "DGtal/base/Common.h"
48 #include "DGtal/io/Color.h"
50 
51 namespace DGtal
52 {
53 namespace concepts
54  {
56  // class CColorMap
92  template <typename CMap>
93  struct CColorMap
94  {
95  // ----------------------- Concept checks ------------------------------
96  public:
97 
98  typedef typename CMap::Value Value;
99 
101 
103  {
104  CMap myCMap( myMin, myMax );
105  // operator() exists, takes a Value, and returns a LibBoard::Color.
106  ConceptUtils::sameType( myColor, myCMap.operator()( myValue ) );
107  }
108 
109  // ------------------------- Private Datas --------------------------------
110  private:
111 
112  // ------------------------- Internals ------------------------------------
113  private:
115  Value myMin, myMax, myValue;
116  }; // end of concept CColorMap
117  }//namespace concepts
118 } // namespace DGtal
119 
120 
121 // //
123 
124 #endif // !defined CColorMap_h
125 
126 #undef CColorMap_RECURSES
127 #endif // else defined(CColorMap_RECURSES)
Aim: Define the concept of DGtal labels. Models of CLabel can be default-constructible, assignable and equality comparable.
Definition: CLabel.h:91
BOOST_CONCEPT_USAGE(CColorMap)
Definition: CColorMap.h:102
void sameType(const T &t1, const T &t2)
BOOST_CONCEPT_ASSERT((CLabel< Value >))
DGtal is the top-level namespace which contains all DGtal functions and types.
Structure representing an RGB triple with alpha component.
Definition: Color.h:66
Aim: Defines the concept describing a color map. A color map converts a value within a given range in...
Definition: CColorMap.h:93