DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PGMWriter.h
1 
17 #pragma once
18 
31 #if defined(PGMWriter_RECURSES)
32 #error Recursive header files inclusion detected in PGMWriter.h
33 #else // defined(PGMWriter_RECURSES)
34 
35 #define PGMWriter_RECURSES
36 
37 #if !defined PGMWriter_h
38 
39 #define PGMWriter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <string>
45 #include <boost/static_assert.hpp>
46 #include <boost/type_traits.hpp>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/base/CUnaryFunctor.h"
49 #include "DGtal/base/BasicFunctors.h"
51 
52 namespace DGtal
53 {
54 
56  // template class PGMWriter
87  template <typename TImage, typename TFunctor = DefaultFunctor>
88  struct PGMWriter
89  {
90  // ----------------------- Standard services ------------------------------
91  typedef TImage Image;
92  typedef typename TImage::Value Value;
93  typedef TFunctor Functor;
94 
96 
97  BOOST_STATIC_ASSERT( (TImage::Domain::dimension == 2) ||
98  (TImage::Domain::dimension == 3));
99 
111  static bool exportPGM(const std::string & filename, const Image &aImage,
112  const Functor & aFunctor = Functor(),
113  bool saveASCII=false, bool topbotomOrder=true);
114 
115 
125  static bool exportPGM3D(const std::string & filename, const Image &aImage,
126  const Functor & aFunctor = Functor());
127 
128  };
129 }//namespace
130 
132 // Includes inline functions.
133 #include "DGtal/io/writers/PGMWriter.ih"
134 
135 // //
137 
138 #endif // !defined PGMWriter_h
139 
140 #undef PGMWriter_RECURSES
141 #endif // else defined(PGMWriter_RECURSES)