ColorMap.hpp
Go to the documentation of this file.
1 
35 #ifndef COLORMAP_H_
36 #define COLORMAP_H_
37 
38 #include <iostream>
39 
40 /***
41  * @brief Class to generate and handle color gradients
42  *
43  * @TODO: Integrated from show.
44  */
45 
46 namespace lvr2
47 {
48 
50 enum GradientType
51 {
52  SOLID = 0,
53  GREY = 1,
54  HSV = 2,
55  JET = 3,
56  HOT = 4,
57  SHSV = 5,
58  SIMPSONS = 6
59 };
60 
61 class ColorMap
62 {
63 public:
64 
71  ColorMap(size_t buckets) : m_numBuckets(buckets) {}
72 
76  virtual ~ColorMap() {};
77 
85  void getColor(float* color, size_t bucket, GradientType gradient = GREY);
86 
87 private:
88 
99  void convertHSVToRGB(float hue, float s, float v, float &r, float &g, float &b);
100 
107  void calcColorGrey(float* color, size_t bucket);
108 
115  void calcColorHSV(float* color, size_t bucket);
116 
123  void calcColorJet(float* color, size_t bucket);
124 
131  void calcColorHot(float* color, size_t bucket);
132 
139  void calcColorSHSV(float* color, size_t bucket);
140 
147  void calcColorSimpsons(float* color, size_t bucket);
148 
150  size_t m_numBuckets;
151 };
152 
153 } // namespace lvr2
154 
155 #endif /* COLORMAP_H_ */
lvr2::ColorMap::calcColorHot
void calcColorHot(float *color, size_t bucket)
Returns a color from a hot gradient.
Definition: ColorMap.cpp:103
lvr2::ColorMap::calcColorHSV
void calcColorHSV(float *color, size_t bucket)
Returns a color from a HSV gradient.
Definition: ColorMap.cpp:90
lvr2::ColorMap::convertHSVToRGB
void convertHSVToRGB(float hue, float s, float v, float &r, float &g, float &b)
Converts the given color in HSV space into RGB space.
Definition: ColorMap.cpp:131
lvr2::ColorMap::ColorMap
ColorMap(size_t buckets)
Ctor. Constructs a color gradient with the given number of buckets.
Definition: ColorMap.hpp:75
lvr2::JET
@ JET
Definition: ColorMap.hpp:63
lvr2::GREY
@ GREY
Definition: ColorMap.hpp:61
lvr2::HSV
@ HSV
Definition: ColorMap.hpp:62
lvr2::SHSV
@ SHSV
Definition: ColorMap.hpp:65
lvr2::ColorMap::calcColorGrey
void calcColorGrey(float *color, size_t bucket)
Returns a color from a gray gradient.
Definition: ColorMap.cpp:83
lvr2::SIMPSONS
@ SIMPSONS
Definition: ColorMap.hpp:66
lvr2::ColorMap
Definition: ColorMap.hpp:65
lvr2::ColorMap::calcColorSimpsons
void calcColorSimpsons(float *color, size_t bucket)
Returns a color from a Simpsons gradient.
Definition: ColorMap.cpp:76
lvr2::ColorMap::~ColorMap
virtual ~ColorMap()
Dtor.
Definition: ColorMap.hpp:80
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::HOT
@ HOT
Definition: ColorMap.hpp:64
lvr2::ColorMap::calcColorSHSV
void calcColorSHSV(float *color, size_t bucket)
Returns a color from a SHSV gradient.
Definition: ColorMap.cpp:97
lvr2::ColorMap::getColor
void getColor(float *color, size_t bucket, GradientType gradient=GREY)
Returns three float values for the color of the given bucket.
Definition: ColorMap.cpp:43
lvr2::GradientType
GradientType
Identifies a color gradient.
Definition: ColorMap.hpp:54
lvr2::ColorMap::m_numBuckets
size_t m_numBuckets
Number of colors in the color gradient.
Definition: ColorMap.hpp:154
lvr2::SOLID
@ SOLID
Definition: ColorMap.hpp:60
lvr2::ColorMap::calcColorJet
void calcColorJet(float *color, size_t bucket)
Returns a color from a Jet gradient.
Definition: ColorMap.cpp:115


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23