OFFIS DCMTK  Version 3.6.0
dcostrmz.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Marco Eichelberg
17  *
18  * Purpose: zlib compression filter for output streams
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:15:41 $
22  * CVS/RCS Revision: $Revision: 1.5 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCOSTRMZ_H
30 #define DCOSTRMZ_H
31 
32 #include "dcmtk/config/osconfig.h"
33 
34 #ifdef WITH_ZLIB
35 
36 #include "dcmtk/dcmdata/dcostrma.h" /* for DcmOutputFilter */
37 
38 BEGIN_EXTERN_C
39 #include <zlib.h>
40 END_EXTERN_C
41 
46 extern OFGlobal<int> dcmZlibCompressionLevel;
47 
51 {
52 public:
53 
56 
58  virtual ~DcmZLibOutputFilter();
59 
64  virtual OFBool good() const;
65 
70  virtual OFCondition status() const;
71 
77  virtual OFBool isFlushed() const;
78 
86  virtual offile_off_t avail() const;
87 
93  virtual offile_off_t write(const void *buf, offile_off_t buflen);
94 
100  virtual void flush();
101 
108  virtual void append(DcmConsumer& consumer);
109 
110 private:
111 
114 
117 
122  void flushOutputBuffer();
123 
134  offile_off_t compress(const void *buf, offile_off_t buflen, OFBool finalize);
135 
142  offile_off_t fillInputBuffer(const void *buf, offile_off_t buflen);
143 
151  void compressInputBuffer(OFBool finalize);
152 
155 
157  z_streamp zstream_;
158 
161 
163  OFBool flushed_;
164 
166  unsigned char *inputBuf_;
167 
169  offile_off_t inputBufStart_;
170 
172  offile_off_t inputBufCount_;
173 
175  unsigned char *outputBuf_;
176 
178  offile_off_t outputBufStart_;
179 
181  offile_off_t outputBufCount_;
182 
183 };
184 
185 #endif
186 #endif
187 
188 /*
189  * CVS/RCS Log:
190  * $Log: dcostrmz.h,v $
191  * Revision 1.5 2010-10-14 13:15:41 joergr
192  * Updated copyright header. Added reference to COPYRIGHT file.
193  *
194  * Revision 1.4 2008-06-23 12:09:13 joergr
195  * Fixed inconsistencies in Doxygen API documentation.
196  *
197  * Revision 1.3 2007/02/19 16:06:09 meichel
198  * Class DcmOutputStream and related classes are now safe for use with
199  * large files (2 GBytes or more) if supported by compiler and operating system.
200  *
201  * Revision 1.2 2005/12/08 16:28:27 meichel
202  * Changed include path schema for all DCMTK header files
203  *
204  * Revision 1.1 2002/08/27 16:55:37 meichel
205  * Initial release of new DICOM I/O stream classes that add support for stream
206  * compression (deflated little endian explicit VR transfer syntax)
207  *
208  *
209  */
210 


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2