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-10-14 13:16:27 $ 00022 * CVS/RCS Revision: $Revision: 1.16 $ 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 virtual ~DiPixelRepresentationTemplate() {} 00059 00064 inline int isSigned() const; 00065 00066 protected: 00067 00072 virtual inline EP_Representation getRepresentation() const; 00073 }; 00074 00075 00076 /********************************************************************/ 00077 00078 00079 EXPLICIT_SPECIALIZATION 00080 inline EP_Representation DiPixelRepresentationTemplate<Uint8>::getRepresentation() const 00081 { 00082 return EPR_Uint8; 00083 } 00084 00085 00086 EXPLICIT_SPECIALIZATION 00087 inline EP_Representation DiPixelRepresentationTemplate<Sint8>::getRepresentation() const 00088 { 00089 return EPR_Sint8; 00090 } 00091 00092 00093 EXPLICIT_SPECIALIZATION 00094 inline EP_Representation DiPixelRepresentationTemplate<Uint16>::getRepresentation() const 00095 { 00096 return EPR_Uint16; 00097 } 00098 00099 00100 EXPLICIT_SPECIALIZATION 00101 inline EP_Representation DiPixelRepresentationTemplate<Sint16>::getRepresentation() const 00102 { 00103 return EPR_Sint16; 00104 } 00105 00106 00107 EXPLICIT_SPECIALIZATION 00108 inline EP_Representation DiPixelRepresentationTemplate<Uint32>::getRepresentation() const 00109 { 00110 return EPR_Uint32; 00111 } 00112 00113 00114 EXPLICIT_SPECIALIZATION 00115 inline EP_Representation DiPixelRepresentationTemplate<Sint32>::getRepresentation() const 00116 { 00117 return EPR_Sint32; 00118 } 00119 00120 00121 EXPLICIT_SPECIALIZATION 00122 inline int DiPixelRepresentationTemplate<Uint8>::isSigned() const 00123 { 00124 return 0; 00125 } 00126 00127 00128 EXPLICIT_SPECIALIZATION 00129 inline int DiPixelRepresentationTemplate<Uint16>::isSigned() const 00130 { 00131 return 0; 00132 } 00133 00134 00135 EXPLICIT_SPECIALIZATION 00136 inline int DiPixelRepresentationTemplate<Uint32>::isSigned() const 00137 { 00138 return 0; 00139 } 00140 00141 00142 EXPLICIT_SPECIALIZATION 00143 inline int DiPixelRepresentationTemplate<Sint8>::isSigned() const 00144 { 00145 return 1; 00146 } 00147 00148 00149 EXPLICIT_SPECIALIZATION 00150 inline int DiPixelRepresentationTemplate<Sint16>::isSigned() const 00151 { 00152 return 1; 00153 } 00154 00155 00156 EXPLICIT_SPECIALIZATION 00157 inline int DiPixelRepresentationTemplate<Sint32>::isSigned() const 00158 { 00159 return 1; 00160 } 00161 00162 00163 #endif 00164 00165 00166 /* 00167 * 00168 * CVS/RCS Log: 00169 * $Log: dipxrept.h,v $ 00170 * Revision 1.16 2010-10-14 13:16:27 joergr 00171 * Updated copyright header. Added reference to COPYRIGHT file. 00172 * 00173 * Revision 1.15 2005/12/09 14:48:35 meichel 00174 * Added missing virtual destructors 00175 * 00176 * Revision 1.14 2005/12/08 16:48:06 meichel 00177 * Changed include path schema for all DCMTK header files 00178 * 00179 * Revision 1.13 2003/12/08 19:26:45 joergr 00180 * Removed leading underscore characters from preprocessor symbols (reserved 00181 * symbols). Updated copyright header. 00182 * 00183 * Revision 1.12 2001/06/01 15:49:50 meichel 00184 * Updated copyright header 00185 * 00186 * Revision 1.11 2000/03/08 16:24:23 meichel 00187 * Updated copyright header. 00188 * 00189 * Revision 1.10 2000/02/02 11:02:39 joergr 00190 * Removed space characters before preprocessor directives. 00191 * 00192 * Revision 1.9 1999/09/17 12:47:52 joergr 00193 * Added/changed/completed DOC++ style comments in the header files. 00194 * 00195 * Revision 1.8 1999/04/28 17:03:17 joergr 00196 * Added test whether the compiler supports the new explicit template 00197 * specialization syntax (see below). 00198 * 00199 * Revision 1.7 1999/04/28 14:54:37 joergr 00200 * Added "template<>" to specialized template functions/methods to avoid 00201 * compiler warnings reported by gcc version egcs-2.91.66 (conforms with new 00202 * C++ standard). 00203 * 00204 * Revision 1.6 1999/03/24 17:20:23 joergr 00205 * Added/Modified comments and formatting. 00206 * 00207 * Revision 1.5 1999/02/11 16:41:39 joergr 00208 * Corrected some typos and formatting. 00209 * 00210 * Revision 1.4 1998/12/22 14:37:22 joergr 00211 * Removed methods getMinimum/Maximum(). 00212 * 00213 * Revision 1.3 1998/12/16 16:38:23 joergr 00214 * Added methods to determine absolute minimum and maximum value for given 00215 * value representation. 00216 * 00217 * Revision 1.2 1998/12/14 17:28:53 joergr 00218 * Removed old source header. 00219 * 00220 * Revision 1.1 1998/11/27 15:45:50 joergr 00221 * Added copyright message. 00222 * 00223 * Revision 1.2 1998/05/11 14:53:28 joergr 00224 * Added CVS/RCS header to each file. 00225 * 00226 * 00227 */