00001 /* 00002 * 00003 * Copyright (C) 1997-2003, 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: Marco Eichelberg, Norbert Olges 00021 * 00022 * Purpose: abstract codec class for JPEG decoders. 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2003/07/04 13:26:22 $ 00026 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmjpeg/include/djcodecd.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 DJCODECD_H 00035 #define DJCODECD_H 00036 00037 #include "osconfig.h" 00038 #include "oftypes.h" 00039 #include "dccodec.h" /* for class DcmCodec */ 00040 #include "djutils.h" /* for enums */ 00041 #include "ofstring.h" /* for class OFString */ 00042 00043 00044 class DataInterface; 00045 class DJEncoder; 00046 class DcmDataset; 00047 class DcmItem; 00048 class DJCodecParameter; 00049 class DJDecoder; 00050 00058 class DJCodecDecoder : public DcmCodec 00059 { 00060 public: 00061 00063 DJCodecDecoder(); 00064 00066 virtual ~DJCodecDecoder(); 00067 00078 virtual OFCondition decode( 00079 const DcmRepresentationParameter * fromRepParam, 00080 DcmPixelSequence * pixSeq, 00081 DcmPolymorphOBOW& uncompressedPixelData, 00082 const DcmCodecParameter * cp, 00083 const DcmStack& objStack) const; 00084 00099 virtual OFCondition encode( 00100 const Uint16 * pixelData, 00101 const Uint32 length, 00102 const DcmRepresentationParameter * toRepParam, 00103 DcmPixelSequence * & pixSeq, 00104 const DcmCodecParameter *cp, 00105 DcmStack & objStack) const; 00106 00121 virtual OFCondition encode( 00122 const E_TransferSyntax fromRepType, 00123 const DcmRepresentationParameter * fromRepParam, 00124 DcmPixelSequence * fromPixSeq, 00125 const DcmRepresentationParameter * toRepParam, 00126 DcmPixelSequence * & toPixSeq, 00127 const DcmCodecParameter * cp, 00128 DcmStack & objStack) const; 00129 00137 virtual OFBool canChangeCoding( 00138 const E_TransferSyntax oldRepType, 00139 const E_TransferSyntax newRepType) const; 00140 00145 virtual E_TransferSyntax supportedTransferSyntax() const = 0; 00146 00147 private: 00148 00156 virtual DJDecoder *createDecoderInstance( 00157 const DcmRepresentationParameter * toRepParam, 00158 const DJCodecParameter *cp, 00159 Uint8 bitsPerSample, 00160 OFBool isYBR) const = 0; 00161 00162 // static private helper methods 00163 00171 static Uint8 scanJpegDataForBitDepth( 00172 const Uint8 *data, 00173 const Uint32 fragmentLength); 00174 00181 static Uint16 readUint16(const Uint8 *data); 00182 00191 static OFCondition createPlanarConfigurationByte( 00192 Uint8 *imageFrame, 00193 Uint16 columns, 00194 Uint16 rows); 00195 00204 static OFCondition createPlanarConfigurationWord( 00205 Uint16 *imageFrame, 00206 Uint16 columns, 00207 Uint16 rows); 00208 00217 static OFBool requiresPlanarConfiguration( 00218 const char *sopClassUID, 00219 EP_Interpretation photometricInterpretation); 00220 00221 }; 00222 00223 #endif 00224 00225 /* 00226 * CVS/RCS Log 00227 * $Log: djcodecd.h,v $ 00228 * Revision 1.3 2003/07/04 13:26:22 meichel 00229 * Replaced forward declarations for OFString with explicit includes, 00230 * needed when compiling with HAVE_STD_STRING 00231 * 00232 * Revision 1.2 2002/05/24 14:58:03 meichel 00233 * Moved helper methods that are useful for different compression techniques 00234 * from module dcmjpeg to module dcmdata 00235 * 00236 * Revision 1.1 2001/11/13 15:56:16 meichel 00237 * Initial release of module dcmjpeg 00238 * 00239 * 00240 */