DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
PGMWriter.h
1
16
17
#pragma once
18
30
31
#if defined(PGMWriter_RECURSES)
32
#error Recursive header files inclusion detected in PGMWriter.h
33
#else
// defined(PGMWriter_RECURSES)
35
#define PGMWriter_RECURSES
36
37
#if !defined PGMWriter_h
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 = functors::Identity>
88
struct
PGMWriter
89
{
90
// ----------------------- Standard services ------------------------------
91
typedef
TImage
Image
;
92
typedef
typename
TImage::Value
Value
;
93
typedef
TFunctor
Functor
;
94
95
BOOST_CONCEPT_ASSERT
((
concepts::CUnaryFunctor<TFunctor, Value, unsigned char>
)) ;
96
97
BOOST_STATIC_ASSERT
( (TImage::Domain::dimension == 2) ||
98
(TImage::Domain::dimension == 3));
99
112
static
bool
exportPGM
(
const
std::string & filename,
const
Image
&aImage,
113
const
Functor
& aFunctor =
Functor
(),
114
bool
saveASCII=
false
,
bool
topbotomOrder=
true
);
115
116
128
static
bool
exportPGM3D
(
const
std::string & filename,
const
Image
&aImage,
129
const
Functor
& aFunctor =
Functor
(),
bool
saveASCII=
false
);
130
131
};
132
}
//namespace
133
135
// Includes inline functions.
136
#include "DGtal/io/writers/PGMWriter.ih"
137
138
// //
140
141
#endif
// !defined PGMWriter_h
142
143
#undef PGMWriter_RECURSES
144
#endif
// else defined(PGMWriter_RECURSES)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::PGMWriter
Aim: Export a 2D and a 3D Image using the Netpbm PGM formats (ASCII mode).
Definition
PGMWriter.h:89
DGtal::PGMWriter::Functor
TFunctor Functor
Definition
PGMWriter.h:93
DGtal::PGMWriter::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CUnaryFunctor< TFunctor, Value, unsigned char >))
DGtal::PGMWriter::Value
TImage::Value Value
Definition
PGMWriter.h:92
DGtal::PGMWriter::Image
TImage Image
Definition
PGMWriter.h:91
DGtal::PGMWriter::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT((TImage::Domain::dimension==2)||(TImage::Domain::dimension==3))
DGtal::PGMWriter::exportPGM
static bool exportPGM(const std::string &filename, const Image &aImage, const Functor &aFunctor=Functor(), bool saveASCII=false, bool topbotomOrder=true)
DGtal::PGMWriter::exportPGM3D
static bool exportPGM3D(const std::string &filename, const Image &aImage, const Functor &aFunctor=Functor(), bool saveASCII=false)
DGtal::concepts::CUnaryFunctor
Aim: Defines a unary functor, which associates arguments to results.
Definition
CUnaryFunctor.h:90
src
DGtal
io
writers
PGMWriter.h
Generated on
for DGtal by
1.18.0