Public Member Functions | |
DcmQuantColorHashTable () | |
constructor | |
~DcmQuantColorHashTable () | |
destructor | |
void | add (const DcmQuantPixel &colorP, int value) |
adds a new color to the hash table. | |
int | lookup (const DcmQuantPixel &colorP) const |
looks up the given color in the hash table. | |
unsigned long | addToHashTable (DicomImage &image, unsigned long newmaxval, unsigned long maxcolors) |
adds all pixels of all frames of the given image (which must be a color image) to the hash table. | |
unsigned long | countEntries () const |
counts the number of entries in the hash table | |
unsigned long | createHistogram (DcmQuantHistogramItemPointer *&array) |
converts the contents of this hash table into a histogram array. | |
Private Member Functions | |
DcmQuantColorHashTable (const DcmQuantColorHashTable &src) | |
private undefined copy constructor | |
DcmQuantColorHashTable & | operator= (const DcmQuantColorHashTable &src) |
private undefined copy assignment operator | |
Private Attributes | |
DcmQuantHistogramItemListPointer * | table |
hash array of lists for color/value pairs |
Each entry of the hash table consists of an RGB color (DcmQuantPixel object) and an integer value (e. g. counter). This class is used during the quantization of a color image.
Definition at line 51 of file diqthash.h.
|
adds a new color to the hash table. The color must not yet be present (the caller is responsible for checking this).
Definition at line 65 of file diqthash.h. References DcmQuantPixel::hash(), DcmQuantHistogramItemList::push_front(), and table. Referenced by DcmQuantColorMapping< T1, T2 >::create(). |
|
adds all pixels of all frames of the given image (which must be a color image) to the hash table. The counter (integer value associated to each color) counts the occurence of the color in the image. If more than maxcolors colors are found, the function returns zero.
|
|
counts the number of entries in the hash table
|
|
converts the contents of this hash table into a histogram array. After a successful call to addToHashTable(), this object contains an image histogram stored in a hash table. This method creates a new array of DcmQuantHistogramItem pointers on the heap and moves the contents of the hash table into this array.
|
|
looks up the given color in the hash table. If found, the value associated to the color is returned, -1 otherwise.
Definition at line 75 of file diqthash.h. References DcmQuantPixel::hash(), DcmQuantHistogramItemList::lookup(), and table. Referenced by DcmQuantColorMapping< T1, T2 >::create(). |