0.2.0
Loading...
Searching...
No Matches
NAV::Colormap Class Reference

Colormap class. More...

Public Member Functions

void addColor (double value, ImColor color)
 Add a color with value.
 
 Colormap ()
 Constructor.
 
ImColor getColor (double value, const ImColor &defaultColor) const
 Gets the color for the given value.
 
const std::vector< std::pair< double, ImColor > > & getColormap () const
 Return the map.
 
int64_t getId () const
 Return the id of the colormap.
 
void removeColor (size_t idx)
 Remove the entry at the index (if past the last index or empty, NoOp)
 

Public Attributes

bool discrete
 Whether to have discrete changes of the colors or continuous.
 
std::string name
 Name of the Colormap.
 
size_t version
 Version, to tell nodes that the colormap was updated.
 

Detailed Description

Colormap class.

Member Function Documentation

◆ addColor()

void NAV::Colormap::addColor ( double value,
ImColor color )

Add a color with value.

Parameters
valueValue
colorColor

◆ getColor()

ImColor NAV::Colormap::getColor ( double value,
const ImColor & defaultColor ) const

Gets the color for the given value.

Parameters
[in]valueValue to look for
[in]defaultColorDefault color to display if no enty in the colormap matches
Returns
The color for the value or the given defaultColor if nothing matches

◆ removeColor()

void NAV::Colormap::removeColor ( size_t idx)

Remove the entry at the index (if past the last index or empty, NoOp)

Parameters
idxIndex to remove

The documentation for this class was generated from the following file: