DGtal 1.3.0
Loading...
Searching...
No Matches
RawWriter.h
1
17#pragma once
18
31#if defined(RawWriter_RECURSES)
32#error Recursive header files inclusion detected in RawWriter.h
33#else // defined(RawWriter_RECURSES)
35#define RawWriter_RECURSES
36
37#if !defined RawWriter_h
39#define RawWriter_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
52namespace DGtal
53{
54
56 // template class RawWriter
97 template <typename TImage, typename TFunctor = functors::Identity>
98 struct RawWriter
99 {
100 // ----------------------- Standard services ------------------------------
101
102 typedef TImage Image;
103 typedef typename TImage::Value Value;
104 typedef TFunctor Functor;
105
115 template <typename Word>
116 static bool exportRaw(const std::string& filename,
117 const Image& aImage,
118 const Functor& aFunctor = Functor());
119
128 static bool exportRaw8(const std::string& filename,
129 const Image& anImage,
130 const Functor& aFunctor = Functor());
131
140 static bool exportRaw16(const std::string& filename,
141 const Image& anImage,
142 const Functor& aFunctor = Functor());
143
152 static bool exportRaw32(const std::string& filename,
153 const Image& anImage,
154 const Functor& aFunctor = Functor());
155
156 private:
157
158 };
159
168 template <typename Word>
169 std::ostream& raw_writer_write_word(std::ostream& outs, Word value);
170
171}//namespace
172
174// Includes inline functions.
175#include "DGtal/io/writers/RawWriter.ih"
176
177// //
179
180#endif // !defined RawWriter_h
181
182#undef RawWriter_RECURSES
183#endif // else defined(RawWriter_RECURSES)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & raw_writer_write_word(std::ostream &outs, Word value)
Aim: Raw binary export of an Image.
Definition: RawWriter.h:99
static bool exportRaw32(const std::string &filename, const Image &anImage, const Functor &aFunctor=Functor())
static bool exportRaw8(const std::string &filename, const Image &anImage, const Functor &aFunctor=Functor())
static bool exportRaw16(const std::string &filename, const Image &anImage, const Functor &aFunctor=Functor())
static bool exportRaw(const std::string &filename, const Image &aImage, const Functor &aFunctor=Functor())
TFunctor Functor
Definition: RawWriter.h:104
TImage::Value Value
Definition: RawWriter.h:103