38 #include "DGtal/base/Common.h"
39 #include "DGtal/kernel/SpaceND.h"
40 #include "DGtal/kernel/domains/HyperRectDomain.h"
41 #include "DGtal/images/CImage.h"
42 #include "DGtal/images/ImageContainerBySTLVector.h"
43 #include "DGtal/images/ImageContainerBySTLMap.h"
44 #include "DGtal/images/ImageContainerByHashTree.h"
45 #include "DGtal/images/Image.h"
48 using namespace DGtal;
56 template<
typename Image>
74 for (
int i = 0; ( (dit != ditEnd)&&(i < 5) ); ++dit, ++i)
76 img.setValue(*dit, i);
86 bool flag2 = std::equal(rimg.
begin(), rimg.
end(), rimg2.
begin());
87 bool flag3 = std::equal(rimg.
begin(), rimg.
end(), rimg3.
begin());
88 bool flag23 = std::equal(rimg2.
begin(), rimg2.
end(), rimg3.
begin());
90 nbok += ( (!flag2) && flag3 && (!flag23) )?1:0;
92 trace.
info() <<
"(" <<nbok <<
"/" << nb <<
")" << std::endl;
106 trace.
info() <<
"(" <<nbok <<
"/" << nb <<
")" << std::endl;
114 img.setValue( p, 128 );
115 bool flag4 = ( img(p) == 128 );
118 rimg = img.constRange();
121 std::copy( rimg.
begin(), rimg.
end(), std::ostream_iterator<int>(cout,
", ") );
124 std::copy( rimg2.
begin(), rimg2.
end(), std::ostream_iterator<int>(cout,
", ") );
127 std::copy( rimg3.
begin(), rimg3.
end(), std::ostream_iterator<int>(cout,
", ") );
130 nbok += ( flag4 && (!flag2) && (!flag3) )?1:0;
132 trace.
info() <<
"(" <<nbok <<
"/" << nb <<
")" << std::endl;
142 return ( img.isValid() && img2.
isValid() && img3.
isValid() && (nbok == nb) );
145 int main(
int argc,
char** argv )
150 for (
int i = 0; i < argc; ++i )
161 Point p = Point::diagonal(0);
162 Point q = Point::diagonal(size-1);
186 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
std::vector< Value >::const_iterator ConstIterator
Aim: implements association bewteen points lying in a digital domain and values.
const Domain & domain() const
ConstRange constRange() const
Aim: model of CConstBidirectionalRangeFromPoint that adapts any range of elements bounded by two iter...
ConstIterator begin() const
ConstIterator end() const
OutputIterator outputIterator()
void beginBlock(const std::string &keyword="")
Point::Coordinate Integer
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::int64_t int64_t
signed 94-bit integer.
Aim: Defines the concept describing a read/write image, having an output iterator.
int main(int argc, char **argv)
bool testImage(const Image &aImage)
HyperRectDomain< Space > Domain