DGtal 0.3.0

CColorMap.h

Go to the documentation of this file.
00001 
00017 #pragma once
00018 
00031 #if defined(CColorMap_RECURSES)
00032 #error Recursive header files inclusion detected in CColorMap.h
00033 #else // defined(CColorMap_RECURSES)
00034 
00035 #define CColorMap_RECURSES
00036 
00037 #if !defined CColorMap_h
00038 
00039 #define CColorMap_h
00040 
00042 // Inclusions
00043 #include <iostream>
00044 #include "boost/concept_check.hpp"
00045 #include "DGtal/utils/ConceptUtils.h"
00046 #include "DGtal/kernel/images/CValue.h"
00047 #include "DGtal/base/Common.h"
00048 #include "Board/Color.h"
00050 
00051 namespace DGtal
00052 {
00053 
00055   // class CColorMap
00095   template <typename CMap>
00096   struct CColorMap
00097   {
00098     // ----------------------- Concept checks ------------------------------
00099   public:
00100     
00101     typedef typename CMap::Value Value;
00102     
00103     BOOST_CONCEPT_ASSERT(( CValue<Value> ));
00104     
00105     BOOST_CONCEPT_USAGE( CColorMap )
00106     {
00107       CMap myCMap( myMin, myMax );
00108       // operator() exists, takes a Value, and returns a LibBoard::Color.
00109       ConceptUtils::sameType( myColor, myCMap.operator()( myValue ) );
00110     }
00111     
00112     // ------------------------- Private Datas --------------------------------
00113   private:
00114     
00115     // ------------------------- Internals ------------------------------------
00116   private:
00117     LibBoard::Color myColor;
00118     Value myMin, myMax, myValue;    
00119   }; // end of concept CColorMap
00120   
00121 } // namespace DGtal
00122 
00123 
00125 // Includes inline functions.
00126 #include "DGtal/io/colormaps/CColorMap.ih"
00127 
00128 //                                                                           //
00130 
00131 #endif // !defined CColorMap_h
00132 
00133 #undef CColorMap_RECURSES
00134 #endif // else defined(CColorMap_RECURSES)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines