DGtal  1.5.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)
35 #define ImageFromSet_RECURSES
36 
37 #if !defined ImageFromSet_h
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)
MyDigitalSurface::ConstIterator ConstIterator
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Define utilities to convert a digital set into an image.
Definition: ImageFromSet.h:64
TImage::Value Value
Definition: ImageFromSet.h:66
static void append(Image &aImage, const Set &aSet, const Value &defaultValue)
Definition: ImageFromSet.h:152
BOOST_CONCEPT_ASSERT((concepts::CImage< Image >))
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder=false, const bool keepSetDomain=false)
Definition: ImageFromSet.h:114
static void append(Image &aImage, const Value &defaultValue, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd)
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd, const bool keepSetDomain=false)
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:103