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: decompression 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.6 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 #ifndef DJDIJG12_H 00030 #define DJDIJG12_H 00031 00032 #include "dcmtk/config/osconfig.h" 00033 #include "dcmtk/dcmjpeg/djdecabs.h" /* for class DJDecoder */ 00034 00035 extern "C" 00036 { 00037 struct jpeg_decompress_struct; 00038 } 00039 00040 class DJCodecParameter; 00041 00045 class DJDecompressIJG12Bit : public DJDecoder 00046 { 00047 public: 00048 00053 DJDecompressIJG12Bit(const DJCodecParameter& cp, OFBool isYBR); 00054 00056 virtual ~DJDecompressIJG12Bit(); 00057 00062 virtual OFCondition init(); 00063 00076 virtual OFCondition decode( 00077 Uint8 *compressedFrameBuffer, 00078 Uint32 compressedFrameBufferSize, 00079 Uint8 *uncompressedFrameBuffer, 00080 Uint32 uncompressedFrameBufferSize, 00081 OFBool isSigned); 00082 00085 virtual Uint16 bytesPerSample() const 00086 { 00087 return sizeof(Uint16); 00088 } 00089 00093 virtual EP_Interpretation getDecompressedColorModel() const 00094 { 00095 return decompressedColorModel; 00096 } 00097 00102 virtual void emitMessage(int msg_level) const; 00103 00104 private: 00105 00107 DJDecompressIJG12Bit(const DJDecompressIJG12Bit&); 00108 00110 DJDecompressIJG12Bit& operator=(const DJDecompressIJG12Bit&); 00111 00113 void cleanup(); 00114 00116 const DJCodecParameter *cparam; 00117 00119 jpeg_decompress_struct *cinfo; 00120 00122 int suspension; 00123 00125 void *jsampBuffer; 00126 00128 OFBool dicomPhotometricInterpretationIsYCbCr; 00129 00131 EP_Interpretation decompressedColorModel; 00132 00133 }; 00134 00135 #endif 00136 00137 /* 00138 * CVS/RCS Log 00139 * $Log: djdijg12.h,v $ 00140 * Revision 1.6 2010-10-14 13:17:17 joergr 00141 * Updated copyright header. Added reference to COPYRIGHT file. 00142 * 00143 * Revision 1.5 2009-11-18 16:17:53 uli 00144 * Use more than just the INFO log level. 00145 * 00146 * Revision 1.4 2005-12-08 16:59:22 meichel 00147 * Changed include path schema for all DCMTK header files 00148 * 00149 * Revision 1.3 2005/11/30 14:08:57 onken 00150 * Added check to decline automatic IJG color space conversion of signed pixel 00151 * data, because IJG lib only handles unsigned input for conversions. 00152 * 00153 * Revision 1.2 2001/11/19 15:13:27 meichel 00154 * Introduced verbose mode in module dcmjpeg. If enabled, warning 00155 * messages from the IJG library are printed on ofConsole, otherwise 00156 * the library remains quiet. 00157 * 00158 * Revision 1.1 2001/11/13 15:56:22 meichel 00159 * Initial release of module dcmjpeg 00160 * 00161 * 00162 */