41 #include "DGtal/base/Common.h"
42 #include "DGtal/helpers/StdDefs.h"
43 #include "ConfigExamples.h"
45 #include "DGtal/io/boards/Board2D.h"
48 #include "DGtal/io/colormaps/HueShadeColorMap.h"
49 #include "DGtal/io/colormaps/GrayscaleColorMap.h"
51 #include "DGtal/images/ImageContainerBySTLVector.h"
52 #include "DGtal/images/ConstImageAdapter.h"
58 using namespace DGtal;
63 template <
typename Scalar>
64 struct LogScaleFunctor {
67 double operator()(
const Scalar &a)
const
105 Display2DFactory::drawImage<HueShade>(aBoard, image, (
unsigned char)0, (
unsigned char)255);
115 ConstImageAdapterForSubImage subImage(image, subDomain, df, df);
119 Display2DFactory::drawImage<HueShade>(aBoard, subImage, (
unsigned char)0, (
unsigned char)255);
120 aBoard.
saveSVG(
"subImage.svg");
128 for(
unsigned int y=0; y < 17; y++)
129 for(
unsigned int x=0; x < 17; x++)
138 ConstImageAdapterForSpecificImage specificImage(image, specificDomain, df, df);
142 Display2DFactory::drawImage<HueShade>(aBoard, specificImage, (
unsigned char)0, (
unsigned char)255);
143 aBoard.
saveSVG(
"specificImage.svg");
152 ConstImageAdapterForThresholderImage thresholderImage(image,
domain, df, t);
156 Display2DFactory::drawImage<Gray>(aBoard, thresholderImage, (
unsigned char)0, (
unsigned char)1);
157 aBoard.
saveSVG(
"thresholderImage.svg");
165 LogScaleFunctor<Image::Value> logScale;
166 ConstImageAdapterForLogScale logImage(image,
domain, df, logScale);
170 Display2DFactory::drawImage<HueShadeDouble>(aBoard, logImage, 0.0, logScale(255));
171 aBoard.
saveSVG(
"logImage.svg");
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
void insertNew(const Point &p)
Aim: This class template may be used to (linearly) convert scalar values in a given range into gray l...
std::vector< Value >::iterator Iterator
Aim: implements association bewteen points lying in a digital domain and values.
void beginBlock(const std::string &keyword="")
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
int main()
[LogScaleFunctor]
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: The traits class for all models of Cinteger.
Aim: Define a simple default functor that just returns its argument.
ImageContainerBySTLVector< Domain, Value > Image