Main MRPT website > C++ reference
MRPT logo

color_maps.h

Go to the documentation of this file.
00001 /* +---------------------------------------------------------------------------+
00002    |          The Mobile Robot Programming Toolkit (MRPT) C++ library          |
00003    |                                                                           |
00004    |                   http://mrpt.sourceforge.net/                            |
00005    |                                                                           |
00006    |   Copyright (C) 2005-2011  University of Malaga                           |
00007    |                                                                           |
00008    |    This software was written by the Machine Perception and Intelligent    |
00009    |      Robotics Lab, University of Malaga (Spain).                          |
00010    |    Contact: Jose-Luis Blanco  <jlblanco@ctima.uma.es>                     |
00011    |                                                                           |
00012    |  This file is part of the MRPT project.                                   |
00013    |                                                                           |
00014    |     MRPT is free software: you can redistribute it and/or modify          |
00015    |     it under the terms of the GNU General Public License as published by  |
00016    |     the Free Software Foundation, either version 3 of the License, or     |
00017    |     (at your option) any later version.                                   |
00018    |                                                                           |
00019    |   MRPT is distributed in the hope that it will be useful,                 |
00020    |     but WITHOUT ANY WARRANTY; without even the implied warranty of        |
00021    |     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         |
00022    |     GNU General Public License for more details.                          |
00023    |                                                                           |
00024    |     You should have received a copy of the GNU General Public License     |
00025    |     along with MRPT.  If not, see <http://www.gnu.org/licenses/>.         |
00026    |                                                                           |
00027    +---------------------------------------------------------------------------+ */
00028 
00029 #ifndef color_maps_H
00030 #define color_maps_H
00031 
00032 #include <mrpt/utils/utils_defs.h>
00033 
00034 namespace mrpt
00035 {
00036         namespace utils
00037         {
00038                 /** Transform HSV color components to RGB, all of them in the range [0,1]
00039                   * \sa rgb2hsv
00040                   */
00041                 void BASE_IMPEXP hsv2rgb(
00042                         float   h,
00043                         float   s,
00044                         float   v,
00045                         float   &r,
00046                         float   &g,
00047                         float   &b);
00048 
00049                 /** Transform RGB color components to HSV, all of them in the range [0,1]
00050                   * \sa hsv2rgb
00051                   */
00052                 void BASE_IMPEXP rgb2hsv(
00053                         float   r,
00054                         float   g,
00055                         float   b,
00056                         float   &h,
00057                         float   &s,
00058                         float   &v );
00059 
00060                 /** Different colormaps
00061                   * \sa mrpt::vision::colormap
00062                   */
00063                 enum TColormap
00064                 {
00065                         cmGRAYSCALE = 0,
00066                         cmJET
00067                 };
00068 
00069                 /** Transform a float number in the range [0,1] into RGB components. Different colormaps are available.
00070                   */
00071                 void BASE_IMPEXP colormap(
00072                         const TColormap &color_map,
00073                         const float     color_index,
00074                         float   &r,
00075                         float   &g,
00076                         float   &b);
00077 
00078                 /** Computes the RGB color components (range [0,1]) for the corresponding color index in the range [0,1] using the MATLAB 'jet' colormap.
00079                   * \sa colormap
00080                   */
00081                 void BASE_IMPEXP jet2rgb(
00082                         const float     color_index,
00083                         float   &r,
00084                         float   &g,
00085                         float   &b);
00086         }
00087 }
00088 
00089 
00090 #endif



Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011