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 12 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 DJEIJG12_H 00030 #define DJEIJG12_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 typedef struct jpeg_compress_struct * j_compress_ptr; 00040 struct jpeg_decompress_struct; 00041 typedef struct jpeg_decompress_struct * j_decompress_ptr; 00042 } 00043 00044 class DJCodecParameter; 00045 00046 00050 class DJCompressIJG12Bit: public DJEncoder 00051 { 00052 public: 00053 00059 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, Uint8 quality); 00060 00066 DJCompressIJG12Bit(const DJCodecParameter& cp, EJ_Mode mode, int prediction, int ptrans); 00067 00069 virtual ~DJCompressIJG12Bit(); 00070 00083 virtual OFCondition encode( 00084 Uint16 columns, 00085 Uint16 rows, 00086 EP_Interpretation interpr, 00087 Uint16 samplesPerPixel, 00088 Uint16 *image_buffer, 00089 Uint8 *&to, 00090 Uint32 &length); 00091 00104 virtual OFCondition encode( 00105 Uint16 columns, 00106 Uint16 rows, 00107 EP_Interpretation interpr, 00108 Uint16 samplesPerPixel, 00109 Uint8 *image_buffer, 00110 Uint8 *&to, 00111 Uint32 &length); 00112 00115 virtual Uint16 bytesPerSample() const { return 2; } 00116 00119 virtual Uint16 bitsPerSample() const { return 12; } 00120 00125 void initDestination(jpeg_compress_struct *cinfo); 00126 00131 int emptyOutputBuffer(jpeg_compress_struct *cinfo); 00132 00137 void termDestination(jpeg_compress_struct *cinfo); 00138 00144 virtual void emitMessage(void *arg, int msg_level) const; 00145 00146 private: 00147 00149 DJCompressIJG12Bit(const DJCompressIJG12Bit&); 00150 00152 DJCompressIJG12Bit& operator=(const DJCompressIJG12Bit&); 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: djeijg12.h,v $ 00185 * Revision 1.5 2010-10-14 13:17:17 joergr 00186 * Updated copyright header. Added reference to COPYRIGHT file. 00187 * 00188 * Revision 1.4 2009-11-18 16:17:54 uli 00189 * Use more than just the INFO log level. 00190 * 00191 * Revision 1.3 2005-12-08 16:59:25 meichel 00192 * Changed include path schema for all DCMTK header files 00193 * 00194 * Revision 1.2 2001/11/19 15:13:28 meichel 00195 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00196 * messages from the IJG library are printed on ofConsole, otherwise 00197 * the library remains quiet. 00198 * 00199 * Revision 1.1 2001/11/13 15:56:23 meichel 00200 * Initial release of module dcmjpeg 00201 * 00202 * 00203 */