DGtal  1.5.beta
CImageFactory.h
1 
17 #pragma once
18 
31 #if defined(CImageFactory_RECURSES)
32 #error Recursive header files inclusion detected in CImageFactory.h
33 #else // defined(CImageFactory_RECURSES)
35 #define CImageFactory_RECURSES
36 
37 #if !defined CImageFactory_h
39 #define CImageFactory_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
46 
47 namespace DGtal
48 {
49  namespace concepts
50  {
52 // class CImageFactory
89 template <typename T>
91 {
92  // ----------------------- Concept checks ------------------------------
93 public:
94 
95  typedef typename T::OutputImage OutputImage;
96 
98 
100  {
101  ConceptUtils::sameType( myOI, myT.requestImage(myDomain) );
102  myT.flushImage(myOI);
103  myT.detachImage(myOI);
104 
105  // check const methods.
107  }
109  {
110  }
111 
112  // ------------------------- Private Datas --------------------------------
113 private:
114  T myT; // do not require T to be default constructible.
116  typename T::Domain myDomain;
117 
118  // ------------------------- Internals ------------------------------------
119 private:
120 
121 }; // end of concept CImageFactory
122  }
123 } // namespace DGtal
124 
125 // //
127 
128 #endif // !defined CImageFactory_h
129 
130 #undef CImageFactory_RECURSES
131 #endif // else defined(CImageFactory_RECURSES)
void sameType(const T &, const T &)
Definition: ConceptUtils.h:117
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Defines the concept describing an image factory.
Definition: CImageFactory.h:91
BOOST_CONCEPT_USAGE(CImageFactory)
Definition: CImageFactory.h:99
BOOST_CONCEPT_ASSERT((CImage< OutputImage >))
Aim: Defines the concept describing a read/write image, having an output iterator.
Definition: CImage.h:103
HyperRectDomain< Space > Domain