DGtal  1.3.beta
ImageFromSet.h
1 
17 #pragma once
18 
31 #if defined(ImageFromSet_RECURSES)
32 #error Recursive header files inclusion detected in ImageFromSet.h
33 #else // defined(ImageFromSet_RECURSES)
34 
35 #define ImageFromSet_RECURSES
36 
37 #if !defined ImageFromSet_h
38 
39 #define ImageFromSet_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/images/CImage.h"
46 #include "DGtal/kernel/sets/CDigitalSet.h"
47 
49 
50 namespace DGtal
51 {
52 
54  // template class ImageFromSet
62  template <typename TImage>
63  struct ImageFromSet
64  {
65  typedef TImage Image;
66  typedef typename TImage::Value Value;
67 
68 
70 
71 
90  template <typename Set>
91  static
92  Image create(const Set &aSet, const Value &defaultValue,
93  const bool addBorder,
94  typename Set::ConstIterator itBegin,
95  typename Set::ConstIterator itEnd,
96  const bool keepSetDomain=false);
97 
112  template <typename Set>
113  static
114  Image create(const Set &aSet, const Value &defaultValue, const bool addBorder=false,
115  const bool keepSetDomain=false)
116  {
117  return create(aSet,defaultValue,addBorder,aSet.begin(), aSet.end(), keepSetDomain);
118  }
119 
120 
134  template<typename Set>
135  static
136  void append(Image &aImage, const Value &defaultValue,
137  typename Set::ConstIterator itBegin,
138  typename Set::ConstIterator itEnd);
139 
150  template<typename Set>
151  static
152  void append(Image &aImage, const Set &aSet, const Value &defaultValue)
153  {
154  append<Set>(aImage,defaultValue,aSet.begin(),aSet.end());
155  }
156  } ; // end of class ImageFromSet
157 
158 
159 
160 } // namespace DGtal
161 
162 
164 // Includes inline functions.
165 #include "DGtal/images/imagesSetsUtils/ImageFromSet.ih"
166 
167 // //
169 
170 #endif // !defined ImageFromSet_h
171 
172 #undef ImageFromSet_RECURSES
173 #endif // else defined(ImageFromSet_RECURSES)
ConstIterator
MyDigitalSurface::ConstIterator ConstIterator
Definition: greedy-plane-segmentation-ex2.cpp:93
DGtal::ImageFromSet::create
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder=false, const bool keepSetDomain=false)
Definition: ImageFromSet.h:114
DGtal::ImageFromSet
Aim: Define utilities to convert a digital set into an image.
Definition: ImageFromSet.h:63
DGtal::ImageFromSet::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CImage< Image >))
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::ImageFromSet::append
static void append(Image &aImage, const Set &aSet, const Value &defaultValue)
Definition: ImageFromSet.h:152
DGtal::ImageFromSet::create
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd, const bool keepSetDomain=false)
DGtal::ImageFromSet::append
static void append(Image &aImage, const Value &defaultValue, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd)
DGtal::Image
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38
DGtal::ImageFromSet::Image
TImage Image
Definition: ImageFromSet.h:65
DGtal::ImageFromSet::Value
TImage::Value Value
Definition: ImageFromSet.h:66
DGtal::concepts::CImage
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102