32#include "DGtal/base/Common.h"
33#include "DGtal/io/viewers/Viewer3D.h"
34#include "DGtal/io/viewers/DrawWithViewer3DModifier.h"
35#include "DGtal/io/Color.h"
36#include "DGtal/helpers/StdDefs.h"
37#include "DGtal/shapes/Shapes.h"
38#include "DGtal/io/readers/PGMReader.h"
39#include "DGtal/io/readers/GenericReader.h"
40#include "DGtal/io/writers/GenericWriter.h"
41#include "DGtal/io/colormaps/BasicColorToScalarFunctors.h"
42#include "DGtal/math/BasicMathFunctions.h"
43#include "DGtal/io/colormaps/HueShadeColorMap.h"
45#include "ConfigTest.h"
62 unsigned int operator() (
unsigned char aVal)
const
65 Color col = hueShade((
unsigned int)aVal);
73int main(
int argc,
char** argv )
78 QApplication application(argc,argv);
80 viewer.setWindowTitle(
"simpleViewer");
85 Point p2( 125, 188, 0 );
86 Point p3( 30, 30, 30 );
88 std::string filename = testPath +
"samples/church-small.pgm";
89 std::string filename3 = testPath +
"samples/color64.ppm";
97 viewer << DGtal::AddTextureImage2DWithFunctor<imageNG, hueFct , Z3i::Space, Z3i::KSpace>(image2, huefct,
Viewer3D<>::RGBMode );
99 viewer << DGtal::AddTextureImage2DWithFunctor<imageCol, functors::Identity, Z3i::Space, Z3i::KSpace>(image3, defaultfunctor,
Viewer3D<>::RGBMode );
103 viewer <<
SetMode3D( image.domain().className(),
"BoundingBox" );
104 viewer << image.domain();
106 for(
unsigned int i= 0; i< 10; i++){
108 viewer <<
SetMode3D( image.className(),
"" );
110 viewer <<
SetMode3D( image.className(),
"BoundingBox" );
112 viewer <<
SetMode3D( image.className(),
"Grid" );
114 viewer <<
SetMode3D( image.className(),
"InterGrid" );
117 viewer << DGtal::UpdateImageData<imageNG>(i+3, image, i*50, i*50, i*50);
121 viewer << p1 << p2 << p3;
122 viewer << Viewer3D<>::updateDisplay;
125 bool res = application.exec();
126 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Structure representing an RGB triple with alpha component.
DGtal::uint32_t getRGB() const
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
void beginBlock(const std::string &keyword="")
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
DGtal is the top-level namespace which contains all DGtal functions and types.
static TContainer import(const std::string &filename, std::vector< unsigned int > dimSpace=std::vector< unsigned int >())
static ImageContainer importPGM(const std::string &aFilename, const Functor &aFunctor=Functor(), bool topbotomOrder=true)
Modifier class in a Display3D stream. Useful to choose your own mode for a given class....
Aim: Define a simple default functor that just returns its argument.