33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/dcmimage/dicopxt.h"
36 #include "dcmtk/dcmimgle/diluptab.h"
37 #include "dcmtk/dcmimgle/diinpx.h"
46 template<
class T1,
class T2,
class T3>
66 if ((pixel != NULL) && (this->
Count > 0) && (status == EIS_Normal))
70 status = EIS_InvalidValue;
71 DCMIMAGE_ERROR(
"invalid value for 'PlanarConfiguration' (" << this->
PlanarConfiguration <<
")");
95 if (this->
Init(pixel))
97 register const T1 *p = pixel;
98 register T2 value = 0;
99 register unsigned long i;
104 for (i = 0; i < count; ++i)
106 value = OFstatic_cast(T2, *(p++));
107 for (j = 0; j < 3; ++j)
109 if (value <= palette[j]->getFirstEntry(value))
110 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue());
111 else if (value >= palette[j]->getLastEntry(value))
112 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue());
114 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value));
Template class to handle Palette color pixel data.
Interface class to DICOM data management (dcmdata).
virtual ~DiPalettePixelTemplate()
destructor
T3 * Data[3]
pointer to pixel data (3 components)
int PlanarConfiguration
planar configuration of the original pixel data (0 = color-by-pixel, 1 = color-by-plane) ...
Template class to handle color pixel data.
Class to handle color palette look-up tables.
void convert(const T1 *pixel, DiLookupTable *palette[3])
convert input pixel data to intermediate representation
DiPalettePixelTemplate(const DiDocument *docu, const DiInputPixel *pixel, DiLookupTable *palette[3], EI_Status &status)
constructor
unsigned long InputCount
number of pixels in the input buffer
int Init(const void *pixel)
initialize internal memory
unsigned long Count
number of pixels