DGtal  1.5.beta
RawReader.h
1 
17 #pragma once
18 
31 #if defined(RawReader_RECURSES)
32 #error Recursive header files inclusion detected in RawReader.h
33 #else // defined(RawReader_RECURSES)
35 #define RawReader_RECURSES
36 
37 #if !defined RawReader_h
39 #define RawReader_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #include <cstdio>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/base/CUnaryFunctor.h"
48 #include <boost/static_assert.hpp>
50 
51 namespace DGtal
52 {
53 
55  // template class RawReader
91  template <typename TImageContainer,
92  typename TFunctor = functors::Cast< typename TImageContainer::Value > >
93  struct RawReader
94  {
95  // ----------------------- Standard services ------------------------------
96  public:
97 
99  typedef typename TImageContainer::Value Value;
101  typedef TFunctor Functor;
102 
116  template <typename Word>
117  static ImageContainer importRaw(const std::string & filename,
118  const Vector & extent,
119  const Functor & aFunctor = Functor());
120 
133  static ImageContainer importRaw8(const std::string & filename,
134  const Vector & extent,
135  const Functor & aFunctor = Functor());
136 
149  static ImageContainer importRaw16(const std::string & filename,
150  const Vector & extent,
151  const Functor & aFunctor = Functor());
152 
165  static ImageContainer importRaw32(const std::string & filename,
166  const Vector & extent,
167  const Functor & aFunctor = Functor());
168 
169 
170  private:
171 
172  }; // end of class RawReader
173 
182  template <typename Word>
183  FILE* raw_reader_read_word( FILE* fin, Word& aValue );
184 
185 } // namespace DGtal
186 
187 
189 // Includes inline functions.
190 #include "DGtal/io/readers/RawReader.ih"
191 
192 // //
194 
195 #endif // !defined RawReader_h
196 
197 #undef RawReader_RECURSES
198 #endif // else defined(RawReader_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
FILE * raw_reader_read_word(FILE *fin, Word &aValue)
Aim: Raw binary import of an Image.
Definition: RawReader.h:94
TImageContainer::Value Value
Definition: RawReader.h:99
static ImageContainer importRaw8(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
TImageContainer::Domain::Vector Vector
Definition: RawReader.h:100
TImageContainer ImageContainer
Definition: RawReader.h:98
TFunctor Functor
Definition: RawReader.h:101
static ImageContainer importRaw16(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
static ImageContainer importRaw(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
static ImageContainer importRaw32(const std::string &filename, const Vector &extent, const Functor &aFunctor=Functor())
ImageContainerBySTLVector< HyperRectDomain< Z2i::Space >, std::unordered_set< Z2i::Point > > TImageContainer