v2.0.0
Loading...
Searching...
No Matches
DISPLIB::ColorMap Class Reference

Static lookup helpers mapping scalar values to QRgb / QColor across all DISPLIB palettes. More...

#include <colormap.h>

Public Types

typedef QSharedPointer< ColorMapSPtr
typedef QSharedPointer< const ColorMapConstSPtr

Public Member Functions

 ColorMap ()
 ~ColorMap ()

Static Public Member Functions

static QRgb valueToColor (double v, const QString &sMap)
static QRgb valueToJet (double v)
static QRgb valueToHot (double v)
static QRgb valueToHotNegative1 (double v)
static QRgb valueToHotNegative2 (double v)
static QRgb valueToBone (double v)
static QRgb valueToRedBlue (double v)
static QRgb valueToCool (double v)
static QRgb valueToViridis (double v)
static QRgb valueToViridisNegated (double v)

Static Protected Member Functions

static double linearSlope (double x, double m, double n)
static int jetR (double v)
static int jetG (double v)
static int jetB (double v)
static int hotR (double v)
static int hotG (double v)
static int hotB (double v)
static int hotRNeg1 (double v)
static int hotGNeg1 (double v)
static int hotBNeg1 (double v)
static int hotRNeg2 (double v)
static int hotGNeg2 (double v)
static int hotBNeg2 (double v)
static int boneR (double v)
static int boneG (double v)
static int boneB (double v)
static int rbR (double v)
static int rbG (double v)
static int rbB (double v)
static int coolR (double v)
static int coolG (double v)
static int coolB (double v)

Detailed Description

Static lookup helpers mapping scalar values to QRgb / QColor across all DISPLIB palettes.

Each palette exists as a 256-row Eigen::MatrixX3i RGB table; the valueToXxx accessors interpolate between rows so callers can map any value in \([0,1]\) to a colour without instantiating an object. Bundled palettes include Viridis, Jet, Hot, HotNeg1, HotNeg2, Bone, Cool, RedBlue and the MNE-Python hot variant.

Definition at line 330 of file colormap.h.

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const ColorMap> DISPLIB::ColorMap::ConstSPtr

Const shared pointer type for ColorMap class.

Definition at line 334 of file colormap.h.

◆ SPtr

typedef QSharedPointer<ColorMap> DISPLIB::ColorMap::SPtr

Shared pointer type for ColorMap class.

Definition at line 333 of file colormap.h.

Constructor & Destructor Documentation

◆ ColorMap()

ColorMap::ColorMap ( )

Default constructor

Definition at line 33 of file colormap.cpp.

◆ ~ColorMap()

ColorMap::~ColorMap ( )

Destructs the ColorMap class.

Definition at line 39 of file colormap.cpp.

Member Function Documentation

◆ boneB()

int ColorMap::boneB ( double v)
staticprotected

Describes the blue Bone fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 237 of file colormap.cpp.

◆ boneG()

int ColorMap::boneG ( double v)
staticprotected

Describes the green Bone fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 224 of file colormap.cpp.

◆ boneR()

int ColorMap::boneR ( double v)
staticprotected

Describes the red Bone fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 211 of file colormap.cpp.

◆ coolB()

int ColorMap::coolB ( double v)
staticprotected

Describes the blue Cool fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 299 of file colormap.cpp.

◆ coolG()

int ColorMap::coolG ( double v)
staticprotected

Describes the green Cool fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 291 of file colormap.cpp.

◆ coolR()

int ColorMap::coolR ( double v)
staticprotected

Describes the red Cool fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 283 of file colormap.cpp.

◆ hotB()

int ColorMap::hotB ( double v)
staticprotected

Describes the blue Hot fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 126 of file colormap.cpp.

◆ hotBNeg1()

int ColorMap::hotBNeg1 ( double v)
staticprotected

Describes the blue Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 163 of file colormap.cpp.

◆ hotBNeg2()

int ColorMap::hotBNeg2 ( double v)
staticprotected

Describes the blue Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 200 of file colormap.cpp.

◆ hotG()

int ColorMap::hotG ( double v)
staticprotected

Describes the green Hot fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 113 of file colormap.cpp.

◆ hotGNeg1()

int ColorMap::hotGNeg1 ( double v)
staticprotected

Describes the green Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 150 of file colormap.cpp.

◆ hotGNeg2()

int ColorMap::hotGNeg2 ( double v)
staticprotected

Describes the green Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 187 of file colormap.cpp.

◆ hotR()

int ColorMap::hotR ( double v)
staticprotected

Describes the red Hot fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 102 of file colormap.cpp.

◆ hotRNeg1()

int ColorMap::hotRNeg1 ( double v)
staticprotected

Describes the red Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 137 of file colormap.cpp.

◆ hotRNeg2()

int ColorMap::hotRNeg2 ( double v)
staticprotected

Describes the red Hot negative skewed fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 174 of file colormap.cpp.

◆ jetB()

int ColorMap::jetB ( double v)
staticprotected

Describes the blue Jet fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 87 of file colormap.cpp.

◆ jetG()

int ColorMap::jetG ( double v)
staticprotected

Describes the green Jet fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 70 of file colormap.cpp.

◆ jetR()

int ColorMap::jetR ( double v)
staticprotected

Describes the red Jet fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 53 of file colormap.cpp.

◆ linearSlope()

double ColorMap::linearSlope ( double x,
double m,
double n )
staticprotected

Describes a linear function (y = mx + n) and returns the output value y

Parameters
[in]xinput value.
[in]mslope.
[in]noffset.
Returns
the output value.

Definition at line 45 of file colormap.cpp.

◆ rbB()

int ColorMap::rbB ( double v)
staticprotected

Describes the blue RedBlue fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 272 of file colormap.cpp.

◆ rbG()

int ColorMap::rbG ( double v)
staticprotected

Describes the green RedBlue fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 261 of file colormap.cpp.

◆ rbR()

int ColorMap::rbR ( double v)
staticprotected

Describes the red RedBlue fuzzy set. Calculates to an input value v [0,1] the corresponding output color value [0,255]

Parameters
[in]vinput value [0,1].
Returns
the output color value [0.255].

Definition at line 250 of file colormap.cpp.

◆ valueToBone()

QRgb DISPLIB::ColorMap::valueToBone ( double v)
inlinestatic

Returns a Bone RGB to a given double value [0,1]

Parameters
[in]vthe double which has to be part of the intervall [0,1].
Returns
the corresponding Bone RGB.

Definition at line 753 of file colormap.h.

◆ valueToColor()

QRgb DISPLIB::ColorMap::valueToColor ( double v,
const QString & sMap )
inlinestatic

Returns a Jet RGB to a given double value [0,1] and a colormap specified by sMap. If no matching colormap was found return Jet.

Parameters
[in]vthe double which has to be part of the intervall [0,1].
[in]sMapthe colormap to choose.
Returns
the corresponding RGB value.

Definition at line 681 of file colormap.h.

◆ valueToCool()

QRgb DISPLIB::ColorMap::valueToCool ( double v)
inlinestatic

Returns a Cool RGB to a given double value [-1,1]

Parameters
[in]vthe double which has to be part of the intervall [-1,1].
Returns
the corresponding Cool RGB.

Definition at line 769 of file colormap.h.

◆ valueToHot()

QRgb DISPLIB::ColorMap::valueToHot ( double v)
inlinestatic

Returns a Hot RGB to a given double value [0,1]

Parameters
[in]vthe double which has to be part of the intervall [0,1].
Returns
the corresponding Hot RGB.

Definition at line 729 of file colormap.h.

◆ valueToHotNegative1()

QRgb DISPLIB::ColorMap::valueToHotNegative1 ( double v)
inlinestatic

Returns a negative skewed hot RGB to a given double value [0,1]

Parameters
[in]vthe double which has to be part of the intervall [0,1].
Returns
the corresponding negative skewed Hot RGB.

Definition at line 737 of file colormap.h.

◆ valueToHotNegative2()

QRgb DISPLIB::ColorMap::valueToHotNegative2 ( double v)
inlinestatic

Returns a negative skewed hot RGB to a given double value [0,1]

Parameters
[in]vthe double which has to be part of the intervall [0,1].
Returns
the corresponding negative skewed Hot RGB.

Definition at line 745 of file colormap.h.

◆ valueToJet()

QRgb DISPLIB::ColorMap::valueToJet ( double v)
inlinestatic

Returns a Jet RGB to a given double value [0,1]

Parameters
[in]vthe double which has to be part of the intervall [0,1].
Returns
the corresponding Jet RGB.

Definition at line 721 of file colormap.h.

◆ valueToRedBlue()

QRgb DISPLIB::ColorMap::valueToRedBlue ( double v)
inlinestatic

Returns a RedBlue RGB to a given double value [-1,1]

Parameters
[in]vthe double which has to be part of the intervall [-1,1].
Returns
the corresponding Bone RGB.

Definition at line 761 of file colormap.h.

◆ valueToViridis()

QRgb DISPLIB::ColorMap::valueToViridis ( double v)
inlinestatic

Returns a Viridis RGB to a given double value [-1,1]

Parameters
[in]vthe double which has to be part of the intervall [-1,1].
Returns
the corresponding Cool RGB.

Definition at line 777 of file colormap.h.

◆ valueToViridisNegated()

QRgb DISPLIB::ColorMap::valueToViridisNegated ( double v)
inlinestatic

Returns a negated Viridis RGB to a given double value [-1,1]

Parameters
[in]vthe double which has to be part of the intervall [-1,1].
Returns
the corresponding Cool RGB.

Definition at line 790 of file colormap.h.


The documentation for this class was generated from the following files: