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);
106 aBoard.saveSVG(
"image.svg");
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++)
131 set.insertNew(
Point(x,y));
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");
void beginBlock(const std::string &keyword="")
std::vector< Value >::iterator Iterator
const Domain domain(Point(1, 2), Point(6, 5))
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
Aim: This class template may be used to (linearly) convert scalar values in a given range into gray l...
Aim: Define a simple default functor that just returns its argument.
Aim: A small functor with an operator () that compares one value to a threshold value according to tw...
Aim: The traits class for all models of Cinteger.
void clear(const DGtal::Color &color=DGtal::Color::None)
int main()
[LogScaleFunctor]
DGtal is the top-level namespace which contains all DGtal functions and types.
ImageContainerBySTLVector< Domain, Value > Image
Aim: implements a const image adapter with a given domain (i.e. a subdomain) and 2 functors : g for d...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...