DGtal  0.9.2
GenericWriter.h
1 
17 #pragma once
18 
31 #if defined(GenericWriter_RECURSES)
32 #error Recursive header files inclusion detected in GenericWriter.h
33 #else // defined(GenericWriter_RECURSES)
34 
35 #define GenericWriter_RECURSES
36 
37 #if !defined GenericWriter_h
38 
39 #define GenericWriter_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/base/BasicFunctors.h"
46 #include "DGtal/base/CUnaryFunctor.h"
47 #include "DGtal/images/CConstImage.h"
48 #include "DGtal/images/Image.h"
49 #include "DGtal/images/ImageContainerBySTLVector.h"
50 #include "DGtal/images/ImageContainerBySTLMap.h"
51 
52 #include "DGtal/io/colormaps/HueShadeColorMap.h"
54 
55 namespace DGtal
56 {
57 
59  // template class GenericWriter
89  template <typename TContainer,
90  int Tdim=TContainer::Point::dimension,
91  typename TValue = typename TContainer::Value,
92  typename TFunctor = functors::Identity >
94  {
103  static bool exportFile(const std::string &filename,
104  const TContainer &anImage,
105  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
106  };
107 
112  template <typename TContainer, typename TFunctor>
113  struct GenericWriter<TContainer, 3 , unsigned char, TFunctor>
114  {
117 
126  static bool exportFile(const std::string &filename, const TContainer &anImage, const std::string &datasetName="UInt8Array3D",
127  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
128 
129  };
130 
135  template <typename TContainer, typename TFunctor>
136  struct GenericWriter<TContainer, 3 , DGtal::uint64_t, TFunctor>
137  {
138 
141 
142 
150  static bool exportFile(const std::string &filename, const TContainer &anImage,
151  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
152 
153  };
154 
155 
160  template <typename TContainer, typename TValue, typename TFunctor>
161  struct GenericWriter<TContainer, 3 , TValue, TFunctor>
162  {
172  static bool exportFile(const std::string &filename,
173  const TContainer &anImage,
174  const std::string &datasetName="UInt8Array3D",
175  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
176 
177  };
178 
183  template <typename TContainer, typename TValue, typename TFunctor>
184  struct GenericWriter<TContainer, 2, TValue, TFunctor>
185  {
187 
196  static bool exportFile(const std::string &filename,
197  const TContainer &anImage,
198  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
199 
200  };
201 
206  template <typename TContainer, typename TValue >
207  struct GenericWriter<TContainer, 2, TValue, HueShadeColorMap<TValue> >
208  {
210 
223  static bool exportFile(const std::string &filename, const TContainer &anImage,
224  const HueShadeColorMap<TValue> & aFunctor ) throw(DGtal::IOException);
225 
226  };
227 
232  template <typename TContainer, typename TFunctor>
233  struct GenericWriter<TContainer, 2, unsigned char, TFunctor>
234  {
243  static bool exportFile(const std::string &filename, const TContainer &anImage,
244  const TFunctor & aFunctor = TFunctor() ) throw(DGtal::IOException);
245 
246  };
247 
257  template <typename TImageContainer >
258  bool
259  operator >> ( const TImageContainer & aContainer, const std::string & aFilename ) throw (DGtal::IOException);
260 
261 
262 } // namespace DGtal
263 
264 
266 // Includes inline functions.
267 #include "DGtal/io/writers/GenericWriter.ih"
268 
269 // //
271 
272 #endif // !defined GenericWriter_h
273 
274 #undef GenericWriter_RECURSES
275 #endif // else defined(GenericWriter_RECURSES)
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: Defines a unary functor, which associates arguments to results.
Definition: CUnaryFunctor.h:89
Aim: Provide a mechanism to save image (2D or 3D) into file with the best saver loader according to a...
Definition: GenericWriter.h:93
BOOST_CONCEPT_ASSERT((concepts::CConstImage< TContainer >))
void operator>>(const Display3D< Space, KSpace > &aDisplay3D, DGtal::Mesh< typename Display3D< Space, KSpace >::RealPoint > &aMesh)
DGtal is the top-level namespace which contains all DGtal functions and types.
static bool exportFile(const std::string &filename, const TContainer &anImage, const TFunctor &aFunctor=TFunctor())
boost::uint64_t uint64_t
unsigned 64-bit integer.
Definition: BasicTypes.h:65
Aim: Defines the concept describing a read-only image, which is a refinement of CPointFunctor.
Definition: CConstImage.h:94