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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019