DGtal  1.2.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
DGtal::RandomColorMap Class Reference

Aim: access to random color from a gradientColorMap. More...

#include <DGtal/io/colormaps/RandomColorMap.h>

Public Types

typedef unsigned int Value
 

Public Member Functions

 RandomColorMap (const RandomColorMap &other)
 
RandomColorMapoperator= (const RandomColorMap &anOther)
 
 RandomColorMap (const unsigned int &aFirstIndex, const unsigned int &aLastIndex, const Color &aFirstColor=Color::White, const Color &aLastColor=Color::Red)
 
void addColor (const Color &aColor)
 
Color operator() (const unsigned int &aValue) const
 
const unsigned int & min () const
 
const unsigned int & max () const
 
 ~RandomColorMap ()
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 

Protected Member Functions

 RandomColorMap ()
 

Protected Attributes

unsigned int myMin
 
unsigned int myMax
 

Private Member Functions

void associateRandomIndexColor ()
 

Private Attributes

GradientColorMap< unsigned int > * myGradientMap
 
std::vector< unsigned int > myColorIndex
 
std::vector< unsigned int > myFreeColorIndex
 

Detailed Description

Aim: access to random color from a gradientColorMap.

Description of class 'RandomColorMap'

Definition at line 59 of file RandomColorMap.h.

Member Typedef Documentation

◆ Value

typedef unsigned int DGtal::RandomColorMap::Value

Definition at line 65 of file RandomColorMap.h.

Constructor & Destructor Documentation

◆ RandomColorMap() [1/3]

DGtal::RandomColorMap::RandomColorMap ( const RandomColorMap other)

Copy constructor.

Parameters
otherthe object to clone. Forbidden by default.

◆ RandomColorMap() [2/3]

DGtal::RandomColorMap::RandomColorMap ( const unsigned int &  aFirstIndex,
const unsigned int &  aLastIndex,
const Color aFirstColor = Color::White,
const Color aLastColor = Color::Red 
)

Constructor from two unsigned intergers and two Colors.

◆ ~RandomColorMap()

DGtal::RandomColorMap::~RandomColorMap ( )

Destructor.

◆ RandomColorMap() [3/3]

DGtal::RandomColorMap::RandomColorMap ( )
protected

Constructor. Forbidden by default (protected to avoid g++ warnings).

Member Function Documentation

◆ addColor()

void DGtal::RandomColorMap::addColor ( const Color aColor)

Adds a color to the list of color steps.

Parameters
aColorA color.

Referenced by main().

◆ associateRandomIndexColor()

void DGtal::RandomColorMap::associateRandomIndexColor ( )
private

◆ isValid()

bool DGtal::RandomColorMap::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ max()

const unsigned int& DGtal::RandomColorMap::max ( ) const

Returns the upper bound of the value range.

Returns
The upper bound of the value range.

◆ min()

const unsigned int& DGtal::RandomColorMap::min ( ) const

Returns the lower bound of the value range.

Returns
The lower bound of the value range.

◆ operator()()

Color DGtal::RandomColorMap::operator() ( const unsigned int &  aValue) const

Computes the color associated with a value in a given range.

Parameters
aValueA value within the value range.
Returns
A random color identified by an unique [aValue] within the current range.

◆ operator=()

RandomColorMap& DGtal::RandomColorMap::operator= ( const RandomColorMap anOther)

Assignment.

Parameters
anOtherthe object to copy.
Returns
a reference on 'this'. Forbidden by default.

◆ selfDisplay()

void DGtal::RandomColorMap::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

Field Documentation

◆ myColorIndex

std::vector<unsigned int> DGtal::RandomColorMap::myColorIndex
private

Definition at line 161 of file RandomColorMap.h.

◆ myFreeColorIndex

std::vector<unsigned int> DGtal::RandomColorMap::myFreeColorIndex
private

Definition at line 162 of file RandomColorMap.h.

◆ myGradientMap

GradientColorMap<unsigned int>* DGtal::RandomColorMap::myGradientMap
private

Definition at line 160 of file RandomColorMap.h.

◆ myMax

unsigned int DGtal::RandomColorMap::myMax
protected

The lower bound of the value range.

Definition at line 153 of file RandomColorMap.h.

◆ myMin

unsigned int DGtal::RandomColorMap::myMin
protected

The lower bound of the value range.

Definition at line 152 of file RandomColorMap.h.


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