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::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 }
60 
61 
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:29
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:35
GLubyte g
Definition: glext.h:6279
Undefined colormap [New in MRPT 2.0].
Definition: color_maps.h:32
GLubyte GLubyte b
Definition: glext.h:6279
#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:73
const GLdouble * v
Definition: glext.h:3678
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:62



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020