32 #include "DGtal/base/Common.h"
33 #include "ConfigTest.h"
34 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/io/colormaps/TickedColorMap.h"
36 #include "DGtal/io/colormaps/HueShadeColorMap.h"
37 #include "DGtal/io/colormaps/GradientColorMap.h"
38 #include "DGtal/io/boards/Board2D.h"
42 using namespace DGtal;
53 unsigned int nbok = 0;
65 Color c = ticked(4.5);
66 nbok += (c == Color::White) ? 1 : 0;
68 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
69 <<
"c == white on tick inf.."<< std::endl;
72 nbok += (c == Color::White) ? 1 : 0;
74 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
75 <<
"c == white on tick sup.."<< std::endl;
78 nbok += (c == Color::White) ? 1 : 0;
80 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
81 <<
"c == white on tick sup.. "<< std::endl;
84 nbok += (c == Color::White) ? 1 : 0;
86 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
87 <<
"c == white on tick sup.. "<< std::endl;
91 nbok += (c != Color::White) ? 1 : 0;
93 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
94 <<
"c != white outside.. "<< std::endl;
111 for(
unsigned int i=0; i < 100; i++)
114 board.
saveEPS(
"testTicked.eps");
120 for(
unsigned int i=0; i < 100; i++)
123 board.
saveEPS(
"testTicked-regular.eps");
130 ticked3.
colormap()->addColor( Color::Black );
131 ticked3.
colormap()->addColor( Color::Red );
132 for(
unsigned int i=0; i < 100; i++)
135 board.
saveEPS(
"testTicked-gradient-regular.eps");
143 int main(
int argc,
char** argv )
147 for (
int i = 0; i < argc; ++i )
152 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Structure representing an RGB triple with alpha component.
Aim: This class adapts any colormap to add "ticks" in the colormap colors.
void addTick(const Value position, const Value thickness)
ColorMap * colormap() const
void addRegularTicks(const unsigned int nbTicks, const Value thickness)
void beginBlock(const std::string &keyword="")
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
int main(int argc, char **argv)
bool testTickedColorMap()