Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

ditranst.h

00001 /*
00002  *
00003  *  Copyright (C) 1996-2003, OFFIS
00004  *
00005  *  This software and supporting documentation were developed by
00006  *
00007  *    Kuratorium OFFIS e.V.
00008  *    Healthcare Information and Communication Systems
00009  *    Escherweg 2
00010  *    D-26121 Oldenburg, Germany
00011  *
00012  *  THIS SOFTWARE IS MADE AVAILABLE,  AS IS,  AND OFFIS MAKES NO  WARRANTY
00013  *  REGARDING  THE  SOFTWARE,  ITS  PERFORMANCE,  ITS  MERCHANTABILITY  OR
00014  *  FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES  OR
00015  *  ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
00016  *  PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
00017  *
00018  *  Module:  dcmimgle
00019  *
00020  *  Author:  Joerg Riesmeier
00021  *
00022  *  Purpose: DicomTransTemplate (Header)
00023  *
00024  *  Last Update:      $Author: joergr $
00025  *  Update Date:      $Date: 2003/12/23 15:53:22 $
00026  *  CVS/RCS Revision: $Revision: 1.13 $
00027  *  Status:           $State: Exp $
00028  *
00029  *  CVS/RCS Log at end of file
00030  *
00031  */
00032 
00033 
00034 #ifndef DITRANST_H
00035 #define DITRANST_H
00036 
00037 #include "osconfig.h"
00038 #include "dctypes.h"
00039 #include "ofcast.h"
00040 
00041 #include "diutils.h"
00042 #include "ofbmanip.h"
00043 
00044 
00045 /*---------------------*
00046  *  class declaration  *
00047  *---------------------*/
00048 
00052 template<class T>
00053 class DiTransTemplate
00054 {
00055 
00056  protected:
00057 
00068     DiTransTemplate(const int planes,
00069                     const Uint16 src_x,
00070                     const Uint16 src_y,
00071                     const Uint16 dest_x,
00072                     const Uint16 dest_y,
00073                     const Uint32 frames,
00074                     const int bits = 0)
00075       : Planes(planes),
00076         Src_X(src_x),
00077         Src_Y(src_y),
00078         Dest_X(dest_x),
00079         Dest_Y(dest_y),
00080         Frames(frames),
00081         Bits(((bits < 1) || (bits > OFstatic_cast(int, bitsof(T)))) ? OFstatic_cast(int, bitsof(T)) : bits)
00082     {
00083     }
00084 
00087     virtual ~DiTransTemplate()
00088     {
00089     }
00090 
00096     inline void copyPixel(const T *src[],
00097                           T *dest[])
00098     {
00099         const unsigned long count = OFstatic_cast(unsigned long, Dest_X) * OFstatic_cast(unsigned long, Dest_Y) * Frames;
00100         for (int j = 0; j < Planes; ++j)
00101             OFBitmanipTemplate<T>::copyMem(src[j], dest[j], count);
00102     }
00103 
00109     inline void fillPixel(T *dest[],
00110                           const T value)
00111     {
00112         const unsigned long count = OFstatic_cast(unsigned long, Dest_X) * OFstatic_cast(unsigned long, Dest_Y) * Frames;
00113         for (int j = 0; j < Planes; ++j)
00114             OFBitmanipTemplate<T>::setMem(dest[j], value, count);
00115     }
00116 
00117 
00119     /*const*/ int Planes;                       // allow later changing to avoid warnings on Irix
00120 
00122     /*const*/ Uint16 Src_X;                     // add 'const' when interpolated scaling with clipping is fully implemented
00124     /*const*/ Uint16 Src_Y;                     // ... dito ...
00126     const Uint16 Dest_X;
00128     const Uint16 Dest_Y;
00129 
00131     const Uint32 Frames;
00133     const int Bits;
00134 };
00135 
00136 
00137 #endif
00138 
00139 
00140 /*
00141  *
00142  * CVS/RCS Log:
00143  * $Log: ditranst.h,v $
00144  * Revision 1.13  2003/12/23 15:53:22  joergr
00145  * Replaced post-increment/decrement operators by pre-increment/decrement
00146  * operators where appropriate (e.g. 'i++' by '++i').
00147  *
00148  * Revision 1.12  2003/12/08 18:51:26  joergr
00149  * Adapted type casts to new-style typecast operators defined in ofcast.h.
00150  * Removed leading underscore characters from preprocessor symbols (reserved
00151  * symbols). Updated copyright header.
00152  *
00153  * Revision 1.11  2003/06/02 17:08:07  joergr
00154  * Added include statement for "diutils.h".
00155  *
00156  * Revision 1.10  2001/06/01 15:49:52  meichel
00157  * Updated copyright header
00158  *
00159  * Revision 1.9  2000/03/08 16:24:25  meichel
00160  * Updated copyright header.
00161  *
00162  * Revision 1.8  2000/03/02 12:51:37  joergr
00163  * Rewrote variable initialization in class contructors to avoid warnings
00164  * reported on Irix.
00165  *
00166  * Revision 1.7  1999/09/17 13:08:12  joergr
00167  * Added/changed/completed DOC++ style comments in the header files.
00168  *
00169  * Revision 1.6  1999/08/25 16:41:56  joergr
00170  * Added new feature: Allow clipping region to be outside the image
00171  * (overlapping).
00172  *
00173  * Revision 1.5  1999/05/03 11:09:32  joergr
00174  * Minor code purifications to keep Sun CC 2.0.1 quiet.
00175  *
00176  * Revision 1.4  1999/03/24 17:20:27  joergr
00177  * Added/Modified comments and formatting.
00178  *
00179  * Revision 1.3  1999/02/11 16:42:52  joergr
00180  * Corrected some typos and formatting.
00181  *
00182  * Revision 1.2  1998/12/22 14:42:23  joergr
00183  * Removed const declaration (as long as interpolated scaling isn't completed).
00184  *
00185  * Revision 1.1  1998/11/27 15:48:10  joergr
00186  * Added copyright message.
00187  * Added support for new bit manipulation class.
00188  *
00189  * Revision 1.2  1998/05/11 14:53:30  joergr
00190  * Added CVS/RCS header to each file.
00191  *
00192  *
00193  */


Generated on 26 Apr 2005 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.4.2