ColorTable32K Class Reference

#include <ColorTable32K.h>

Inheritance diagram for ColorTable32K:

ColorTable List of all members.

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]

Detailed Description

Contains a ColorTable32K which can decode the color for every 16 * 4 * 4 cube in the 255 * 255 * 255 YUV color space. The 64K elements color cube is packed into a 32KBytes color table (each element is just 4bits) accessed through fast shift and masking operations

Author:
Walter Nistico

Definition at line 27 of file ColorTable32K.h.


Constructor & Destructor Documentation

ColorTable32K::ColorTable32K (  ) 

Constructor

Definition at line 192 of file ColorTable32K.cpp.

References clear().

ColorTable32K::~ColorTable32K (  ) 

Destructor

Definition at line 188 of file ColorTable32K.cpp.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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

Parameters:
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.

Parameters:
y the y value of the pixel
u the u value of the pixel
v the v value of the pixel
Returns:
the color class

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

Parameters:
y the y value of the pixel
u the u value of the pixel
v the v value of the pixel
Returns:
the color class

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)

Parameters:
unpackedCube Pointer to the unpacked buffer
packedCube Pointer to the packed buffer

Definition at line 11 of file ColorTable32K.cpp.

Referenced by operator>>().


Member Data Documentation

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>>().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:23:06 2006 for DT2005.panorama by  doxygen 1.4.7