33 #include "dcmtk/config/osconfig.h" 34 #include "dcmtk/ofstd/ofcast.h" 36 #include "dcmtk/dcmimgle/dipixel.h" 37 #include "dcmtk/dcmimgle/ditranst.h" 66 const Uint16 src_cols,
67 const Uint16 src_rows,
68 const Uint16 dest_cols,
69 const Uint16 dest_rows,
72 :
DiTransTemplate<T>(0, src_cols, src_rows, dest_cols, dest_rows, frames)
78 (pixel->
getCount() == OFstatic_cast(
unsigned long, src_cols) * OFstatic_cast(
unsigned long, src_rows) * frames))
82 else if (degree == 180)
84 else if (degree == 270)
87 DCMIMGLE_WARN(
"could not rotate image ... corrupted data");
103 const Uint16 src_cols,
104 const Uint16 src_rows,
105 const Uint16 dest_cols,
106 const Uint16 dest_rows,
108 :
DiTransTemplate<T>(planes, src_cols, src_rows, dest_cols, dest_rows, frames)
130 else if (degree == 180)
132 else if (degree == 270)
149 if ((src != NULL) && (dest != NULL))
156 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
157 for (
int j = 0; j < this->
Planes; ++j)
161 for (
unsigned long f = this->
Frames; f != 0; --f)
164 for (x = this->
Dest_X; x != 0; --x)
167 for (y = this->
Dest_Y; y != 0; --y)
186 if ((src != NULL) && (dest != NULL))
193 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
194 for (
int j = 0; j < this->
Planes; ++j)
198 for (
unsigned long f = this->
Frames; f != 0; --f)
200 for (x = this->
Dest_X; x != 0; --x)
203 for (y = this->
Dest_Y; y != 0; --y)
223 if ((src != NULL) && (dest != NULL))
225 register unsigned long i;
228 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
229 for (
int j = 0; j < this->
Planes; ++j)
233 for (
unsigned long f = this->
Frames; f != 0; --f)
236 for (i = count; i != 0; --i)
252 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
253 T *temp =
new T[count];
261 for (
int j = 0; j < this->
Planes; ++j)
264 for (
unsigned long f = this->
Frames; f != 0; --f)
269 for (x = this->
Dest_X; x != 0; --x)
272 for (y = this->
Dest_Y; y != 0; --y)
290 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
291 T *temp =
new T[count];
299 for (
int j = 0; j < this->
Planes; ++j)
302 for (
unsigned long f = this->
Frames; f != 0; --f)
306 for (x = this->
Dest_X; x != 0; --x)
309 for (y = this->
Dest_Y; y != 0; --y)
328 register unsigned long i;
333 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
334 for (
int j = 0; j < this->
Planes; ++j)
337 for (
unsigned long f = this->
Frames; f != 0; --f)
341 for (i = count / 2; i != 0; --i)
int Planes
number of planes
virtual void * getDataArrayPtr()=0
get pointer to array of pixel data (abstract).
void rotateTopDown(const T *src[], T *dest[])
rotate source image top-down and store result in destination image
Template class to rotate images (on pixel data level).
virtual ~DiRotateTemplate()
destructor
void rotateRight(const T *src[], T *dest[])
rotate source image right and store result in destination image
DiRotateTemplate(DiPixel *pixel, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames, const int degree)
constructor.
Template class building the base for other transformations.
const Uint32 Frames
number of frames
void rotateLeft(T *data[])
rotate image left and store result in the same storage area
void rotateTopDown(T *data[])
rotate image top-down and store result in the same storage area
void rotateLeft(const T *src[], T *dest[])
rotate source image left and store result in destination image
void rotateRight(T *data[])
rotate image right and store result in the same storage area
static void copyMem(const T *src, T *dest, const unsigned long count)
copies specified number of elements from source to destination.
Abstract base class to handle pixel data.
unsigned long getCount() const
get number of pixels
void rotateData(const T *src[], T *dest[], const int degree)
choose algorithm depending on rotation angle
virtual int getPlanes() const =0
get number of planes (abstract).
const Uint16 Dest_Y
height of destination image
void copyPixel(const T *src[], T *dest[])
copy pixel data
const Uint16 Dest_X
width of destination image
DiRotateTemplate(const int planes, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames)
constructor.