33 #include "dcmtk/config/osconfig.h"
35 #include "dcmtk/dcmimgle/dipixel.h"
36 #include "dcmtk/dcmimgle/ditranst.h"
75 (pixel->
getCount() == OFstatic_cast(
unsigned long, columns) * OFstatic_cast(
unsigned long, rows) * frames))
84 DCMIMGLE_WARN(
"could not flip image ... corrupted data");
123 if ((src != NULL) && (dest != NULL))
147 if ((src != NULL) && (dest != NULL))
154 for (
int j = 0; j < this->
Planes; ++j)
158 for (Uint32 f = this->
Frames; f != 0; --f)
160 for (y = this->
Src_Y; y != 0; --y)
163 for (x = this->
Src_X; x != 0; --x)
180 if ((src != NULL) && (dest != NULL))
187 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
188 for (
int j = 0; j < this->
Planes; ++j)
192 for (Uint32 f = this->
Frames; f != 0; --f)
195 for (y = this->
Src_Y; y != 0; --y)
198 for (x = this->
Src_X; x != 0; --x)
216 if ((src != NULL) && (dest != NULL))
218 register unsigned long i;
221 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
222 for (
int j = 0; j < this->
Planes; ++j)
226 for (Uint32 f = this->
Frames; f != 0; --f)
229 for (i = count; i != 0; --i)
251 for (
int j = 0; j < this->
Planes; ++j)
254 for (Uint32 f = this->
Frames; f != 0; --f)
256 for (y = this->
Src_Y; y != 0; --y)
261 for (x = this->
Src_X / 2; x != 0; --x)
285 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
286 for (
int j = 0; j < this->
Planes; ++j)
289 for (Uint32 f = this->
Frames; f != 0; --f)
294 for (y = this->
Src_Y / 2; y != 0; --y)
298 for (x = this->
Src_X; x != 0; --x)
315 register unsigned long i;
320 const unsigned long count = OFstatic_cast(
unsigned long, this->
Dest_X) * OFstatic_cast(
unsigned long, this->
Dest_Y);
321 for (
int j = 0; j < this->
Planes; ++j)
324 for (Uint32 f = this->
Frames; f != 0; --f)
328 for (i = count / 2; i != 0; --i)
int Planes
number of planes
Template class to flip images (on pixel data level).
virtual void * getDataArrayPtr()=0
get pointer to array of pixel data (abstract).
Uint16 Src_X
width of source image
void flipHorz(const T *src[], T *dest[])
flip source image horizontally and store result in destination image
Template class building the base for other transformations.
void flipHorzVert(T *data[])
flip image horizontally and vertically and store result in the same storage area
const Uint32 Frames
number of frames
virtual ~DiFlipTemplate()
destructor
void flipData(const T *src[], T *dest[], const int horz, const int vert)
choose algorithm depending on flipping mode
void flipHorz(T *data[])
flip image horizontally and store result in the same storage area
DiFlipTemplate(DiPixel *pixel, const Uint16 columns, const Uint16 rows, const Uint32 frames, const int horz, const int vert)
constructor.
void flipHorzVert(const T *src[], T *dest[])
flip source image horizontally and vertically and store result in destination image ...
Uint16 Src_Y
height of source image
Abstract base class to handle pixel data.
unsigned long getCount() const
get number of pixels
DiFlipTemplate(const int planes, const Uint16 columns, const Uint16 rows, const Uint32 frames)
constructor.
virtual int getPlanes() const =0
get number of planes (abstract).
void flipVert(T *data[])
flip image vertically and store result in the same storage area
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
void flipVert(const T *src[], T *dest[])
flip source image vertically and store result in destination image