Robowflex  v0.1
Making MoveIt Easy
robowflex::color Namespace Reference

Functions

void viridis (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to the Viridis colormap. More...
 
void coolwarm (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to the Cool-Warm colormap. More...
 
void extKindlmann (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to the Extended Kindlmann colormap. More...
 
void plasma (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to the Plasma colormap. More...
 
void turbo (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to the Turbo colormap. More...
 
void grayscale (double s, Eigen::Ref< Eigen::Vector4d > color)
 Maps a scalar s in [0, 1] to greyscale. More...
 
void toGrayscale (Eigen::Ref< Eigen::Vector4d > color)
 Maps an RGB color to a greyscale color based on luminosity. More...
 

Variables

static const Eigen::Vector4d BLACK {0., 0, 0, 1}
 
static const Eigen::Vector4d WHITE {1, 1, 1, 1}
 
static const Eigen::Vector4d GRAY {0.5, 0.5, 0.5, 1}
 
static const Eigen::Vector4d RED {1, 0, 0, 1}
 
static const Eigen::Vector4d PINK {1, 0.37, 0.81, 1}
 
static const Eigen::Vector4d PURPLE {0.62, 0.32, 1, 1}
 
static const Eigen::Vector4d GREEN {0, 1, 0, 1}
 
static const Eigen::Vector4d BLUE {0, 0, 1, 1}
 
static const Eigen::Vector4d YELLOW {1, 0.88, 0.12, 1}
 
static const Eigen::Vector4d ORANGE {1, 0.6, 0.06, 1}
 
static const Eigen::Vector4d BROWN {0.6, 0.5, 0.38, 1}
 

Function Documentation

◆ coolwarm()

void robowflex::color::coolwarm ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to the Cool-Warm colormap.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 324 of file colormap.cpp.

325 {
326  colormap(s, color[0], color[1], color[2], 32, COOLWARM);
327 }

◆ extKindlmann()

void robowflex::color::extKindlmann ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to the Extended Kindlmann colormap.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 329 of file colormap.cpp.

330 {
331  colormap(s, color[0], color[1], color[2], 32, EXT_KINDLMANN);
332 }

◆ grayscale()

void robowflex::color::grayscale ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to greyscale.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 344 of file colormap.cpp.

345 {
346  color[0] = s;
347  color[1] = s;
348  color[2] = s;
349 }

◆ plasma()

void robowflex::color::plasma ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to the Plasma colormap.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 334 of file colormap.cpp.

335 {
336  colormap(s, color[0], color[1], color[2], 32, PLASMA);
337 }

◆ toGrayscale()

void robowflex::color::toGrayscale ( Eigen::Ref< Eigen::Vector4d >  color)

Maps an RGB color to a greyscale color based on luminosity.

Parameters
[in,out]colorColor to convert.

Definition at line 351 of file colormap.cpp.

352 {
353  double v = 0.3 * color[0] + 0.59 * color[1] + 0.11 * color[2];
354  grayscale(v, color);
355 }
void grayscale(double s, Eigen::Ref< Eigen::Vector4d > color)
Maps a scalar s in [0, 1] to greyscale.
Definition: colormap.cpp:344

◆ turbo()

void robowflex::color::turbo ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to the Turbo colormap.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 339 of file colormap.cpp.

340 {
341  colormap(s, color[0], color[1], color[2], 256, TURBO);
342 }

◆ viridis()

void robowflex::color::viridis ( double  s,
Eigen::Ref< Eigen::Vector4d >  color 
)

Maps a scalar s in [0, 1] to the Viridis colormap.

Parameters
[in]sScalar to map.
[out]colorOutput color.

Definition at line 319 of file colormap.cpp.

320 {
321  colormap(s, color[0], color[1], color[2], 32, VIRIDIS);
322 }

Variable Documentation

◆ BLACK

const Eigen::Vector4d robowflex::color::BLACK {0., 0, 0, 1}
static

Definition at line 54 of file colormap.h.

◆ BLUE

const Eigen::Vector4d robowflex::color::BLUE {0, 0, 1, 1}
static

Definition at line 61 of file colormap.h.

◆ BROWN

const Eigen::Vector4d robowflex::color::BROWN {0.6, 0.5, 0.38, 1}
static

Definition at line 64 of file colormap.h.

◆ GRAY

const Eigen::Vector4d robowflex::color::GRAY {0.5, 0.5, 0.5, 1}
static

Definition at line 56 of file colormap.h.

◆ GREEN

const Eigen::Vector4d robowflex::color::GREEN {0, 1, 0, 1}
static

Definition at line 60 of file colormap.h.

◆ ORANGE

const Eigen::Vector4d robowflex::color::ORANGE {1, 0.6, 0.06, 1}
static

Definition at line 63 of file colormap.h.

◆ PINK

const Eigen::Vector4d robowflex::color::PINK {1, 0.37, 0.81, 1}
static

Definition at line 58 of file colormap.h.

◆ PURPLE

const Eigen::Vector4d robowflex::color::PURPLE {0.62, 0.32, 1, 1}
static

Definition at line 59 of file colormap.h.

◆ RED

const Eigen::Vector4d robowflex::color::RED {1, 0, 0, 1}
static

Definition at line 57 of file colormap.h.

◆ WHITE

const Eigen::Vector4d robowflex::color::WHITE {1, 1, 1, 1}
static

Definition at line 55 of file colormap.h.

◆ YELLOW

const Eigen::Vector4d robowflex::color::YELLOW {1, 0.88, 0.12, 1}
static

Definition at line 62 of file colormap.h.