33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/dcmimgle/dimopxt.h"
36 #include "dcmtk/dcmimage/dicopx.h"
68 if ((pixel != NULL) && (pixel->
getCount() > 0))
70 convert(OFstatic_cast(
const T **, OFconst_cast(
void *, pixel->
getData())), red, green, blue);
99 if (this->
Data != NULL)
101 register const T *r = pixel[0];
102 register const T *g = pixel[1];
103 register const T *b = pixel[2];
104 register T *q = this->
Data;
105 register unsigned long i;
106 for (i = this->
Count; i != 0; i--)
108 *(q++) = OFstatic_cast(T, OFstatic_cast(
double, *(r++)) * red +
109 OFstatic_cast(
double, *(g++)) * green +
110 OFstatic_cast(
double, *(b++)) * blue);
virtual ~DiColorMonoTemplate()
destructor
Template class to handle monochrome pixel data.
Template class to convert color image to monochrome images.
T * Data
pointer to pixel data
DiColorMonoTemplate(const DiColorPixel *pixel, DiMonoModality *modality, const double red, const double green, const double blue)
constructor
virtual const void * getData() const =0
get pointer to pixel data (abstract).
Class to handle modality specific transformations (incl.
void determineMinMax(T minvalue=0, T maxvalue=0, const int mode=0x1)
determine minimum and maximum pixel values
void convert(const T *pixel[3], const double red, const double green, const double blue)
convert color pixel data to monochrome format
Abstract base class to handle color pixel data.
unsigned long getCount() const
get number of pixels
unsigned long Count
number of pixels