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