Image Component Library (ICL)
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
icl::core::PseudoColorConverter Struct Reference

Utility class for speudocolor conversion. More...

#include <PseudoColorConverter.h>

Classes

struct  Stop
 This is for creation of color gradients. More...
 

Public Types

enum  ColorTable { Default, Custom }
 mode internally used More...
 

Public Member Functions

 PseudoColorConverter (int maxValue=255)
 creates instance with default color table More...
 
 PseudoColorConverter (const std::vector< Stop > &stops, int maxValue=255)
 creates instance with custom mode More...
 
void setColorTable (ColorTable t, const std::vector< Stop > &stops=std::vector< Stop >(), int maxValue=255)
 sets the color table mode More...
 
void apply (const ImgBase *src, ImgBase **dst)
 create a speudo color image from given source image More...
 
void apply (const Img8u &src, Img8u &dst)
 create a speudo color image from given source image More...
 
const Img8uapply (const Img8u &src)
 create a speudo color image from given source image (using an internal buffer) More...
 
void save (const std::string &filename)
 writes current stop configuration to xml-configuration file with given name More...
 
void load (const std::string &filename)
 loads new stop configuration from given xml-configuration file More...
 

Private Attributes

Data * m_data
 Internally used data pointer. More...
 

Detailed Description

Utility class for speudocolor conversion.

The PseudoColorConverter converts a given 1-channel image into an RGB pseudocolor image. It can be set up to use a default color-table or it can be set up using a Stop-based piecewise linear color table as internal convert lookup table

Member Enumeration Documentation

◆ ColorTable

mode internally used

Enumerator
Default 

default mode using default gradient

Custom 

custom mode using a custom gradient

Constructor & Destructor Documentation

◆ PseudoColorConverter() [1/2]

icl::core::PseudoColorConverter::PseudoColorConverter ( int  maxValue = 255)

creates instance with default color table

The maxValue parameter defines the maximum expected value found in input images

◆ PseudoColorConverter() [2/2]

icl::core::PseudoColorConverter::PseudoColorConverter ( const std::vector< Stop > &  stops,
int  maxValue = 255 
)

creates instance with custom mode

See also
setColorTable

Member Function Documentation

◆ apply() [1/3]

void icl::core::PseudoColorConverter::apply ( const ImgBase src,
ImgBase **  dst 
)

create a speudo color image from given source image

◆ apply() [2/3]

void icl::core::PseudoColorConverter::apply ( const Img8u src,
Img8u dst 
)

create a speudo color image from given source image

◆ apply() [3/3]

const Img8u& icl::core::PseudoColorConverter::apply ( const Img8u src)

create a speudo color image from given source image (using an internal buffer)

◆ load()

void icl::core::PseudoColorConverter::load ( const std::string &  filename)

loads new stop configuration from given xml-configuration file

◆ save()

void icl::core::PseudoColorConverter::save ( const std::string &  filename)

writes current stop configuration to xml-configuration file with given name

◆ setColorTable()

void icl::core::PseudoColorConverter::setColorTable ( ColorTable  t,
const std::vector< Stop > &  stops = std::vector< Stop >(),
int  maxValue = 255 
)

sets the color table mode

if mode is default, stops must be empty If the custom mode is used, stops is used and internally stored. Stops are sorted automatically by there relative position. The minimum allowed relative position is 0, the maximum allowed relative position is 1. If these bounds are exceeded, an ICLException is thrown. If the first sorted stop has not relative position 0.0, an extra stop is prepended with relative position 0.0 and black color (r=g=b=0). If the last sorted stop's position is not 1.0, an extra stop is appended with absolute position 1.0 and white color (r=g=b=255). The stops list must at least contain one stop. If only one stop is contained, all pixels are set to the given color. However, there are simpler functions that have the same result and are less complex (like Img<T>::clear(channelIndx,color))

Member Data Documentation

◆ m_data

Data* icl::core::PseudoColorConverter::m_data
private

Internally used data pointer.


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