32#include "DGtal/base/Common.h"
33#include "DGtal/helpers/StdDefs.h"
34#include "DGtal/geometry/volumes/distance/ExactPredicateLpSeparableMetric.h"
35#include "DGtal/geometry/volumes/distance/InexactPredicateLpSeparableMetric.h"
36#include "DGtal/io/boards/Board2D.h"
37#include "DGtal/kernel/BasicPointPredicates.h"
38#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
39#include "DGtal/io/colormaps/HueShadeColorMap.h"
54 unsigned int nbok = 0;
64 NegPred predicate( set );
68 DT dt( &
domain, &predicate, &metric);
74 Display2DFactory::drawImage<Hue> (board, dt,
78 std::string title =
"image-ball-" + boost::lexical_cast<string>( norm )+
".png" ;
80 board.
saveCairo(title.c_str(), Board2D::CairoPNG );
87 unsigned int nbok = 0;
97 NegPred predicate( set );
101 DT dt( &
domain, &predicate, &metric);
107 Display2DFactory::drawImage<Hue> (board, dt,
111 std::string title =
"image-ball-" + boost::lexical_cast<string>( norm )+
".png" ;
113 board.
saveCairo(title.c_str(), Board2D::CairoPNG );
121int main(
int argc,
char** argv )
125 for (
int i = 0; i < argc; ++i )
129 bool res = testExactMetricBalls<2>()
130 && testExactMetricBalls<1>()
131 && testExactMetricBalls<4>()
132 && testExactMetricBalls<8>()
137 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
void insertNew(const Point &p)
Aim: implements separable l_p metrics with exact predicates.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: implements separable l_p metrics with approximated predicates.
void beginBlock(const std::string &keyword="")
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The predicate returns true when the point predicate given at construction return false....
bool testInexactMetricBalls(double norm)
bool testExactMetricBalls()