#include <ColorTable32K.h>
Inheritance diagram for ColorTable32K:
Public Member Functions | |
ColorTable32K () | |
~ColorTable32K () | |
colorClass | getColorClassFast (const unsigned char y, const unsigned char u, const unsigned char v) const |
virtual colorClass | getColorClass (const unsigned char y, const unsigned char u, const unsigned char v) const |
void | getBoxAroundColorClass (colorClass color, Vector3< int > &pNear, Vector3< int > &pFar) |
virtual void | generateColorClassImage (const Image &image, ColorClassImage &colorClassImage) const |
virtual void | generateColorClassImage (const Image &image, ColorClassImage &colorClassImage, colorClass colorClass) const |
virtual void | generateHighResColorClassImage (const Image &image, ColorClassImage &colorClassImage) const |
virtual void | generateHighResColorClassImage (const Image &image, ColorClassImage &colorClassImage, colorClass colorClass) const |
void | unpack (unsigned char *unpackedCube, const unsigned char *packedCube) |
Members to be used by the ColorTable32K dialog | |
void | clear () |
void | clearChannel (colorClass colorClass) |
void | addColorClass (colorClass colorClass, unsigned char y, unsigned char u, unsigned char v) |
void | addColorClass (colorClass colorClass, unsigned char y, unsigned char u, unsigned char v, unsigned char range) |
void | addCuboidToColorClass (colorClass colorClass, unsigned char yMin, unsigned char uMin, unsigned char vMin, unsigned char yMax, unsigned char uMax, unsigned char vMax) |
void | removeColorClass (unsigned char y, unsigned char u, unsigned char v, unsigned char range) |
Public Attributes | |
unsigned char | colorClasses [8 *64 *64] |
unsigned char | colorClassesUnpacked [16 *64 *64] |
Definition at line 27 of file ColorTable32K.h.
ColorTable32K::ColorTable32K | ( | ) |
ColorTable32K::~ColorTable32K | ( | ) |
Destructor
Definition at line 188 of file ColorTable32K.cpp.
void ColorTable32K::addColorClass | ( | colorClass | colorClass, | |
unsigned char | y, | |||
unsigned char | u, | |||
unsigned char | v, | |||
unsigned char | range | |||
) |
Sets the color class for a cube with the size "range" around a pixel given by y,u,v to the given color class.
Definition at line 217 of file ColorTable32K.cpp.
void ColorTable32K::addColorClass | ( | colorClass | colorClass, | |
unsigned char | y, | |||
unsigned char | u, | |||
unsigned char | v | |||
) |
Sets the color class for a pixel in the color space given by y, u, v to the given color class.
Definition at line 202 of file ColorTable32K.cpp.
void ColorTable32K::addCuboidToColorClass | ( | colorClass | colorClass, | |
unsigned char | yMin, | |||
unsigned char | uMin, | |||
unsigned char | vMin, | |||
unsigned char | yMax, | |||
unsigned char | uMax, | |||
unsigned char | vMax | |||
) |
Sets the color class for all sub cubes within the specified cuboid to the given color class.
Definition at line 257 of file ColorTable32K.cpp.
void ColorTable32K::clear | ( | ) |
Resets the color table to noColor
Definition at line 340 of file ColorTable32K.cpp.
References colorClasses, and noColor.
Referenced by ColorTable32K().
void ColorTable32K::clearChannel | ( | colorClass | colorClass | ) |
Sets all cubes that have the given color class to noColor
Definition at line 326 of file ColorTable32K.cpp.
void ColorTable32K::generateColorClassImage | ( | const Image & | image, | |
ColorClassImage & | colorClassImage, | |||
colorClass | colorClass | |||
) | const [virtual] |
Generates an image that contains all pixels that have the specified color class.
image | A reference to the image to be segmented | |
colorClassImage | A reference to the color class image to be created | |
colorClass | The color class. |
Definition at line 48 of file ColorTable32K.cpp.
References getColorClassFast(), ColorClassImage::height, ColorClassImage::image, image, noColor, and ColorClassImage::width.
void ColorTable32K::generateColorClassImage | ( | const Image & | image, | |
ColorClassImage & | colorClassImage | |||
) | const [virtual] |
Segments an image to a color class image.
This doesn't need to be 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 34 of file ColorTable32K.cpp.
References getColorClassFast(), ColorClassImage::height, ColorClassImage::image, image, and ColorClassImage::width.
void ColorTable32K::generateHighResColorClassImage | ( | const Image & | image, | |
ColorClassImage & | colorClassImage, | |||
colorClass | colorClass | |||
) | const [virtual] |
Generates an image that contains all pixels that have the specified color class.
image | A reference to the image to be segmented | |
colorClassImage | A reference to the color class image to be created | |
colorClass | The color class. |
Definition at line 87 of file ColorTable32K.cpp.
References getColorClassFast(), ColorClassImage::height, ColorClassImage::image, image, noColor, and ColorClassImage::width.
void ColorTable32K::generateHighResColorClassImage | ( | 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 70 of file ColorTable32K.cpp.
References getColorClassFast(), ColorClassImage::height, ColorClassImage::image, image, and ColorClassImage::width.
void ColorTable32K::getBoxAroundColorClass | ( | colorClass | color, | |
Vector3< int > & | pNear, | |||
Vector3< int > & | pFar | |||
) |
Computes an axis aligned box around all positions of a specified color in YUV space
color | The color | |
pNear | The corner of the box nearest to the origin | |
pFar | The corner of the box farthest to the origin |
Definition at line 112 of file ColorTable32K.cpp.
References colorClassesUnpacked, Vector3< V >::x, Vector3< V >::y, and Vector3< V >::z.
colorClass ColorTable32K::getColorClass | ( | const unsigned char | y, | |
const unsigned char | u, | |||
const unsigned char | v | |||
) | const [virtual] |
Calculates 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 27 of file ColorTable32K.cpp.
References getColorClassFast().
colorClass ColorTable32K::getColorClassFast | ( | const unsigned char | y, | |
const unsigned char | u, | |||
const unsigned char | v | |||
) | const [inline] |
Calculates the color class of a pixel, it's fast because is non-virtual and inline, obviously can't be used through the common ColorTable interface
y | the y value of the pixel | |
u | the u value of the pixel | |
v | the v value of the pixel |
Definition at line 44 of file ColorTable32K.h.
References colorClasses.
Referenced by generateColorClassImage(), generateHighResColorClassImage(), and getColorClass().
void ColorTable32K::removeColorClass | ( | unsigned char | y, | |
unsigned char | u, | |||
unsigned char | v, | |||
unsigned char | range | |||
) |
Sets the color class for a cube with the size "range" around a pixel given by y,u,v to noColor.
Definition at line 290 of file ColorTable32K.cpp.
void ColorTable32K::unpack | ( | unsigned char * | unpackedCube, | |
const unsigned char * | packedCube | |||
) |
Unpacks the color table into a 64K array, used for performance testing (higher cache hit rate Vs less instructions per pixel)
unpackedCube | Pointer to the unpacked buffer | |
packedCube | Pointer to the packed buffer |
Definition at line 11 of file ColorTable32K.cpp.
Referenced by operator>>().
unsigned char ColorTable32K::colorClasses[8 *64 *64] |
The color table (array of 32K elements). Each element in the array contains 2 points in the color space having same U,V and adjacent Y. Quantization is 16x4x4 (YUV)
Definition at line 138 of file ColorTable32K.h.
Referenced by clear(), getColorClassFast(), operator<<(), and operator>>().
unsigned char ColorTable32K::colorClassesUnpacked[16 *64 *64] |
The unpacked color table (array of 64K elements), used for performance testing
Definition at line 143 of file ColorTable32K.h.
Referenced by getBoxAroundColorClass(), and operator>>().