Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::view::Palette Class Reference

Detailed Description

a color map.

Colors are chosen randomly.

Used for the k-Frechet algorithm to color-code components.

Author
Peter Schäfer

Definition at line 17 of file palette.h.

#include <palette.h>

Public Member Functions

 Palette ()
 constructor; creates an empty palette More...
 
QColor operator[] (size_t key)
 look up a color More...
 
void clear ()
 remove all entries from the map More...
 

Static Public Member Functions

static QColor toColor (int x, int sat=220, int light=200)
 map an integer key to a color More...
 

Private Types

typedef QMap< size_t, QColor > ColorMap
 maps component IDs to random colors More...
 

Private Member Functions

QColor randomColor ()
 
QColor nextColor (size_t key)
 get color for a component; chose a new random color, if necessary More...
 
void stronger (QColor &col)
 make the color a darker saturation More...
 
void weaker (QColor &col)
 make the color a lighter saturation More...
 
void addLightness (QColor &col, double diff)
 modify the lightness of a color More...
 

Private Attributes

ColorMap map
 the map More...
 

Member Typedef Documentation

◆ ColorMap

typedef QMap<size_t,QColor> frechet::view::Palette::ColorMap
private

maps component IDs to random colors

Definition at line 21 of file palette.h.

Constructor & Destructor Documentation

◆ Palette()

Palette::Palette ( )

constructor; creates an empty palette

Definition at line 35 of file palette.cpp.

Member Function Documentation

◆ addLightness()

void frechet::view::Palette::addLightness ( QColor &  col,
double  diff 
)
inlineprivate

modify the lightness of a color

Parameters
colmodified on return
diffdifference in lightness

Definition at line 50 of file palette.h.

◆ clear()

void Palette::clear ( )

remove all entries from the map

Definition at line 52 of file palette.cpp.

◆ nextColor()

QColor Palette::nextColor ( size_t  key)
private

get color for a component; chose a new random color, if necessary

Parameters
keycomponent ID
Returns
the color for the key

Definition at line 20 of file palette.cpp.

◆ operator[]()

QColor Palette::operator[] ( size_t  key)

look up a color

Parameters
keycomponent ID
Returns
associated color; chosen randomly

Definition at line 38 of file palette.cpp.

◆ randomColor()

QColor Palette::randomColor ( )
private
Returns
a new random color

Definition at line 16 of file palette.cpp.

◆ stronger()

void frechet::view::Palette::stronger ( QColor &  col)
inlineprivate

make the color a darker saturation

Parameters
colmodified on return

Definition at line 35 of file palette.h.

◆ toColor()

QColor Palette::toColor ( int  x,
int  sat = 220,
int  light = 200 
)
static

map an integer key to a color

Parameters
xkey value
satsaturation
lightlightness
Returns
a color

Definition at line 30 of file palette.cpp.

◆ weaker()

void frechet::view::Palette::weaker ( QColor &  col)
inlineprivate

make the color a lighter saturation

Parameters
colmodified on return

Definition at line 42 of file palette.h.

Member Data Documentation

◆ map

ColorMap frechet::view::Palette::map
private

the map

Definition at line 23 of file palette.h.


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