MRPT  2.0.1
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-2020, 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 
11 #include <mrpt/img/TColor.h>
13 
14 namespace mrpt::img
15 {
16 /** \addtogroup color_maps Color map functions (in #include
17  * <mrpt/img/color_maps.h>)
18  * \ingroup mrpt_img_grp
19  * @{ */
20 
21 /** Transform HSV color components to RGB, all of them in the range [0,1] \sa
22  * rgb2hsv */
23 void hsv2rgb(float h, float s, float v, float& r, float& g, float& b);
24 
25 /** Transform RGB color components to HSV, all of them in the range [0,1] \sa
26  * hsv2rgb */
27 void rgb2hsv(float r, float g, float b, float& h, float& s, float& v);
28 
29 /** Different colormaps for use in mrpt::img::colormap() */
31 {
32  /** Undefined colormap [New in MRPT 2.0] */
33  cmNONE = -1,
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 /// \overload returning mrpt::img::TColor
47 mrpt::img::TColor colormap(const TColormap& color_map, const float color_index);
48 
49 /** Computes the RGB color components (range [0,1]) for the corresponding color
50  * index in the range [0,1] using the MATLAB 'jet' colormap. \sa colormap */
51 void jet2rgb(const float color_index, float& r, float& g, float& b);
52 
53 /** Computes the RGB color components (range [0,1]) for the corresponding color
54  * index in the range [0,1] using the MATLAB 'hot' colormap. \sa colormap */
55 void hot2rgb(const float color_index, float& r, float& g, float& b);
56 
57 /** @} */
58 } // 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:30
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:205
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:37
#define MRPT_ENUM_TYPE_END()
Definition: TEnumType.h:78
Undefined colormap [New in MRPT 2.0].
Definition: color_maps.h:33
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
A RGB color - 8bit.
Definition: TColor.h:25
#define MRPT_ENUM_TYPE_BEGIN(_ENUM_TYPE_WITH_NS)
Definition: TEnumType.h:62



Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020