DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
template class that maps a color image into a palette color image with given color palette. More...
Static Public Member Functions | |
static void | create (DicomImage &sourceImage, unsigned long frameNumber, unsigned long maxval, DcmQuantColorHashTable &cht, DcmQuantColorTable &colormap, T1 &fs, T2 *tp) |
converts a single frame of a color image into a palette color image. More... | |
template class that maps a color image into a palette color image with given color palette.
The two template parameters define the error diffusion class used to implement e.g. Floyd-Steinberg error diffusion and the output type of the color index values, which may be 8 bit or 16 bit unsigned integers.
|
inlinestatic |
converts a single frame of a color image into a palette color image.
sourceImage | color image |
frameNumber | number of frame (in sourceImage) that is converted |
maxval | maximum pixel value to which all color samples were down-sampled during computation of the histogram on which the color LUT is based. This value is required to make sure that the hash table doesn't get too large. |
cht | color hash table. This table is passed by the caller since the same hash table can be used if multiple frames are converted. Initially (i.e. when called for the first frame) the hash table is empty. |
colormap | color LUT to which the color image is mapped. |
fs | error diffusion object, e.g. an instance of class DcmQuantIdent or class DcmQuantFloydSteinberg, depending on the template instantiation. |
tp | pointer to an array to which the palette color image data is written. The array must be large enough to store sourceImage.getWidth() times sourceImage.getHeight() values of type T2. |
References DcmQuantColorHashTable::add(), DcmQuantColorTable::computeIndex(), DcmQuantScaleTable::createTable(), DicomImage::getHeight(), DicomImage::getOutputData(), DcmQuantColorTable::getPixel(), DicomImage::getWidth(), DcmQuantColorHashTable::lookup(), and DcmQuantPixel::scale().