DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
DcmQuantColorMapping< T1, T2 > Class Template Reference

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.

## Detailed Description

template<class T1, class T2>
class DcmQuantColorMapping< T1, T2 >

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.

## Member Function Documentation

## ◆ create()

template<class T1, class T2>

static void DcmQuantColorMapping< T1, T2 >::create | ( | DicomImage & | sourceImage,
|  | unsigned long | frameNumber,
|  | unsigned long | maxval,
|  | DcmQuantColorHashTable & | cht,
|  | DcmQuantColorTable & | colormap,
|  | T1 & | fs,
|  | T2 * | tp )
| inline static

converts a single frame of a color image into a palette color image.

Parameters

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

The documentation for this class was generated from the following file:

- dcmimage/include/dcmtk/dcmimage/diqtcmap.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2