33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/dcmimage/dicopxt.h"
36 #include "dcmtk/dcmimgle/diluptab.h"
37 #include "dcmtk/dcmimgle/diinpx.h"
45 template<
class T1,
class T2,
class T3>
65 const unsigned long planeSize,
69 if ((pixel != NULL) && (this->
Count > 0) && (status == EIS_Normal))
91 const unsigned long planeSize,
94 if (this->
Init(pixel))
132 register unsigned long l;
133 register unsigned long i = 0;
134 register const T1 *a = pixel;
136 rgb[0] = a + planeSize;
137 rgb[1] = rgb[0] + planeSize;
138 rgb[2] = rgb[1] + planeSize;
142 for (l = planeSize; (l != 0) && (i < count); --l, ++i)
144 value = OFstatic_cast(T2, *(a++));
147 for (
int j = 0; j < 3; ++j)
149 if (value <= palette[j]->getFirstEntry(value))
150 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue());
151 else if (value >= palette[j]->getLastEntry(value))
152 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue());
154 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value));
160 for (
int j = 0; j < 3; ++j)
161 this->
Data[j][i] = OFstatic_cast(T3, removeSign(*(rgb[j]++), offset));
166 for (
int j = 0; j < 3; ++j)
167 rgb[j] += 2 * planeSize;
170 register unsigned long i;
171 register const T1 *p = pixel;
172 for (i = 0; i < count; ++i)
174 value = OFstatic_cast(T2, *(p++));
177 for (
int j = 0; j < 3; ++j)
179 if (value <= palette[j]->getFirstEntry(value))
180 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getFirstValue());
181 else if (value >= palette[j]->getLastEntry(value))
182 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getLastValue());
184 this->
Data[j][i] = OFstatic_cast(T3, palette[j]->getValue(value));
190 for (
int j = 0; j < 3; ++j)
191 this->
Data[j][i] = OFstatic_cast(T3, removeSign(*(p++), offset));