32 #include "DGtal/base/Common.h"
33 #include "DGtal/kernel/domains/HyperRectDomain.h"
34 #include "DGtal/kernel/SpaceND.h"
35 #include "DGtal/helpers/StdDefs.h"
36 #include "DGtal/images/CImage.h"
37 #include "DGtal/images/Image.h"
38 #include "DGtal/images/ImageContainerBySTLVector.h"
42 using namespace DGtal;
53 unsigned int nbok = 0;
64 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
65 <<
"true == true" << std::endl;
74 unsigned int nbok = 0;
88 trace.
info()<<*image.getPointer()<<std::endl;
90 nbok += image.isValid() ? 1 : 0;
103 MyImage6 imageBis(
new VImage6( Domain6(A,B) ) );
107 nbok += imageBis.isValid() ? 1 : 0;
111 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
112 <<
"true == true" << std::endl;
120 unsigned int nbok = 0;
138 nbok += image.isValid() ? 1 : 0;
141 image.setValue(c, 42);
149 std::cerr << (*it)<<
" ";
153 nbok += (
image(c) == 42) ? 1 : 0;
156 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
157 <<
"true == true" << std::endl;
165 unsigned int nbok = 0;
182 nbok += image.isValid() ? 1 : 0;
186 VImage * imContainer =
191 MyImage image2(imContainer);
193 const MyImage::ImagePointer p = image2.getPointer();
197 nbok += (image2.isValid()) ? 1 : 0;
201 trace.
info() << imContainer << std::endl;
202 nbok += (p.get() == imContainer) ? 1 : 0;
205 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
206 <<
"true == true" << std::endl;
214 unsigned int nbok = 0;
229 trace.
info() <<
"Image constructed: "<< image <<std::endl;
231 VImage myImageC(
domain );
232 MyImage imageFromConstRef ( myImageC );
233 trace.
info() <<
"Image constructed (from constRef): "<< imageFromConstRef <<std::endl;
234 nbok += (imageFromConstRef.getPointer().count()== 2) ? 1 : 0;
236 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
237 <<
"unique" << std::endl;
240 trace.
info() <<
"Image constructed (degulat): "<< image3 <<std::endl;
243 trace.
info() <<
"default: "<< image3 <<std::endl;
245 nbok += (image3.getPointer().count()== 3) ? 1 : 0;
247 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
248 <<
"true == true" << std::endl;
249 trace.
info() <<
"assignment: "<< image3 <<std::endl;
250 nbok += (image3.getPointer().count()== 3) ? 1 : 0;
252 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
253 <<
"true == true" << std::endl;
256 trace.
info() <<
"setValue on assigned: "<< image3 <<std::endl;
257 nbok += (image3.getPointer().count()== 2) ? 1 : 0;
260 MyImage image4(image3);
261 trace.
info() <<
"Image constructed (copy): "<< image4 <<std::endl;
262 nbok += (image4.getPointer().count()== 3) ? 1 : 0;
266 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
267 <<
"true == true" << std::endl;
274 unsigned int nbok = 0;
293 for(Iterator it = image.range().begin(), itend = image.range().end();
299 for(DomainConstIterator it = image.domain().begin(), itend = image.domain().end();
301 image.setValue( *it , 42 );
311 int main(
int argc,
char** argv )
315 for (
int i = 0; i < argc; ++i )
325 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Iterator for HyperRectDomain.
Aim: implements association bewteen points lying in a digital domain and values.
Aim: model of CConstBidirectionalRangeFromPoint that adapts any range of elements bounded by two iter...
TConstIterator ConstIterator
void beginBlock(const std::string &keyword="")
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Defines the concept describing a read/write image, having an output iterator.
int main(int argc, char **argv)
bool testSelfCheckConcept()
bool testImageCopyShort()