31 #if defined(GradientColorMap_RECURSES) 32 #error Recursive header files inclusion detected in GradientColorMap.h 33 #else // defined(GradientColorMap_RECURSES) 35 #define GradientColorMap_RECURSES 37 #if !defined GradientColorMap_h 39 #define GradientColorMap_h 44 #include "DGtal/base/Common.h" 45 #include "Board/Board.h" 46 #include "DGtal/io/Color.h" 50 #define DGTAL_RGB2INT(R,G,B) (((R)<<16)|((G)<<8)|(B)) 51 #define DGTAL_RED_COMPONENT(I) (((I)>>16)&0xFF) 52 #define DGTAL_GREEN_COMPONENT(I) (((I)>>8)&0xFF) 53 #define DGTAL_BLUE_COMPONENT(I) ((I)&0xFF) 114 template <
typename PValue,
116 int PDefaultFirstColor = -1,
117 int PDefaultLastColor = -1 >
141 = static_cast<ColorGradientPreset>( PDefaultPreset ),
142 const Color firstColor
145 Color( DGTAL_RED_COMPONENT( PDefaultFirstColor ),
146 DGTAL_GREEN_COMPONENT( PDefaultFirstColor ),
147 DGTAL_BLUE_COMPONENT( PDefaultFirstColor ) ),
148 const Color lastColor
151 Color( DGTAL_RED_COMPONENT( PDefaultLastColor ),
152 DGTAL_GREEN_COMPONENT( PDefaultLastColor ),
153 DGTAL_BLUE_COMPONENT( PDefaultLastColor ) )
216 const PValue &
min()
const;
223 const PValue &
max()
const;
241 const PValue & value );
274 template <
typename PValue,
276 int PDefaultFirstColor,
277 int PDefaultLastColor >
279 operator<< ( std::ostream & out, const GradientColorMap<PValue,PDefaultPreset,PDefaultFirstColor,PDefaultLastColor> & object );
286 #include "DGtal/io/colormaps/GradientColorMap.ih" 291 #endif // !defined GradientColorMap_h 293 #undef GradientColorMap_RECURSES 294 #endif // else defined(GradientColorMap_RECURSES)
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
static Color getColor(const std::vector< Color > &colors, const PValue &min, const PValue &max, const PValue &value)
std::vector< Color > myColors
const PValue & max() const
void addColor(const Color &color)
DGtal is the top-level namespace which contains all DGtal functions and types.
void selfDisplay(std::ostream &out) const
Structure representing an RGB triple with alpha component.
GradientColorMap & operator=(const GradientColorMap &other)
const PValue & min() const
Color operator()(const PValue &value) const