Public Member Functions | |
DcmQuantColorTable () | |
constructor | |
~DcmQuantColorTable () | |
destructor | |
void | clear () |
resets the object to default-constructed state | |
unsigned long | getColors () const |
returns the number of colors in the color table | |
void | setDescriptionString (OFString &str) const |
creates a description string suitable for use as Derivation Description. | |
OFCondition | computeHistogram (DicomImage &image, unsigned long maxcolors) |
creates a color table containing a histogram of the given image. | |
unsigned long | getMaxVal () const |
after a call to computeHistogram(), this method returns the maximum pixel value to which all color samples were down-sampled during computation of the histogram. | |
const DcmQuantPixel & | getPixel (unsigned long idx) const |
returns the color at index idx. | |
DcmQuantComponent | getRed (unsigned long idx) const |
returns the red color component at index idx | |
DcmQuantComponent | getGreen (unsigned long idx) const |
returns the green color component at index idx | |
DcmQuantComponent | getBlue (unsigned long idx) const |
returns the blue color component at index idx | |
OFCondition | medianCut (DcmQuantColorTable &histogram, unsigned long sum, unsigned long theMaxval, unsigned long numberOfColors, DcmLargestDimensionType largeType, DcmRepresentativeColorType repType) |
computes a color LUT for the given image histogram. | |
int | computeIndex (const DcmQuantPixel &px) const |
determines for a given color the closest match in the color LUT. | |
OFCondition | write (DcmItem &target, OFBool writeAsOW, OFBool write16BitEntries) |
writes the current color table into a DICOM object, encoded as Red/Green/Blue Palette Color Lookup Table and Data. | |
Private Member Functions | |
void | computeClusters () |
after a call to medianCut(), this method computes for each entry in the color map the minimum of the euclidean distances to any other of the entries. | |
DcmQuantColorTable (const DcmQuantColorTable &src) | |
private undefined copy constructor | |
DcmQuantColorTable & | operator= (const DcmQuantColorTable &src) |
private undefined copy assignment operator | |
Private Attributes | |
DcmQuantHistogramItemPointer * | array |
color table data | |
unsigned long | numColors |
number of entries in color table | |
unsigned long | maxval |
maximum pixel value to which all color samples were down-sampled during computation of the histogram. |
Definition at line 52 of file diqtctab.h.
|
after a call to medianCut(), this method computes for each entry in the color map the minimum of the euclidean distances to any other of the entries. Any color which has an euclidean distance of less than half of this distance is necessarily mapped to this entry. This data is used by computeIndex() |
|
creates a color table containing a histogram of the given image. Pixel sample values are downsampled if necessary to make sure the histogram fits into the given size limit.
|
|
determines for a given color the closest match in the color LUT.
Definition at line 174 of file diqtctab.h. References array, getBlue(), DcmQuantPixel::getBlue(), getGreen(), DcmQuantPixel::getGreen(), getRed(), DcmQuantPixel::getRed(), and numColors. Referenced by DcmQuantColorMapping< T1, T2 >::create(). |
|
returns the blue color component at index idx
Definition at line 139 of file diqtctab.h. References array, DcmQuantPixel::getBlue(), and numColors. Referenced by computeIndex(). |
|
returns the number of colors in the color table
Definition at line 68 of file diqtctab.h. References numColors. |
|
returns the green color component at index idx
Definition at line 127 of file diqtctab.h. References array, DcmQuantPixel::getGreen(), and numColors. Referenced by computeIndex(). |
|
returns the color at index idx.
Definition at line 103 of file diqtctab.h. References array, and numColors. Referenced by DcmQuantColorMapping< T1, T2 >::create(). |
|
returns the red color component at index idx
Definition at line 115 of file diqtctab.h. References array, DcmQuantPixel::getRed(), and numColors. Referenced by computeIndex(). |
|
computes a color LUT for the given image histogram. This median-cut colormap generator is based on Paul Heckbert's paper "Color Image Quantization for Frame Buffer Display", SIGGRAPH '82 Proceedings, page 297.
|
|
creates a description string suitable for use as Derivation Description.
|
|
writes the current color table into a DICOM object, encoded as Red/Green/Blue Palette Color Lookup Table and Data.
|