DGtal  1.2.0
PPMReader.h
1 
17 #pragma once
18 
31 #if defined(PPMReader_RECURSES)
32 #error Recursive header files inclusion detected in PPMReader.h
33 #else // defined(PPMReader_RECURSES)
35 #define PPMReader_RECURSES
36 
37 #if !defined PPMReader_h
39 #define PPMReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CUnaryFunctor.h"
46 #include "DGtal/io/colormaps/BasicColorToScalarFunctors.h"
48 
49 #ifdef _MSC_VER
50 #pragma warning(disable : 4290)
51 #endif
52 
53 namespace DGtal
54 {
55 
57 // class PPMReader
96  template <typename TImageContainer,
97  typename TFunctor=functors::ColorRGBEncoder<typename TImageContainer::Value> >
98  struct PPMReader
99  {
100  // ----------------------- Standard services ------------------------------
101  public:
102 
103  typedef TImageContainer ImageContainer;
105  typedef typename TImageContainer::Value Value;
106  typedef TFunctor Functor;
107 
109 
111 
112  BOOST_STATIC_ASSERT( (ImageContainer::Domain::dimension == 2) ||
113  (ImageContainer::Domain::dimension == 3));
114 
115 
128  static ImageContainer importPPM(const std::string & aFilename,
129  const Functor & aFunctor = functors::ColorRGBEncoder<Value>(),
130  bool topbotomOrder = true);
131 
132 
133 
134  }; // end of class PPMReader
135 
136 
137 
138 } // namespace DGtal
139 
140 
142 // Includes inline functions.
143 #include "DGtal/io/readers/PPMReader.ih"
144 
145 
146 // //
148 
149 #endif // !defined PPMReader_h
150 
151 #undef PPMReader_RECURSES
152 #endif // else defined(PPMReader_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Import a 2D or 3D using the Netpbm formats (ASCII mode).
Definition: PPMReader.h:99
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, DGtal::Color, Value >))
static ImageContainer importPPM(const std::string &aFilename, const Functor &aFunctor=functors::ColorRGBEncoder< Value >(), bool topbotomOrder=true)
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
TFunctor Functor
Definition: PPMReader.h:106
TImageContainer::Value Value
Definition: PPMReader.h:105
TImageContainer ImageContainer
Definition: PPMReader.h:103
TImageContainer::Domain::Vector Vector
Definition: PPMReader.h:104
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:90
FreemanChain< int >::Vector Vector