OFFIS DCMTK  Version 3.6.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
DiScaleTemplate< T > Class Template Reference

Template class to scale images (on pixel data level). More...

Inheritance diagram for DiScaleTemplate< T >:
[legend]
Collaboration diagram for DiScaleTemplate< T >:
[legend]

Public Member Functions

 DiScaleTemplate (const int planes, const Uint16 columns, const Uint16 rows, const signed long left_pos, const signed long top_pos, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames, const int bits=0)
 constructor, scale clipping area.
 
 DiScaleTemplate (const int planes, const Uint16 src_cols, const Uint16 src_rows, const Uint16 dest_cols, const Uint16 dest_rows, const Uint32 frames, const int bits=0)
 constructor, scale whole image.
 
virtual ~DiScaleTemplate ()
 destructor
 
int isSigned () const
 check whether template type T is signed or not
 
void scaleData (const T *src[], T *dest[], const int interpolate, const T value=0)
 choose scaling/clipping algorithm depending on specified parameters.
 

Protected Attributes

const signed long Left
 left coordinate of clipping area
 
const signed long Top
 top coordinate of clipping area
 
const Uint16 Columns
 width of source image
 
const Uint16 Rows
 height of source image
 
- Protected Attributes inherited from DiTransTemplate< T >
int Planes
 number of planes
 
Uint16 Src_X
 width of source image
 
Uint16 Src_Y
 height of source image
 
const Uint16 Dest_X
 width of destination image
 
const Uint16 Dest_Y
 height of destination image
 
const Uint32 Frames
 number of frames
 
const int Bits
 number of bits per plane/pixel
 

Private Member Functions

void clipPixel (const T *src[], T *dest[])
 clip image to specified area (only inside image boundaries).
 
void clipBorderPixel (const T *src[], T *dest[], const T value)
 clip image to specified area and add a border if necessary
 
void replicatePixel (const T *src[], T *dest[])
 enlarge image by an integer factor.
 
void suppressPixel (const T *src[], T *dest[])
 shrink image by an integer divisor.
 
void scalePixel (const T *src[], T *dest[])
 free scaling method without interpolation.
 
void interpolatePixel (const T *src[], T *dest[])
 free scaling method with interpolation
 
void expandPixel (const T *src[], T *dest[])
 free scaling method with interpolation (only for magnification)
 
void reducePixel (const T *src[], T *dest[])
 free scaling method with interpolation (only for reduction)
 
void bilinearPixel (const T *src[], T *dest[])
 bilinear interpolation method (only for magnification)
 
void bicubicPixel (const T *src[], T *dest[])
 bicubic interpolation method (only for magnification)
 

Additional Inherited Members

- Protected Member Functions inherited from DiTransTemplate< T >
 DiTransTemplate (const int planes, const Uint16 src_x, const Uint16 src_y, const Uint16 dest_x, const Uint16 dest_y, const Uint32 frames, const int bits=0)
 constructor
 
virtual ~DiTransTemplate ()
 destructor
 
void copyPixel (const T *src[], T *dest[])
 copy pixel data
 
void fillPixel (T *dest[], const T value)
 fill pixel data with specified value
 
void clearPixel (T *dest[])
 clear pixel data (set values to 0)
 

Detailed Description

template<class T>
class DiScaleTemplate< T >

Template class to scale images (on pixel data level).

with and without interpolation

Definition at line 106 of file discalet.h.

Constructor & Destructor Documentation

template<class T >
DiScaleTemplate< T >::DiScaleTemplate ( const int  planes,
const Uint16  columns,
const Uint16  rows,
const signed long  left_pos,
const signed long  top_pos,
const Uint16  src_cols,
const Uint16  src_rows,
const Uint16  dest_cols,
const Uint16  dest_rows,
const Uint32  frames,
const int  bits = 0 
)
inline

constructor, scale clipping area.

Parameters
planesnumber of planes (1 or 3)
columnswidth of source image
rowsheight of source image
left_posleft coordinate of clipping area
top_postop coordinate of clipping area
src_colswidth of clipping area
src_rowsheight of clipping area
dest_colswidth of destination image (scaled image)
dest_rowsheight of destination image
framesnumber of frames
bitsnumber of bits per plane/pixel

Definition at line 126 of file discalet.h.

template<class T >
DiScaleTemplate< T >::DiScaleTemplate ( const int  planes,
const Uint16  src_cols,
const Uint16  src_rows,
const Uint16  dest_cols,
const Uint16  dest_rows,
const Uint32  frames,
const int  bits = 0 
)
inline

constructor, scale whole image.

Parameters
planesnumber of planes (1 or 3)
src_colswidth of source image
src_rowsheight of source image
dest_colswidth of destination image (scaled image)
dest_rowsheight of destination image
framesnumber of frames
bitsnumber of bits per plane/pixel

Definition at line 155 of file discalet.h.

Member Function Documentation

template<class T >
void DiScaleTemplate< T >::bicubicPixel ( const T *  src[],
T *  dest[] 
)
inlineprivate
template<class T >
void DiScaleTemplate< T >::bilinearPixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

bilinear interpolation method (only for magnification)

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 884 of file discalet.h.

References DiTransTemplate< T >::clearPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::clipBorderPixel ( const T *  src[],
T *  dest[],
const T  value 
)
inlineprivate

clip image to specified area and add a border if necessary

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels
valuevalue to be set outside the image boundaries

Definition at line 297 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::clipPixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

clip image to specified area (only inside image boundaries).

This is an optimization of the more general method clipBorderPixel().

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 264 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::expandPixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

free scaling method with interpolation (only for magnification)

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 697 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::interpolatePixel ( const T *  src[],
T *  dest[] 
)
inlineprivate
template<class T >
int DiScaleTemplate< T >::isSigned ( ) const
inline

check whether template type T is signed or not

Returns
true if signed, false otherwise

Definition at line 180 of file discalet.h.

References DiPixelRepresentationTemplate< T >::isSigned().

Referenced by DiScaleTemplate< T >::bicubicPixel(), and DiScaleTemplate< T >::interpolatePixel().

template<class T >
void DiScaleTemplate< T >::reducePixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

free scaling method with interpolation (only for reduction)

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 795 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::replicatePixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

enlarge image by an integer factor.

Pixels are replicated independently in both directions.

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 373 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::scaleData ( const T *  src[],
T *  dest[],
const int  interpolate,
const T  value = 0 
)
inline

choose scaling/clipping algorithm depending on specified parameters.

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels
interpolatepreferred interpolation algorithm (0 = no interpolation, 1 = pbmplus algorithm, 2 = c't algorithm, 3 = bilinear magnification, 4 = bicubic magnification)
valuevalue to be set outside the image boundaries (used for clipping, default: 0)

Definition at line 194 of file discalet.h.

References DiScaleTemplate< T >::bicubicPixel(), DiScaleTemplate< T >::bilinearPixel(), DiTransTemplate< T >::Bits, DiScaleTemplate< T >::clipBorderPixel(), DiScaleTemplate< T >::clipPixel(), DiScaleTemplate< T >::Columns, DiTransTemplate< T >::copyPixel(), DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiScaleTemplate< T >::expandPixel(), DiTransTemplate< T >::fillPixel(), DiScaleTemplate< T >::interpolatePixel(), DiScaleTemplate< T >::Left, DiScaleTemplate< T >::reducePixel(), DiScaleTemplate< T >::replicatePixel(), DiScaleTemplate< T >::Rows, DiScaleTemplate< T >::scalePixel(), DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, DiScaleTemplate< T >::suppressPixel(), and DiScaleTemplate< T >::Top.

Referenced by DiColorScaleTemplate< T >::scale(), and DiMonoScaleTemplate< T >::scale().

template<class T >
void DiScaleTemplate< T >::scalePixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

free scaling method without interpolation.

This algorithm is necessary for overlays (1 bpp).

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 456 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, OFBitmanipTemplate< T >::setMem(), DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().

template<class T >
void DiScaleTemplate< T >::suppressPixel ( const T *  src[],
T *  dest[] 
)
inlineprivate

shrink image by an integer divisor.

Pixels are suppressed independently in both directions.

Parameters
srcarray of pointers to source image pixels
destarray of pointers to destination image pixels

Definition at line 419 of file discalet.h.

References DiScaleTemplate< T >::Columns, DiTransTemplate< T >::Dest_X, DiTransTemplate< T >::Dest_Y, DiTransTemplate< T >::Frames, DiScaleTemplate< T >::Left, DiTransTemplate< T >::Planes, DiScaleTemplate< T >::Rows, DiTransTemplate< T >::Src_X, DiTransTemplate< T >::Src_Y, and DiScaleTemplate< T >::Top.

Referenced by DiScaleTemplate< T >::scaleData().


The documentation for this class was generated from the following file:


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2