dcxfer.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-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:  dcmdata
00019  *
00020  *  Author:  Gerd Ehlers
00021  *
00022  *  Purpose: Handling of transfer syntaxes
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2005/12/08 16:29:17 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmtk/dcmdata/dcxfer.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.18 $
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 "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00038 
00039 #include "dcmtk/dcmdata/dctypes.h"
00040 #include "dcmtk/dcmdata/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     EXS_JPEG2000MulticomponentLosslessOnly = 29,
00078     EXS_JPEG2000Multicomponent = 30
00079 } E_TransferSyntax;
00080 
00081 typedef enum {
00082     EBO_unknown = 0,
00083     EBO_LittleEndian = 1,
00084     EBO_BigEndian = 2
00085 } E_ByteOrder;
00086 
00087 
00088 typedef enum {
00089     EVT_Implicit = 0,
00090     EVT_Explicit = 1
00091 } E_VRType;
00092 
00093 
00094 typedef enum {
00095     EJE_NotEncapsulated = 0,
00096     EJE_Encapsulated = 1
00097 } E_JPEGEncapsulated;
00098 
00099 typedef enum
00100 {
00102     ESC_none = 0
00104   , ESC_unsupported = 1
00105 #ifdef WITH_ZLIB
00106 
00107   , ESC_zlib = 2
00108 #endif
00109 } E_StreamCompression;
00110 
00111 /*
00112 ** Class DcmXfer for lookup up Transfer Syntax properties and readable descriptions
00113 */
00114 
00115 class DcmXfer {
00116     const char          *xferID;
00117     const char          *xferName;
00118     E_TransferSyntax    xferSyn;
00119     E_ByteOrder         byteOrder;
00120     E_VRType            vrType;
00121     E_JPEGEncapsulated  encapsulated;
00122     Uint32              JPEGProcess8;
00123     Uint32              JPEGProcess12;
00124     E_StreamCompression streamCompression;
00125 
00126 public:
00127     DcmXfer( E_TransferSyntax xfer );
00128     DcmXfer( const char *xferName_xferID );
00129     DcmXfer( const DcmXfer &newXfer );
00130     ~DcmXfer();
00131 
00132     DcmXfer & operator = ( const E_TransferSyntax xfer );
00133     DcmXfer & operator = ( const DcmXfer &newtag );
00134 
00135     inline E_TransferSyntax getXfer() const  { return xferSyn; }
00136     inline E_ByteOrder getByteOrder() const { return byteOrder; }
00137     inline const char* getXferName() const { return xferName; }
00138     inline const char* getXferID() const { return xferID; }
00139     inline OFBool isLittleEndian() const
00140     {
00141         return byteOrder == EBO_LittleEndian;
00142     }
00143     inline OFBool isBigEndian() const { return byteOrder == EBO_BigEndian; }
00144     inline OFBool isImplicitVR() const { return vrType == EVT_Implicit; }
00145     inline OFBool isExplicitVR() const { return vrType == EVT_Explicit; }
00146     inline OFBool isEncapsulated() const
00147     {
00148         return encapsulated == EJE_Encapsulated;
00149     }
00150     inline OFBool isNotEncapsulated() const
00151     {
00152         return encapsulated == EJE_NotEncapsulated;
00153     }
00154     inline Uint32 getJPEGProcess8Bit() const { return JPEGProcess8; }
00155     inline Uint32 getJPEGProcess12Bit() const { return JPEGProcess12;}
00156     inline E_StreamCompression getStreamCompression() const { return streamCompression;}
00157 
00158     /* return the number of bytes needed to describe the tag, length, VR
00159     ** and any reserved fields for this transfer syntax when encoding the
00160     ** specified VR.
00161     */
00162     Uint32 sizeofTagHeader(DcmEVR evr);
00163 
00164 };
00165 
00166 
00167 extern const E_ByteOrder gLocalByteOrder;
00168 
00169 #endif // DCXFER_H
00170 
00171 /*
00172  * CVS/RCS Log:
00173  * $Log: dcxfer.h,v $
00174  * Revision 1.18  2005/12/08 16:29:17  meichel
00175  * Changed include path schema for all DCMTK header files
00176  *
00177  * Revision 1.17  2005/10/25 08:55:32  meichel
00178  * Updated list of UIDs and added support for new transfer syntaxes
00179  *   and storage SOP classes.
00180  *
00181  * Revision 1.16  2004/04/06 18:01:50  joergr
00182  * Updated data dictionary, UIDs and transfer syntaxes for the latest Final Text
00183  * Supplements (42 and 47) and Correction Proposals (CP 25).
00184  *
00185  * Revision 1.15  2002/08/27 16:55:41  meichel
00186  * Initial release of new DICOM I/O stream classes that add support for stream
00187  *   compression (deflated little endian explicit VR transfer syntax)
00188  *
00189  * Revision 1.14  2001/11/08 16:17:30  meichel
00190  * Updated data dictionary, UIDs and transfer syntaxes for DICOM 2001 edition.
00191  *
00192  * Revision 1.13  2001/06/01 15:48:55  meichel
00193  * Updated copyright header
00194  *
00195  * Revision 1.12  2001/01/17 10:20:36  meichel
00196  * Added toolkit support for JPEG-LS transfer syntaxes
00197  *
00198  * Revision 1.11  2000/04/14 16:01:23  meichel
00199  * Minor changes for thread safety.
00200  *
00201  * Revision 1.10  2000/03/08 16:26:28  meichel
00202  * Updated copyright header.
00203  *
00204  * Revision 1.9  1999/03/31 09:25:13  meichel
00205  * Updated copyright header in module dcmdata
00206  *
00207  *
00208  */


Generated on 20 Dec 2005 for OFFIS DCMTK Version 3.5.4 by Doxygen 1.4.5