OGS
ColorLookupTable.cpp
Go to the documentation of this file.
1
11#include "ColorLookupTable.h"
12
13#include <limits>
14
15namespace DataHolderLib
16{
18 : _range(
19 std::make_pair<double, double>(std::numeric_limits<double>::lowest(),
20 std::numeric_limits<double>::max()))
21
22{
23}
24
25void ColorLookupTable::setTableRange(double min, double max)
26{
27 if (min < max)
28 {
29 _range = std::make_pair(min, max);
30 }
31}
32
34{
35 if ((id > _range.first) && (id < _range.second))
36 {
37 _lut.emplace_back(id, color, "");
38 }
39}
40
41void ColorLookupTable::setColor(std::string const& name,
42 DataHolderLib::Color const& color)
43{
44 _lut.emplace_back(0, color, name);
45}
46
47} // namespace DataHolderLib
void setColor(double id, DataHolderLib::Color const &color)
void setTableRange(double min, double max)
std::vector< std::tuple< double, Color, std::string > > _lut
std::pair< double, double > _range
std::array< unsigned char, 4 > Color
Definition Color.h:24