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 12 bits/sample. 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:59:25 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmjpeg/include/dcmtk/dcmjpeg/djeijg12.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 DJEIJG12_H 00035 #define DJEIJG12_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 typedef struct jpeg_compress_struct * j_compress_ptr; 00045 struct jpeg_decompress_struct; 00046 typedef struct jpeg_decompress_struct * j_decompress_ptr; 00047 } 00048 00049 class DJCodecParameter; 00050 00051 00055 class DJCompressIJG12Bit: public DJEncoder 00056 { 00057 public: 00058 00064 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); 00065 00071 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); 00072 00074 virtual ~DJCompressIJG12Bit(); 00075 00088 virtual OFCondition encode( 00089 Uint16 columns, 00090 Uint16 rows, 00091 EP_Interpretation interpr, 00092 Uint16 samplesPerPixel, 00093 Uint16 *image_buffer, 00094 Uint8 *&to, 00095 Uint32 &length); 00096 00109 virtual OFCondition encode( 00110 Uint16 columns, 00111 Uint16 rows, 00112 EP_Interpretation interpr, 00113 Uint16 samplesPerPixel, 00114 Uint8 *image_buffer, 00115 Uint8 *&to, 00116 Uint32 &length); 00117 00120 virtual Uint16 bytesPerSample() const { return 2; } 00121 00124 virtual Uint16 bitsPerSample() const { return 12; } 00125 00130 void initDestination(jpeg_compress_struct *cinfo); 00131 00136 int emptyOutputBuffer(jpeg_compress_struct *cinfo); 00137 00142 void termDestination(jpeg_compress_struct *cinfo); 00143 00148 virtual void outputMessage(void *arg) const; 00149 00150 private: 00151 00153 DJCompressIJG12Bit(const DJCompressIJG12Bit&); 00154 00156 DJCompressIJG12Bit& operator=(const DJCompressIJG12Bit&); 00157 00159 void cleanup(); 00160 00162 const DJCodecParameter *cparam; 00163 00165 Uint8 quality; 00166 00168 int psv; 00169 00171 int pt; 00172 00174 EJ_Mode modeofOperation; 00175 00177 OFList<unsigned char *> pixelDataList; 00178 00180 size_t bytesInLastBlock; 00181 00182 }; 00183 00184 #endif 00185 00186 /* 00187 * CVS/RCS Log 00188 * $Log: djeijg12.h,v $ 00189 * Revision 1.3 2005/12/08 16:59:25 meichel 00190 * Changed include path schema for all DCMTK header files 00191 * 00192 * Revision 1.2 2001/11/19 15:13:28 meichel 00193 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00194 * messages from the IJG library are printed on ofConsole, otherwise 00195 * the library remains quiet. 00196 * 00197 * Revision 1.1 2001/11/13 15:56:23 meichel 00198 * Initial release of module dcmjpeg 00199 * 00200 * 00201 */