Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Private Attributes
icl::core::PseudoColorConverter Struct Reference

Utility class for speudocolor conversion. More...

#include <PseudoColorConverter.h>

List of all members.

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

Private Attributes

Data * m_data
 Internally used data pointer.

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

mode internally used

Enumerator:
Default 

default mode using default gradient

Custom 

custom mode using a custom gradient


Constructor & Destructor Documentation

creates instance with default color table

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

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

creates instance with custom mode

See also:
setColorTable

Member Function Documentation

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

create a speudo color image from given source image

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

create a speudo color image from given source image

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

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

loads new stop configuration from given xml-configuration file

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

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

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

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

Internally used data pointer.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines