00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef DCISTRMZ_H
00035 #define DCISTRMZ_H
00036
00037 #include "osconfig.h"
00038
00039 #ifdef WITH_ZLIB
00040
00041 #include "dcistrma.h"
00042
00043 BEGIN_EXTERN_C
00044 #include <zlib.h>
00045 END_EXTERN_C
00046
00052 extern OFGlobal<OFBool> dcmZlibExpectRFC1950Encoding;
00053
00056 class DcmZLibInputFilter: public DcmInputFilter
00057 {
00058 public:
00059
00061 DcmZLibInputFilter();
00062
00064 virtual ~DcmZLibInputFilter();
00065
00070 virtual OFBool good() const;
00071
00076 virtual OFCondition status() const;
00077
00081 virtual OFBool eos() const;
00082
00090 virtual Uint32 avail() const;
00091
00097 virtual Uint32 read(void *buf, Uint32 buflen);
00098
00103 virtual Uint32 skip(Uint32 skiplen);
00104
00109 virtual void putback(Uint32 num);
00110
00117 virtual void append(DcmProducer& producer);
00118
00119 private:
00120
00122 DcmZLibInputFilter(const DcmZLibInputFilter&);
00123
00125 DcmZLibInputFilter& operator=(const DcmZLibInputFilter&);
00126
00132 Uint32 fillInputBuffer();
00133
00141 Uint32 decompress(const void *buf, Uint32 buflen);
00142
00146 void fillOutputBuffer();
00147
00152 void flushOutputBuffer();
00153
00160 Uint32 fillInputBuffer(const void *buf, Uint32 buflen);
00161
00169 void compressInputBuffer(OFBool finalize);
00170
00171
00173 DcmProducer *current_;
00174
00176 z_streamp zstream_;
00177
00179 OFCondition status_;
00180
00182 OFBool eos_;
00183
00185 unsigned char *inputBuf_;
00186
00188 Uint32 inputBufStart_;
00189
00191 Uint32 inputBufCount_;
00192
00194 unsigned char *outputBuf_;
00195
00197 Uint32 outputBufStart_;
00198
00200 Uint32 outputBufCount_;
00201
00203 Uint32 outputBufPutback_;
00204
00206 OFBool padded_;
00207 };
00208
00209 #endif
00210 #endif
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221