MRPT  1.9.9
Enumerations | Functions
Color map functions (in #include

Detailed Description

<mrpt/img/color_maps.h>)

Collaboration diagram for Color map functions (in #include:

Enumerations

enum  mrpt::img::TColormap { mrpt::img::cmNONE = -1, mrpt::img::cmGRAYSCALE = 0, mrpt::img::cmJET, mrpt::img::cmHOT }
 Different colormaps for use in mrpt::img::colormap() More...
 

Functions

void mrpt::img::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]. More...
 
void mrpt::img::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]. More...
 
void mrpt::img::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. More...
 
mrpt::img::TColor mrpt::img::colormap (const TColormap &color_map, const float color_index)
 
void mrpt::img::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,1] using the MATLAB 'jet' colormap. More...
 
void mrpt::img::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,1] using the MATLAB 'hot' colormap. More...
 

Enumeration Type Documentation

◆ TColormap

Different colormaps for use in mrpt::img::colormap()

Enumerator
cmNONE 

Undefined colormap [New in MRPT 2.0].

cmGRAYSCALE 
cmJET 
cmHOT 

[New in MRPT 1.5.0]

Definition at line 30 of file color_maps.h.

Function Documentation

◆ colormap() [1/2]

void mrpt::img::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.

Different colormaps are available.

Definition at line 114 of file color_maps.cpp.

References mrpt::img::cmGRAYSCALE, mrpt::img::cmHOT, mrpt::img::cmJET, mrpt::img::hot2rgb(), mrpt::img::jet2rgb(), MRPT_END, MRPT_START, and THROW_EXCEPTION.

Referenced by mrpt::img::colormap(), mrpt::maps::CHeightGridMap2D::getAs3DObject(), mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), mrpt::maps::CPointsMap::TRenderOptions::loadFromConfigFile(), mrpt::opengl::CColorBar::onUpdateBuffers_all(), mrpt::opengl::CMeshFast::onUpdateBuffers_Points(), mrpt::obs::CObservation3DRangeScan::rangeImageAsImage(), mrpt::maps::CPointsMap::TRenderOptions::readFromStream(), mrpt::opengl::CPointCloudColoured::recolorizeByCoordinate(), mrpt::opengl::CColorBar::setColormap(), TEST(), mrpt::opengl::CMesh::updateTriangles(), and mrpt::maps::CPointsMap::TRenderOptions::writeToStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ colormap() [2/2]

mrpt::img::TColor mrpt::img::colormap ( const TColormap color_map,
const float  color_index 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 266 of file color_maps.cpp.

References mrpt::img::TColorf::asTColor(), and mrpt::img::colormap().

Here is the call graph for this function:

◆ hot2rgb()

void mrpt::img::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,1] using the MATLAB 'hot' colormap.

See also
colormap

Definition at line 205 of file color_maps.cpp.

References mrpt::math::interpolate().

Referenced by mrpt::img::colormap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hsv2rgb()

void mrpt::img::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].

See also
rgb2hsv

Definition at line 23 of file color_maps.cpp.

◆ jet2rgb()

void mrpt::img::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,1] using the MATLAB 'jet' colormap.

See also
colormap

Definition at line 142 of file color_maps.cpp.

References mrpt::math::interpolate().

Referenced by mrpt::img::colormap(), mrpt::maps::CGasConcentrationGridMap2D::getWindAs3DObject(), mrpt::maps::detail::pointmap_traits< CColouredPointsMap >::internal_loadFromRangeScan2D_prepareOneRange(), and mrpt::maps::detail::pointmap_traits< CColouredPointsMap >::internal_loadFromRangeScan3D_prepareOneRange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rgb2hsv()

void mrpt::img::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].

See also
hsv2rgb

Definition at line 74 of file color_maps.cpp.

References mrpt::max3(), and mrpt::min3().

Here is the call graph for this function:



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020