00001 /* 00002 * 00003 * Copyright (C) 1994-2004, 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: dcmdata 00019 * 00020 * Author: Gerd Ehlers 00021 * 00022 * Purpose: Handling of transfer syntaxes 00023 * 00024 * Last Update: $Author: joergr $ 00025 * Update Date: $Date: 2004/04/06 18:01:50 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcxfer.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.16 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DCXFER_H 00035 #define DCXFER_H 00036 00037 #include "osconfig.h" /* make sure OS specific configuration is included first */ 00038 00039 #include "dctypes.h" 00040 #include "dcvr.h" 00041 00042 /* 00043 ** Enumerated Types 00044 */ 00045 00046 typedef enum { 00047 EXS_Unknown = -1, 00048 EXS_LittleEndianImplicit = 0, 00049 EXS_BigEndianImplicit = 1, 00050 EXS_LittleEndianExplicit = 2, 00051 EXS_BigEndianExplicit = 3, 00052 EXS_JPEGProcess1TransferSyntax = 4, 00053 EXS_JPEGProcess2_4TransferSyntax = 5, 00054 EXS_JPEGProcess3_5TransferSyntax = 6, 00055 EXS_JPEGProcess6_8TransferSyntax = 7, 00056 EXS_JPEGProcess7_9TransferSyntax = 8, 00057 EXS_JPEGProcess10_12TransferSyntax = 9, 00058 EXS_JPEGProcess11_13TransferSyntax = 10, 00059 EXS_JPEGProcess14TransferSyntax = 11, 00060 EXS_JPEGProcess15TransferSyntax = 12, 00061 EXS_JPEGProcess16_18TransferSyntax = 13, 00062 EXS_JPEGProcess17_19TransferSyntax = 14, 00063 EXS_JPEGProcess20_22TransferSyntax = 15, 00064 EXS_JPEGProcess21_23TransferSyntax = 16, 00065 EXS_JPEGProcess24_26TransferSyntax = 17, 00066 EXS_JPEGProcess25_27TransferSyntax = 18, 00067 EXS_JPEGProcess28TransferSyntax = 19, 00068 EXS_JPEGProcess29TransferSyntax = 20, 00069 EXS_JPEGProcess14SV1TransferSyntax = 21, 00070 EXS_RLELossless = 22, 00071 EXS_JPEGLSLossless = 23, 00072 EXS_JPEGLSLossy = 24, 00073 EXS_DeflatedLittleEndianExplicit = 25, 00074 EXS_JPEG2000LosslessOnly = 26, 00075 EXS_JPEG2000 = 27, 00076 EXS_MPEG2MainProfileAtMainLevel = 28 00077 } E_TransferSyntax; 00078 00079 00080 typedef enum { 00081 EBO_unknown = 0, 00082 EBO_LittleEndian = 1, 00083 EBO_BigEndian = 2 00084 } E_ByteOrder; 00085 00086 00087 typedef enum { 00088 EVT_Implicit = 0, 00089 EVT_Explicit = 1 00090 } E_VRType; 00091 00092 00093 typedef enum { 00094 EJE_NotEncapsulated = 0, 00095 EJE_Encapsulated = 1 00096 } E_JPEGEncapsulated; 00097 00098 typedef enum 00099 { 00101 ESC_none = 0 00103 , ESC_unsupported = 1 00104 #ifdef WITH_ZLIB 00105 00106 , ESC_zlib = 2 00107 #endif 00108 } E_StreamCompression; 00109 00110 /* 00111 ** Class DcmXfer for lookup up Transfer Syntax properties and readable descriptions 00112 */ 00113 00114 class DcmXfer { 00115 const char *xferID; 00116 const char *xferName; 00117 E_TransferSyntax xferSyn; 00118 E_ByteOrder byteOrder; 00119 E_VRType vrType; 00120 E_JPEGEncapsulated encapsulated; 00121 Uint32 JPEGProcess8; 00122 Uint32 JPEGProcess12; 00123 E_StreamCompression streamCompression; 00124 00125 public: 00126 DcmXfer( E_TransferSyntax xfer ); 00127 DcmXfer( const char *xferName_xferID ); 00128 DcmXfer( const DcmXfer &newXfer ); 00129 ~DcmXfer(); 00130 00131 DcmXfer & operator = ( const E_TransferSyntax xfer ); 00132 DcmXfer & operator = ( const DcmXfer &newtag ); 00133 00134 inline E_TransferSyntax getXfer() const { return xferSyn; } 00135 inline E_ByteOrder getByteOrder() const { return byteOrder; } 00136 inline const char* getXferName() const { return xferName; } 00137 inline const char* getXferID() const { return xferID; } 00138 inline OFBool isLittleEndian() const 00139 { 00140 return byteOrder == EBO_LittleEndian; 00141 } 00142 inline OFBool isBigEndian() const { return byteOrder == EBO_BigEndian; } 00143 inline OFBool isImplicitVR() const { return vrType == EVT_Implicit; } 00144 inline OFBool isExplicitVR() const { return vrType == EVT_Explicit; } 00145 inline OFBool isEncapsulated() const 00146 { 00147 return encapsulated == EJE_Encapsulated; 00148 } 00149 inline OFBool isNotEncapsulated() const 00150 { 00151 return encapsulated == EJE_NotEncapsulated; 00152 } 00153 inline Uint32 getJPEGProcess8Bit() const { return JPEGProcess8; } 00154 inline Uint32 getJPEGProcess12Bit() const { return JPEGProcess12;} 00155 inline E_StreamCompression getStreamCompression() const { return streamCompression;} 00156 00157 /* return the number of bytes needed to describe the tag, length, VR 00158 ** and any reserved fields for this transfer syntax when encoding the 00159 ** specified VR. 00160 */ 00161 Uint32 sizeofTagHeader(DcmEVR evr); 00162 00163 }; 00164 00165 00166 extern const E_ByteOrder gLocalByteOrder; 00167 00168 #endif // DCXFER_H 00169 00170 /* 00171 * CVS/RCS Log: 00172 * $Log: dcxfer.h,v $ 00173 * Revision 1.16 2004/04/06 18:01:50 joergr 00174 * Updated data dictionary, UIDs and transfer syntaxes for the latest Final Text 00175 * Supplements (42 and 47) and Correction Proposals (CP 25). 00176 * 00177 * Revision 1.15 2002/08/27 16:55:41 meichel 00178 * Initial release of new DICOM I/O stream classes that add support for stream 00179 * compression (deflated little endian explicit VR transfer syntax) 00180 * 00181 * Revision 1.14 2001/11/08 16:17:30 meichel 00182 * Updated data dictionary, UIDs and transfer syntaxes for DICOM 2001 edition. 00183 * 00184 * Revision 1.13 2001/06/01 15:48:55 meichel 00185 * Updated copyright header 00186 * 00187 * Revision 1.12 2001/01/17 10:20:36 meichel 00188 * Added toolkit support for JPEG-LS transfer syntaxes 00189 * 00190 * Revision 1.11 2000/04/14 16:01:23 meichel 00191 * Minor changes for thread safety. 00192 * 00193 * Revision 1.10 2000/03/08 16:26:28 meichel 00194 * Updated copyright header. 00195 * 00196 * Revision 1.9 1999/03/31 09:25:13 meichel 00197 * Updated copyright header in module dcmdata 00198 * 00199 * 00200 */