dcmimgle/include/dcmtk/dcmimgle/dipxrept.h

00001 /*
00002  *
00003  *  Copyright (C) 1996-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module:  dcmimgle
00015  *
00016  *  Author:  Joerg Riesmeier
00017  *
00018  *  Purpose: DicomPixelRepresentationTemplate (Header)
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-12-06 10:07:42 $
00022  *  CVS/RCS Revision: $Revision: 1.17 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 
00030 #ifndef DIPXREPT_H
00031 #define DIPXREPT_H
00032 
00033 #include "dcmtk/config/osconfig.h"
00034 
00035 #include "dcmtk/dcmimgle/diutils.h"
00036 
00037 #ifdef HAVE_EXPLICIT_TEMPLATE_SPECIALIZATION
00038 #define EXPLICIT_SPECIALIZATION template<>
00039 #else
00040 #define EXPLICIT_SPECIALIZATION
00041 #endif
00042 
00043 
00044 /*---------------------*
00045  *  class declaration  *
00046  *---------------------*/
00047 
00051 template<class T>
00052 class DiPixelRepresentationTemplate
00053 {
00054 
00055  public:
00056 
00058     DiPixelRepresentationTemplate() {}
00059 
00061     virtual ~DiPixelRepresentationTemplate() {}
00062 
00067     inline int isSigned() const;
00068 
00069  protected:
00070 
00075     virtual inline EP_Representation getRepresentation() const;
00076 };
00077 
00078 
00079 /********************************************************************/
00080 
00081 
00082 EXPLICIT_SPECIALIZATION
00083 inline EP_Representation DiPixelRepresentationTemplate<Uint8>::getRepresentation() const
00084 {
00085     return EPR_Uint8;
00086 }
00087 
00088 
00089 EXPLICIT_SPECIALIZATION
00090 inline EP_Representation DiPixelRepresentationTemplate<Sint8>::getRepresentation() const
00091 {
00092     return EPR_Sint8;
00093 }
00094 
00095 
00096 EXPLICIT_SPECIALIZATION
00097 inline EP_Representation DiPixelRepresentationTemplate<Uint16>::getRepresentation() const
00098 {
00099     return EPR_Uint16;
00100 }
00101 
00102 
00103 EXPLICIT_SPECIALIZATION
00104 inline EP_Representation DiPixelRepresentationTemplate<Sint16>::getRepresentation() const
00105 {
00106     return EPR_Sint16;
00107 }
00108 
00109 
00110 EXPLICIT_SPECIALIZATION
00111 inline EP_Representation DiPixelRepresentationTemplate<Uint32>::getRepresentation() const
00112 {
00113     return EPR_Uint32;
00114 }
00115 
00116 
00117 EXPLICIT_SPECIALIZATION
00118 inline EP_Representation DiPixelRepresentationTemplate<Sint32>::getRepresentation() const
00119 {
00120     return EPR_Sint32;
00121 }
00122 
00123 
00124 EXPLICIT_SPECIALIZATION
00125 inline int DiPixelRepresentationTemplate<Uint8>::isSigned() const
00126 {
00127     return 0;
00128 }
00129 
00130 
00131 EXPLICIT_SPECIALIZATION
00132 inline int DiPixelRepresentationTemplate<Uint16>::isSigned() const
00133 {
00134     return 0;
00135 }
00136 
00137 
00138 EXPLICIT_SPECIALIZATION
00139 inline int DiPixelRepresentationTemplate<Uint32>::isSigned() const
00140 {
00141     return 0;
00142 }
00143 
00144 
00145 EXPLICIT_SPECIALIZATION
00146 inline int DiPixelRepresentationTemplate<Sint8>::isSigned() const
00147 {
00148     return 1;
00149 }
00150 
00151 
00152 EXPLICIT_SPECIALIZATION
00153 inline int DiPixelRepresentationTemplate<Sint16>::isSigned() const
00154 {
00155     return 1;
00156 }
00157 
00158 
00159 EXPLICIT_SPECIALIZATION
00160 inline int DiPixelRepresentationTemplate<Sint32>::isSigned() const
00161 {
00162     return 1;
00163 }
00164 
00165 
00166 #endif
00167 
00168 
00169 /*
00170  *
00171  * CVS/RCS Log:
00172  * $Log: dipxrept.h,v $
00173  * Revision 1.17  2010-12-06 10:07:42  joergr
00174  * Added explicit default constructor to keep Intel Compiler 11.1 quiet.
00175  *
00176  * Revision 1.16  2010-10-14 13:16:27  joergr
00177  * Updated copyright header. Added reference to COPYRIGHT file.
00178  *
00179  * Revision 1.15  2005/12/09 14:48:35  meichel
00180  * Added missing virtual destructors
00181  *
00182  * Revision 1.14  2005/12/08 16:48:06  meichel
00183  * Changed include path schema for all DCMTK header files
00184  *
00185  * Revision 1.13  2003/12/08 19:26:45  joergr
00186  * Removed leading underscore characters from preprocessor symbols (reserved
00187  * symbols). Updated copyright header.
00188  *
00189  * Revision 1.12  2001/06/01 15:49:50  meichel
00190  * Updated copyright header
00191  *
00192  * Revision 1.11  2000/03/08 16:24:23  meichel
00193  * Updated copyright header.
00194  *
00195  * Revision 1.10  2000/02/02 11:02:39  joergr
00196  * Removed space characters before preprocessor directives.
00197  *
00198  * Revision 1.9  1999/09/17 12:47:52  joergr
00199  * Added/changed/completed DOC++ style comments in the header files.
00200  *
00201  * Revision 1.8  1999/04/28 17:03:17  joergr
00202  * Added test whether the compiler supports the new explicit template
00203  * specialization syntax (see below).
00204  *
00205  * Revision 1.7  1999/04/28 14:54:37  joergr
00206  * Added "template<>" to specialized template functions/methods to avoid
00207  * compiler warnings reported by gcc version egcs-2.91.66 (conforms with new
00208  * C++ standard).
00209  *
00210  * Revision 1.6  1999/03/24 17:20:23  joergr
00211  * Added/Modified comments and formatting.
00212  *
00213  * Revision 1.5  1999/02/11 16:41:39  joergr
00214  * Corrected some typos and formatting.
00215  *
00216  * Revision 1.4  1998/12/22 14:37:22  joergr
00217  * Removed methods getMinimum/Maximum().
00218  *
00219  * Revision 1.3  1998/12/16 16:38:23  joergr
00220  * Added methods to determine absolute minimum and maximum value for given
00221  * value representation.
00222  *
00223  * Revision 1.2  1998/12/14 17:28:53  joergr
00224  * Removed old source header.
00225  *
00226  * Revision 1.1  1998/11/27 15:45:50  joergr
00227  * Added copyright message.
00228  *
00229  * Revision 1.2  1998/05/11 14:53:28  joergr
00230  * Added CVS/RCS header to each file.
00231  *
00232  *
00233  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1