17 #ifndef GEPETTO_GUI_COLORMAP_HH 18 #define GEPETTO_GUI_COLORMAP_HH 29 static QColor
interpolate (std::size_t nbColors, std::size_t index)
32 qDebug() <<
"Nb colors:" << nbColors <<
"and index" << index;
33 return QColor::fromHslF((qreal)index / (qreal)nbColors, 1, 0.5);
42 std::size_t val = (nbColors > 0)?nbColors:1;
43 for (log2up_ = 0; val; ++log2up_, val >>= 1) mask_ = 2*mask_ + 1;
52 color[0] = (float)c.redF();
53 color[1] = (float)c.greenF();
54 color[2] = (float)c.blueF();
55 color[3] = (float)c.alphaF();
59 QColor color =
getColor (currentIndex_);
65 currentIndex_ = index % nbColors_;
70 std::size_t
remap (
const std::size_t& index)
const {
72 std::size_t input = index;
73 for (std::size_t i = 0; i < log2up_; ++i) {
82 std::size_t nbColors_;
85 std::size_t currentIndex_;
90 #endif // GEPETTO_GUI_COLORMAP_HH void getColor(std::size_t index, osgVector4 &color) const
Definition: color-map.hh:50
QColor nextColor()
Definition: color-map.hh:58
static QColor interpolate(std::size_t nbColors, std::size_t index)
Definition: color-map.hh:29
::osg::Vec4f osgVector4
Definition: config-osg.h:110
void currentIndex(std::size_t index)
Definition: color-map.hh:64
ColorMap(std::size_t nbColors)
Definition: color-map.hh:36
Definition: action-search-bar.hh:27
QColor getColor(std::size_t index) const
Definition: color-map.hh:46
std::size_t remap(const std::size_t &index) const
Definition: color-map.hh:70
Definition: color-map.hh:27