Image Component Library (ICL)
|
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 Img8u & | apply (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... | |
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
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
icl::core::PseudoColorConverter::PseudoColorConverter | ( | const std::vector< Stop > & | stops, |
int | maxValue = 255 |
||
) |
creates instance with custom mode
create a speudo color image from given source image
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 |
||
) |
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))
|
private |
Internally used data pointer.