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  /** Undefined colormap [New in MRPT 2.0] */
32  cmNONE = -1,
35  /** [New in MRPT 1.5.0] */
37 };
38 
39 /** Transform a float number in the range [0,1] into RGB components. Different
40  * colormaps are available. */
41 void colormap(
42  const TColormap& color_map, const float color_index, float& r, float& g,
43  float& b);
44 
45 /** Computes the RGB color components (range [0,1]) for the corresponding color
46  * index in the range [0,1] using the MATLAB 'jet' colormap. \sa colormap */
47 void jet2rgb(const float color_index, float& r, float& g, float& b);
48 
49 /** Computes the RGB color components (range [0,1]) for the corresponding color
50  * index in the range [0,1] using the MATLAB 'hot' colormap. \sa colormap */
51 void hot2rgb(const float color_index, float& r, float& g, float& b);
52 
53 /** @} */
54 } // 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
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:36
#define MRPT_ENUM_TYPE_END()
Definition: TEnumType.h:78
Undefined colormap [New in MRPT 2.0].
Definition: color_maps.h:32
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
MRPT_FILL_ENUM_MEMBER(mrpt::img, cmNONE)
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: 24b95e159 Thu Jan 23 01:15:46 2020 +0100 at jue ene 23 01:30:10 CET 2020