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 
51 {
52  SOLID = 0,
53  GREY = 1,
54  HSV = 2,
55  JET = 3,
56  HOT = 4,
57  SHSV = 5,
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_ */
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
void calcColorHot(float *color, size_t bucket)
Returns a color from a hot gradient.
Definition: ColorMap.cpp:103
virtual ~ColorMap()
Dtor.
Definition: ColorMap.hpp:76
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
void calcColorSHSV(float *color, size_t bucket)
Returns a color from a SHSV gradient.
Definition: ColorMap.cpp:97
GradientType
Identifies a color gradient.
Definition: ColorMap.hpp:50
void calcColorGrey(float *color, size_t bucket)
Returns a color from a gray gradient.
Definition: ColorMap.cpp:83
void calcColorJet(float *color, size_t bucket)
Returns a color from a Jet gradient.
Definition: ColorMap.cpp:115
void calcColorHSV(float *color, size_t bucket)
Returns a color from a HSV gradient.
Definition: ColorMap.cpp:90
size_t m_numBuckets
Number of colors in the color gradient.
Definition: ColorMap.hpp:150
ColorMap(size_t buckets)
Ctor. Constructs a color gradient with the given number of buckets.
Definition: ColorMap.hpp:71
void calcColorSimpsons(float *color, size_t bucket)
Returns a color from a Simpsons gradient.
Definition: ColorMap.cpp:76


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 Mon Feb 28 2022 22:46:06