GDCM  2.2.0
gdcmJPEG2000Codec.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMJPEG2000CODEC_H
15 #define GDCMJPEG2000CODEC_H
16 
17 #include "gdcmImageCodec.h"
18 
19 namespace gdcm
20 {
21 
22 class JPEG2000Internals;
31 {
32  friend class Bitmap;
33 public:
34  JPEG2000Codec();
35  ~JPEG2000Codec();
36 
37  bool CanDecode(TransferSyntax const &ts) const;
38  bool CanCode(TransferSyntax const &ts) const;
39 
40  bool Decode(DataElement const &is, DataElement &os);
41  bool Code(DataElement const &in, DataElement &out);
42 
43  virtual bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
44 
45  // JPEG-2000 / OpenJPEG specific way of encoding lossy-ness
46  // ref: http://www.openjpeg.org/index.php?menu=doc#encoder
47  void SetRate(unsigned int idx, double rate);
48  double GetRate(unsigned int idx = 0) const;
49 
50  void SetQuality(unsigned int idx, double q);
51  double GetQuality(unsigned int idx = 0) const;
52 
53  void SetTileSize(unsigned int tx, unsigned int ty);
54 
55  void SetNumberOfResolutions(unsigned int nres);
56 
57  void SetReversible(bool res);
58 
59 protected:
60  bool Decode(std::istream &is, std::ostream &os);
61 private:
62  bool GetHeaderInfo(const char * dummy_buffer, size_t len, TransferSyntax &ts);
63  JPEG2000Internals *Internals;
64 };
65 
66 } // end namespace gdcm
67 
68 #endif //GDCMJPEG2000CODEC_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo