OFFIS DCMTK  Version 3.6.0
djcodecd.h
1 /*
2  *
3  * Copyright (C) 2001-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmjpeg
15  *
16  * Author: Marco Eichelberg, Norbert Olges
17  *
18  * Purpose: abstract codec class for JPEG decoders.
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:16 $
22  * CVS/RCS Revision: $Revision: 1.8 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DJCODECD_H
30 #define DJCODECD_H
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/ofstd/oftypes.h"
34 #include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */
35 #include "dcmtk/dcmjpeg/djutils.h" /* for enums */
36 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */
37 
38 
39 class DataInterface;
40 class DJEncoder;
41 class DcmDataset;
42 class DcmItem;
43 class DJCodecParameter;
44 class DJDecoder;
45 
53 class DJCodecDecoder : public DcmCodec
54 {
55 public:
56 
59 
61  virtual ~DJCodecDecoder();
62 
73  virtual OFCondition decode(
74  const DcmRepresentationParameter * fromRepParam,
75  DcmPixelSequence * pixSeq,
76  DcmPolymorphOBOW& uncompressedPixelData,
77  const DcmCodecParameter * cp,
78  const DcmStack& objStack) const;
79 
105  virtual OFCondition decodeFrame(
106  const DcmRepresentationParameter * fromParam,
107  DcmPixelSequence * fromPixSeq,
108  const DcmCodecParameter * cp,
109  DcmItem *dataset,
110  Uint32 frameNo,
111  Uint32& startFragment,
112  void *buffer,
113  Uint32 bufSize,
114  OFString& decompressedColorModel) const;
115 
130  virtual OFCondition encode(
131  const Uint16 * pixelData,
132  const Uint32 length,
133  const DcmRepresentationParameter * toRepParam,
134  DcmPixelSequence * & pixSeq,
135  const DcmCodecParameter *cp,
136  DcmStack & objStack) const;
137 
152  virtual OFCondition encode(
153  const E_TransferSyntax fromRepType,
154  const DcmRepresentationParameter * fromRepParam,
155  DcmPixelSequence * fromPixSeq,
156  const DcmRepresentationParameter * toRepParam,
157  DcmPixelSequence * & toPixSeq,
158  const DcmCodecParameter * cp,
159  DcmStack & objStack) const;
160 
168  virtual OFBool canChangeCoding(
169  const E_TransferSyntax oldRepType,
170  const E_TransferSyntax newRepType) const;
171 
186  const DcmRepresentationParameter *fromParam,
187  DcmPixelSequence *fromPixSeq,
188  const DcmCodecParameter *cp,
189  DcmItem *dataset,
190  OFString &decompressedColorModel) const;
191 
196  virtual E_TransferSyntax supportedTransferSyntax() const = 0;
197 
198 private:
199 
208  const DcmRepresentationParameter * toRepParam,
209  const DJCodecParameter *cp,
210  Uint8 bitsPerSample,
211  OFBool isYBR) const = 0;
212 
213  // static private helper methods
214 
222  static Uint8 scanJpegDataForBitDepth(
223  const Uint8 *data,
224  const Uint32 fragmentLength);
225 
232  static Uint16 readUint16(const Uint8 *data);
233 
243  Uint8 *imageFrame,
244  Uint16 columns,
245  Uint16 rows);
246 
256  Uint16 *imageFrame,
257  Uint16 columns,
258  Uint16 rows);
259 
268  static OFBool requiresPlanarConfiguration(
269  const char *sopClassUID,
270  EP_Interpretation photometricInterpretation);
271 };
272 
273 #endif
274 
275 /*
276  * CVS/RCS Log
277  * $Log: djcodecd.h,v $
278  * Revision 1.8 2010-10-14 13:17:16 joergr
279  * Updated copyright header. Added reference to COPYRIGHT file.
280  *
281  * Revision 1.7 2009-11-17 16:46:01 joergr
282  * Added new method that allows for determining the color model of the
283  * decompressed image.
284  *
285  * Revision 1.6 2008-05-29 10:48:44 meichel
286  * Implemented new method DcmPixelData::getUncompressedFrame
287  * that permits frame-wise access to compressed and uncompressed
288  * objects without ever loading the complete object into main memory.
289  * For this new method to work with compressed images, all classes derived from
290  * DcmCodec need to implement a new method decodeFrame(). For now, only
291  * dummy implementations returning an error code have been defined.
292  *
293  * Revision 1.5 2005/12/08 16:59:11 meichel
294  * Changed include path schema for all DCMTK header files
295  *
296  * Revision 1.4 2004/08/24 14:57:08 meichel
297  * Updated compression helper methods. Image type is not set to SECONDARY
298  * any more, support for the purpose of reference code sequence added.
299  *
300  * Revision 1.3 2003/07/04 13:26:22 meichel
301  * Replaced forward declarations for OFString with explicit includes,
302  * needed when compiling with HAVE_STD_STRING
303  *
304  * Revision 1.2 2002/05/24 14:58:03 meichel
305  * Moved helper methods that are useful for different compression techniques
306  * from module dcmjpeg to module dcmdata
307  *
308  * Revision 1.1 2001/11/13 15:56:16 meichel
309  * Initial release of module dcmjpeg
310  *
311  *
312  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2