00001 /* 00002 * 00003 * Copyright (C) 1997-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: dcmjpeg 00019 * 00020 * Author: Norbert Olges, Marco Eichelberg 00021 * 00022 * Purpose: compression routines of the IJG JPEG library configured for 8 bits/sample. 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:59:27 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h,v $ 00027 * CVS/RCS Revision: $Revision: 1.3 $ 00028 * Status: $State: Exp $ 00029 * 00030 * CVS/RCS Log at end of file 00031 * 00032 */ 00033 00034 #ifndef DJEIJG8_H 00035 #define DJEIJG8_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/ofstd/oflist.h" 00039 #include "dcmtk/dcmjpeg/djencabs.h" 00040 00041 extern "C" 00042 { 00043 struct jpeg_compress_struct; 00044 } 00045 00046 class DJCodecParameter; 00047 00051 class DJCompressIJG8Bit: public DJEncoder 00052 { 00053 public: 00054 00060 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); 00061 00067 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); 00068 00070 virtual ~DJCompressIJG8Bit(); 00071 00084 virtual OFCondition encode( 00085 Uint16 columns, 00086 Uint16 rows, 00087 EP_Interpretation interpr, 00088 Uint16 samplesPerPixel, 00089 Uint16 *image_buffer, 00090 Uint8 *&to, 00091 Uint32 &length); 00092 00105 virtual OFCondition encode( 00106 Uint16 columns, 00107 Uint16 rows, 00108 EP_Interpretation interpr, 00109 Uint16 samplesPerPixel, 00110 Uint8 *image_buffer, 00111 Uint8 *&to, 00112 Uint32 &length); 00113 00116 virtual Uint16 bytesPerSample() const { return 1; } 00117 00120 virtual Uint16 bitsPerSample() const { return 8; } 00121 00126 void initDestination(jpeg_compress_struct *cinfo); 00127 00132 int emptyOutputBuffer(jpeg_compress_struct *cinfo); 00133 00138 void termDestination(jpeg_compress_struct *cinfo); 00139 00144 virtual void outputMessage(void *arg) const; 00145 00146 private: 00147 00149 DJCompressIJG8Bit(const DJCompressIJG8Bit&); 00150 00152 DJCompressIJG8Bit& operator=(const DJCompressIJG8Bit&); 00153 00155 void cleanup(); 00156 00158 const DJCodecParameter *cparam; 00159 00161 Uint8 quality; 00162 00164 int psv; 00165 00167 int pt; 00168 00170 EJ_Mode modeofOperation; 00171 00173 OFList<unsigned char *> pixelDataList; 00174 00176 size_t bytesInLastBlock; 00177 00178 }; 00179 00180 #endif 00181 00182 /* 00183 * CVS/RCS Log 00184 * $Log: djeijg8.h,v $ 00185 * Revision 1.3 2005/12/08 16:59:27 meichel 00186 * Changed include path schema for all DCMTK header files 00187 * 00188 * Revision 1.2 2001/11/19 15:13:29 meichel 00189 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00190 * messages from the IJG library are printed on ofConsole, otherwise 00191 * the library remains quiet. 00192 * 00193 * Revision 1.1 2001/11/13 15:56:24 meichel 00194 * Initial release of module dcmjpeg 00195 * 00196 * 00197 */