114 unsigned int nbok = 0;
119 typedef TDomain::Point
Point;
139 Image myImage ( 3, 8, 0 );
141 ImageVector myImageV(TDomain(l,u));
148 for( a[1] = 0; a[1] < 256; a[1]++)
149 for( a[0] = 0; a[0] < 256; a[0]++)
151 if ( pow((
double)(a[0]-128),3.0) - pow((
double)(a[1]-128),3.0) < pow(32.0,3.0))
154 myImageV.setValue(a,30);
158 if ( pow((
double)(a[0]-128),3.0) - pow((
double)(a[1]-128),3.0) < pow(64.0,3.0))
161 myImageV.setValue(a,10);
169 for( a[1] = 0; a[1] < 256; a[1]++)
170 for( a[0] = 0; a[0] < 256; a[0]++)
172 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(32,3.0))
173 result = result && (myImage(a) == 30);
175 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(64,3.0))
176 result = result && (myImage(a) == 10);
181 trace.
info() <<
"Get/Set test passed"<<std::endl;
183 trace.
error() <<
"Get/Set test error"<<std::endl;
184 nbok += result ? 1 : 0;
191 board.
saveSVG(
"hashtree.svg" );
194 board.
saveSVG(
"hashtree-vector.svg" );
198 Image myImage2 ( 5, 8, 0 );
201 for( a[1] = 0; a[1] < 256; a[1]++)
202 for( a[0] = 0; a[0] < 256; a[0]++)
204 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(32,3.0))
207 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(64,3.0))
215 for( a[1] = 0; a[1] < 256; a[1]++)
216 for( a[0] = 0; a[0] < 256; a[0]++)
218 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(32,3.0))
219 result = result && (myImage2(a) == 30);
221 if ( pow((a[0]-128),3.0) - pow((a[1]-128),3.0) < pow(64,3.0))
222 result = result && (myImage2(a) == 10);
227 trace.
info() <<
"Get/Set test passed"<<std::endl;
229 trace.
error() <<
"Get/Set test error"<<std::endl;
230 nbok += result ? 1 : 0;
234 <<
"true == true" << std::endl;
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
static void drawImageHashTree(Board2D &board, const DGtal::experimental::ImageContainerByHashTree< Domain, Value, HashKey > &, const Value &, const Value &)