DGtal 1.4.0
Loading...
Searching...
No Matches
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)
35#define PGMReader_RECURSES
36
37#if !defined PGMReader_h
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
53namespace DGtal
54{
55
57// class PGMReader
95template <typename TImageContainer,
96 typename TFunctor = functors::Cast<typename TImageContainer::Value>>
98{
99 // ----------------------- Standard services ------------------------------
100 public:
101
103 typedef typename TImageContainer::Value Value;
105
106 typedef TFunctor Functor;
107
109
111
112
113
114 BOOST_STATIC_ASSERT( (ImageContainer::Domain::dimension == 2) ||
115 (ImageContainer::Domain::dimension == 3));
116
132 static ImageContainer importPGM(const std::string & aFilename,
133 const Functor & aFunctor = Functor(),
134 bool topbotomOrder = true);
135
136
137
138
150 static ImageContainer importPGM3D(const std::string & aFilename,
151 const Functor & aFunctor = Functor());
152
153
154
155 }; // end of class PGMReader
156
157
158
159} // namespace DGtal
160
161
163// Includes inline functions.
164#include "DGtal/io/readers/PGMReader.ih"
165
166
167// //
169
170#endif // !defined PGMReader_h
171
172#undef PGMReader_RECURSES
173#endif // else defined(PGMReader_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 PGMReader.h:98
static ImageContainer importPGM3D(const std::string &aFilename, const Functor &aFunctor=Functor())
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, unsigned char, Value >))
TImageContainer::Value Value
Definition PGMReader.h:103
TImageContainer ImageContainer
Definition PGMReader.h:102
BOOST_STATIC_ASSERT((ImageContainer::Domain::dimension==2)||(ImageContainer::Domain::dimension==3))
TImageContainer::Domain::Vector Vector
Definition PGMReader.h:104
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
TFunctor Functor
Definition PGMReader.h:106
Aim: Defines a unary functor, which associates arguments to results.
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer