MRPT  1.9.9
color_maps.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2019, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt::img
14 {
15 /** \addtogroup color_maps Color map functions (in #include
16  * <mrpt/img/color_maps.h>)
17  * \ingroup mrpt_img_grp
18  * @{ */
19 
20 /** Transform HSV color components to RGB, all of them in the range [0,1] \sa
21  * rgb2hsv */
22 void hsv2rgb(float h, float s, float v, float& r, float& g, float& b);
23 
24 /** Transform RGB color components to HSV, all of them in the range [0,1] \sa
25  * hsv2rgb */
26 void rgb2hsv(float r, float g, float b, float& h, float& s, float& v);
27 
28 /** Different colormaps for use in mrpt::img::colormap() */
30 {
31  cmNONE = -1, /** Undefined colormap [New in MRPT 2.0] */
34  /** [New in MRPT 1.5.0] */
36 };
37 
38 /** Transform a float number in the range [0,1] into RGB components. Different
39  * colormaps are available. */
40 void colormap(
41  const TColormap& color_map, const float color_index, float& r, float& g,
42  float& b);
43 
44 /** Computes the RGB color components (range [0,1]) for the corresponding color
45  * index in the range [0,1] using the MATLAB 'jet' colormap. \sa colormap */
46 void jet2rgb(const float color_index, float& r, float& g, float& b);
47 
48 /** Computes the RGB color components (range [0,1]) for the corresponding color
49  * index in the range [0,1] using the MATLAB 'hot' colormap. \sa colormap */
50 void hot2rgb(const float color_index, float& r, float& g, float& b);
51 
52 /** @} */
53 } // namespace mrpt::img
void colormap(const TColormap &color_map, const float color_index, float &r, float &g, float &b)
Transform a float number in the range [0,1] into RGB components.
Definition: color_maps.cpp:114
TColormap
Different colormaps for use in mrpt::img::colormap()
Definition: color_maps.h:29
GLdouble s
Definition: glext.h:3682
void hot2rgb(const float color_index, float &r, float &g, float &b)
Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0...
Definition: color_maps.cpp:208
void jet2rgb(const float color_index, float &r, float &g, float &b)
Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0...
Definition: color_maps.cpp:142
[New in MRPT 1.5.0]
Definition: color_maps.h:35
GLubyte g
Definition: glext.h:6372
Undefined colormap [New in MRPT 2.0].
Definition: color_maps.h:32
GLubyte GLubyte b
Definition: glext.h:6372
#define MRPT_ENUM_TYPE_END()
Definition: TEnumType.h:78
void rgb2hsv(float r, float g, float b, float &h, float &s, float &v)
Transform RGB color components to HSV, all of them in the range [0,1].
Definition: color_maps.cpp:74
const GLdouble * v
Definition: glext.h:3684
MRPT_FILL_ENUM_MEMBER(mrpt::img, cmNONE)
GLdouble GLdouble GLdouble r
Definition: glext.h:3711
void hsv2rgb(float h, float s, float v, float &r, float &g, float &b)
Transform HSV color components to RGB, all of them in the range [0,1].
Definition: color_maps.cpp:23
#define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS)
Definition: TEnumType.h:62



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ce1a28c9f Fri Aug 23 08:02:09 2019 +0200 at vie ago 23 08:10:11 CEST 2019