DGtal  0.9.2
PGMReader.h
1 
17 #pragma once
18 
31 #if defined(PGMReader_RECURSES)
32 #error Recursive header files inclusion detected in PGMReader.h
33 #else // defined(PGMReader_RECURSES)
34 
35 #define PGMReader_RECURSES
36 
37 #if !defined PGMReader_h
38 
39 #define PGMReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/CUnaryFunctor.h"
46 
48 
49 #ifdef _MSC_VER
50 #pragma warning(disable : 4290)
51 #endif
52 
53 namespace DGtal
54 {
55 
57 // class PGMReader
94  template <typename TImageContainer,
95  typename TFunctor = functors::Cast< typename TImageContainer::Value > >
96  struct PGMReader
97  {
98  // ----------------------- Standard services ------------------------------
99  public:
100 
101  typedef TImageContainer ImageContainer;
102  typedef typename TImageContainer::Value Value;
103  typedef typename TImageContainer::Domain::Vector Vector;
104 
105  typedef TFunctor Functor;
106 
108 
110 
111 
112 
113  BOOST_STATIC_ASSERT( (ImageContainer::Domain::dimension == 2) ||
114  (ImageContainer::Domain::dimension == 3));
115 
131  static ImageContainer importPGM(const std::string & aFilename,
132  const Functor & aFunctor = Functor(),
133  bool topbotomOrder = true) throw(DGtal::IOException);
134 
135 
136 
137 
149  static ImageContainer importPGM3D(const std::string & aFilename,
150  const Functor & aFunctor = Functor()) throw(DGtal::IOException);
151 
152 
153 
154  }; // end of class PGMReader
155 
156 
157 
158 } // namespace DGtal
159 
160 
162 // Includes inline functions.
163 #include "DGtal/io/readers/PGMReader.ih"
164 
165 
166 // //
168 
169 #endif // !defined PGMReader_h
170 
171 #undef PGMReader_RECURSES
172 #endif // else defined(PGMReader_RECURSES)
Aim: Import a 2D or 3D using the Netpbm formats (ASCII mode).
Definition: PGMReader.h:96
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
TFunctor Functor
Definition: PGMReader.h:105
STL namespace.
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, unsigned char, Value >))
DGtal is the top-level namespace which contains all DGtal functions and types.
TImageContainer ImageContainer
Definition: PGMReader.h:101
TImageContainer::Domain::Vector Vector
Definition: PGMReader.h:103
static ImageContainer importPGM3D(const std::string &aFilename, const Functor &aFunctor=Functor())
TImageContainer::Value Value
Definition: PGMReader.h:102