DGtal  0.9.2
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 
87  template <typename Set>
88  static
89  Image create(const Set &aSet, const Value &defaultValue,
90  const bool addBorder,
91  typename Set::ConstIterator itBegin,
92  typename Set::ConstIterator itEnd);
93 
106  template <typename Set>
107  static
108  Image create(const Set &aSet, const Value &defaultValue, const bool addBorder=false)
109  {
110  return create(aSet,defaultValue,addBorder,aSet.begin(), aSet.end());
111  }
112 
113 
127  template<typename Set>
128  static
129  void append(Image &aImage, const Value &defaultValue,
130  typename Set::ConstIterator itBegin,
131  typename Set::ConstIterator itEnd);
132 
143  template<typename Set>
144  static
145  void append(Image &aImage, const Set &aSet, const Value &defaultValue)
146  {
147  append<Set>(aImage,defaultValue,aSet.begin(),aSet.end());
148  }
149  } ; // end of class ImageFromSet
150 
151 
152 
153 } // namespace DGtal
154 
155 
157 // Includes inline functions.
158 #include "DGtal/images/imagesSetsUtils/ImageFromSet.ih"
159 
160 // //
162 
163 #endif // !defined ImageFromSet_h
164 
165 #undef ImageFromSet_RECURSES
166 #endif // else defined(ImageFromSet_RECURSES)
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder=false)
Definition: ImageFromSet.h:108
Aim: Define utilities to convert a digital set into an image.
Definition: ImageFromSet.h:63
static void append(Image &aImage, const Set &aSet, const Value &defaultValue)
Definition: ImageFromSet.h:145
BOOST_CONCEPT_ASSERT((concepts::CImage< Image >))
DGtal is the top-level namespace which contains all DGtal functions and types.
static void append(Image &aImage, const Value &defaultValue, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd)
TImage::Value Value
Definition: ImageFromSet.h:66
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:102
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd)