00001 /* 00002 * 00003 * Copyright (C) 1997-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmjpeg 00015 * 00016 * Author: Norbert Olges, Marco Eichelberg 00017 * 00018 * Purpose: compression routines of the IJG JPEG library configured for 8 bits/sample. 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:17:17 $ 00022 * CVS/RCS Revision: $Revision: 1.5 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DJEIJG8_H 00030 #define DJEIJG8_H 00031 00032 #include "dcmtk/config/osconfig.h" 00033 #include "dcmtk/ofstd/oflist.h" 00034 #include "dcmtk/dcmjpeg/djencabs.h" 00035 00036 extern "C" 00037 { 00038 struct jpeg_compress_struct; 00039 } 00040 00041 class DJCodecParameter; 00042 00046 class DJCompressIJG8Bit: public DJEncoder 00047 { 00048 public: 00049 00055 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); 00056 00062 DJCompressIJG8Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); 00063 00065 virtual ~DJCompressIJG8Bit(); 00066 00079 virtual OFCondition encode( 00080 Uint16 columns, 00081 Uint16 rows, 00082 EP_Interpretation interpr, 00083 Uint16 samplesPerPixel, 00084 Uint16 *image_buffer, 00085 Uint8 *&to, 00086 Uint32 &length); 00087 00100 virtual OFCondition encode( 00101 Uint16 columns, 00102 Uint16 rows, 00103 EP_Interpretation interpr, 00104 Uint16 samplesPerPixel, 00105 Uint8 *image_buffer, 00106 Uint8 *&to, 00107 Uint32 &length); 00108 00111 virtual Uint16 bytesPerSample() const { return 1; } 00112 00115 virtual Uint16 bitsPerSample() const { return 8; } 00116 00121 void initDestination(jpeg_compress_struct *cinfo); 00122 00127 int emptyOutputBuffer(jpeg_compress_struct *cinfo); 00128 00133 void termDestination(jpeg_compress_struct *cinfo); 00134 00140 virtual void emitMessage(void *arg, int msg_level) const; 00141 00142 private: 00143 00145 DJCompressIJG8Bit(const DJCompressIJG8Bit&); 00146 00148 DJCompressIJG8Bit& operator=(const DJCompressIJG8Bit&); 00149 00151 void cleanup(); 00152 00154 const DJCodecParameter *cparam; 00155 00157 Uint8 quality; 00158 00160 int psv; 00161 00163 int pt; 00164 00166 EJ_Mode modeofOperation; 00167 00169 OFList<unsigned char *> pixelDataList; 00170 00172 size_t bytesInLastBlock; 00173 00174 }; 00175 00176 #endif 00177 00178 /* 00179 * CVS/RCS Log 00180 * $Log: djeijg8.h,v $ 00181 * Revision 1.5 2010-10-14 13:17:17 joergr 00182 * Updated copyright header. Added reference to COPYRIGHT file. 00183 * 00184 * Revision 1.4 2009-11-18 16:17:54 uli 00185 * Use more than just the INFO log level. 00186 * 00187 * Revision 1.3 2005-12-08 16:59:27 meichel 00188 * Changed include path schema for all DCMTK header files 00189 * 00190 * Revision 1.2 2001/11/19 15:13:29 meichel 00191 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00192 * messages from the IJG library are printed on ofConsole, otherwise 00193 * the library remains quiet. 00194 * 00195 * Revision 1.1 2001/11/13 15:56:24 meichel 00196 * Initial release of module dcmjpeg 00197 * 00198 * 00199 */