31#if defined(SimpleDistanceColorMap_RECURSES)
32#error Recursive header files inclusion detected in SimpleDistanceColorMap.h
35#define SimpleDistanceColorMap_RECURSES
37#if !defined SimpleDistanceColorMap_h
39#define SimpleDistanceColorMap_h
44#include "DGtal/base/Common.h"
45#include "DGtal/kernel/NumberTraits.h"
46#include "DGtal/io/Color.h"
63 template <
typename TValue>
97 const bool withTick=
true):
113 const double d = 1. - val;
114 double r = (1. - d*d) * .8;
115 double g = (1. - (2. * (d - .5)) * (2. * (d - .5))) * .7;
116 double b = (1. - (1. - d) * (1. - d));
124 h = (1. / (1. + exp(-100.*(h - .55)))) + (1. / (1. + exp(-100.*(-h + .45))));
131 return Color(
static_cast<unsigned char>(r*255),
132 static_cast<unsigned char>(g*255),
133 static_cast<unsigned char>(b*255));
204#undef SimpleDistanceColorMap_RECURSES
Structure representing an RGB triple with alpha component.
Aim: simple blue to red colormap for distance information for instance.
void selfDisplay(std::ostream &out) const
SimpleDistanceColorMap(const Value &amin, const Value &amax, const bool withTick=true)
const Value & min() const
SimpleDistanceColorMap & operator=(const SimpleDistanceColorMap &anOther)
SimpleDistanceColorMap(const SimpleDistanceColorMap &other)
const Value & max() const
Color operator()(const Value &aValue) const
bool myTick
Boolean to activate/desactivate ticks.
DGtal is the top-level namespace which contains all DGtal functions and types.
static double castToDouble(const T &aT)
Aim: The traits class for all models of Cinteger.