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


Generated on 4 Nov 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.8