#include <ColorTableTSL.h>
Inheritance diagram for ColorTableTSL:
Members to be used by the ColorTableTSL dialog | |
void | convertYUVToTSL (unsigned char y, unsigned char u, unsigned char v, unsigned char *t, unsigned char *s, unsigned char *l) const |
colorClass | classifyTSL (unsigned char t, unsigned char s, unsigned char l) const |
unsigned char | colorClasses [32][64][64] |
unsigned char | tsl_threshold [numOfColors][2][3] |
unsigned char | tsl_index |
colorClass | tsl_order [numOfColors] |
Public Member Functions | |
ColorTableTSL () | |
~ColorTableTSL () | |
void | clear () |
void | reset () |
void | generateTSLDialogImage (const Image &image, ColorClassImage &colorClassImage) |
void | addColorClass (colorClass colorClass, unsigned char t_min, unsigned char t_max, unsigned char s_min, unsigned char s_max, unsigned char l_min, unsigned char l_max) |
void | calculateLUT () |
virtual colorClass | getColorClass (const unsigned char y, const unsigned char u, const unsigned char v) const |
virtual void | generateColorClassImage (const Image &image, ColorClassImage &colorClassImage) const |
Definition at line 29 of file ColorTableTSL.h.
ColorTableTSL::ColorTableTSL | ( | ) |
Constructor
Definition at line 15 of file ColorTableTSL.cpp.
ColorTableTSL::~ColorTableTSL | ( | ) |
Destructor
Definition at line 23 of file ColorTableTSL.cpp.
void ColorTableTSL::addColorClass | ( | colorClass | colorClass, | |
unsigned char | t_min, | |||
unsigned char | t_max, | |||
unsigned char | s_min, | |||
unsigned char | s_max, | |||
unsigned char | l_min, | |||
unsigned char | l_max | |||
) |
Add a TSL range color class to the color table
colorClass | the color class | |
t_min | the min t value | |
t_max | the max t value | |
s_min | the min s value | |
s_max | the max s value | |
l_min | the min l value | |
l_max | the max l value |
Definition at line 77 of file ColorTableTSL.cpp.
References tsl_index, tsl_order, and tsl_threshold.
Referenced by reset().
void ColorTableTSL::calculateLUT | ( | ) |
Calculates the lookup table
Definition at line 99 of file ColorTableTSL.cpp.
References classifyTSL(), colorClasses, and convertYUVToTSL().
Referenced by Cognition::handleMessage(), and ColorTableTSLMod::setup().
colorClass ColorTableTSL::classifyTSL | ( | unsigned char | t, | |
unsigned char | s, | |||
unsigned char | l | |||
) | const |
TSL->colorClass classification
Definition at line 208 of file ColorTableTSL.cpp.
References noColor, tsl_index, tsl_order, and tsl_threshold.
Referenced by calculateLUT(), and generateTSLDialogImage().
void ColorTableTSL::clear | ( | ) |
Clear color tables
Definition at line 30 of file ColorTableTSL.cpp.
References colorClasses, noColor, numOfColors, orange, tsl_index, tsl_order, and tsl_threshold.
Referenced by reset().
void ColorTableTSL::convertYUVToTSL | ( | unsigned char | y, | |
unsigned char | u, | |||
unsigned char | v, | |||
unsigned char * | t, | |||
unsigned char * | s, | |||
unsigned char * | l | |||
) | const |
YUV->TSL conversion
Definition at line 139 of file ColorTableTSL.cpp.
Referenced by calculateLUT(), CTSLColorTableToolDlgBar::createHistograms(), and generateTSLDialogImage().
void ColorTableTSL::generateColorClassImage | ( | const Image & | image, | |
ColorClassImage & | colorClassImage | |||
) | const [virtual] |
Segments an image to an color class image.
This doesn't need to used in the image processor, but is needed for visualisation of color tables.
image | A reference to the image to be segmented | |
colorClassImage | A reference to the color class image to be created |
Reimplemented from ColorTable.
Definition at line 245 of file ColorTableTSL.cpp.
References ColorCorrector::correct(), getColorClass(), ColorClassImage::height, ColorClassImage::image, image, and ColorClassImage::width.
void ColorTableTSL::generateTSLDialogImage | ( | const Image & | image, | |
ColorClassImage & | colorClassImage | |||
) |
Generates the Image for the TSL-Dialog-Bar
Definition at line 340 of file ColorTableTSL.cpp.
References classifyTSL(), convertYUVToTSL(), ColorClassImage::height, ColorClassImage::image, image, and ColorClassImage::width.
Referenced by CTSLColorTableToolDlgBar::handleMessage(), CTSLColorTableToolDlgBar::OnTSLColorTableToolLoad(), and CTSLColorTableToolDlgBar::updateSegmentedImage().
colorClass ColorTableTSL::getColorClass | ( | const unsigned char | y, | |
const unsigned char | u, | |||
const unsigned char | v | |||
) | const [virtual] |
Returns the color class of a pixel.
y | the y value of the pixel | |
u | the u value of the pixel | |
v | the v value of the pixel |
Reimplemented from ColorTable.
Definition at line 121 of file ColorTableTSL.cpp.
References colorClasses.
Referenced by generateColorClassImage().
void ColorTableTSL::reset | ( | ) |
unsigned char ColorTableTSL::colorClasses[32][64][64] |
The color table. Each entry contains both the color class A (lower 4 bits) and the color class B (higher 4 bits) values. As Y information is less relevant, only 5 bits are used for Y; U and V use 6 bits.
Definition at line 132 of file ColorTableTSL.h.
Referenced by calculateLUT(), clear(), and getColorClass().
unsigned char ColorTableTSL::tsl_index |
The TSL threshold index.
Definition at line 147 of file ColorTableTSL.h.
Referenced by addColorClass(), classifyTSL(), clear(), and CTSLColorTableToolDlgBar::OnTSLColorTableToolOrderDown().
colorClass ColorTableTSL::tsl_order[numOfColors] |
The TSL order table. It contains a permutation of colorClass.
Definition at line 153 of file ColorTableTSL.h.
Referenced by addColorClass(), classifyTSL(), clear(), CTSLColorTableToolDlgBar::OnTSLColorTableToolColorSelect(), CTSLColorTableToolDlgBar::OnTSLColorTableToolLoad(), CTSLColorTableToolDlgBar::OnTSLColorTableToolOrderDown(), CTSLColorTableToolDlgBar::OnTSLColorTableToolOrderUp(), operator<<(), and operator>>().
unsigned char ColorTableTSL::tsl_threshold[numOfColors][2][3] |
The TSL threshold table. This table stores the TSL thresholds as given by addColorClass() and updateColorClass(). The first index selects the color class. The second index selects min (0) or max (1). The third index selects t (0), s (1) or l (2).
Definition at line 142 of file ColorTableTSL.h.
Referenced by addColorClass(), classifyTSL(), clear(), CTSLColorTableToolDlgBar::OnHScroll(), CTSLColorTableToolDlgBar::OnTSLColorTableToolAuto(), CTSLColorTableToolDlgBar::OnTSLColorTableToolLMaxNumber(), CTSLColorTableToolDlgBar::OnTSLColorTableToolLMinNumber(), CTSLColorTableToolDlgBar::OnTSLColorTableToolSMaxNumber(), CTSLColorTableToolDlgBar::OnTSLColorTableToolSMinNumber(), CTSLColorTableToolDlgBar::OnTSLColorTableToolTMaxNumber(), CTSLColorTableToolDlgBar::OnTSLColorTableToolTMinNumber(), operator<<(), and operator>>().