DGtal  1.5.beta
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)
35 #define CColorMap_RECURSES
36 
37 #if !defined CColorMap_h
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:
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)
Structure representing an RGB triple with alpha component.
Definition: Color.h:68
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Defines the concept describing a color map. A color map converts a value within a given range in...
Definition: CColorMap.h:94
BOOST_CONCEPT_USAGE(CColorMap)
Definition: CColorMap.h:102
BOOST_CONCEPT_ASSERT((CLabel< Value >))
Aim: Define the concept of DGtal labels. Models of CLabel can be default-constructible,...
Definition: CLabel.h:93