GDCM 2.2.0

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Directories
- Examples

- File List
- File Members

gdcmJPEG2000Codec.h
Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program: GDCM (Grassroots DICOM). A DICOM library
    00004
    00005   Copyright (c) 2006-2011 Mathieu Malaterre
    00006   All rights reserved.
    00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
    00008
    00009      This software is distributed WITHOUT ANY WARRANTY; without even
    00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00011      PURPOSE.  See the above copyright notice for more information.
    00012
    00013 =========================================================================*/
    00014 #ifndef GDCMJPEG2000CODEC_H
    00015 #define GDCMJPEG2000CODEC_H
    00016
    00017 #include "gdcmImageCodec.h"
    00018
    00019 namespace gdcm
    00020 {
    00021
    00022 class JPEG2000Internals;
    00030 class GDCM_EXPORT JPEG2000Codec : public ImageCodec
    00031 {
    00032   friend class Bitmap;
    00033 public:
    00034   JPEG2000Codec();
    00035   ~JPEG2000Codec();
    00036
    00037   bool CanDecode(TransferSyntax const &ts) const;
    00038   bool CanCode(TransferSyntax const &ts) const;
    00039
    00040   bool Decode(DataElement const &is, DataElement &os);
    00041   bool Code(DataElement const &in, DataElement &out);
    00042
    00043   virtual bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
    00044
    00045   // JPEG-2000 / OpenJPEG specific way of encoding lossy-ness
    00046   // ref: http://www.openjpeg.org/index.php?menu=doc#encoder
    00047   void SetRate(unsigned int idx, double rate);
    00048   double GetRate(unsigned int idx = 0) const;
    00049
    00050   void SetQuality(unsigned int idx, double q);
    00051   double GetQuality(unsigned int idx = 0) const;
    00052
    00053   void SetTileSize(unsigned int tx, unsigned int ty);
    00054
    00055   void SetNumberOfResolutions(unsigned int nres);
    00056
    00057   void SetReversible(bool res);
    00058
    00059 protected:
    00060   bool Decode(std::istream &is, std::ostream &os);
    00061 private:
    00062   bool GetHeaderInfo(const char * dummy_buffer, size_t len, TransferSyntax &ts);
    00063   JPEG2000Internals *Internals;
    00064 };
    00065
    00066 } // end namespace gdcm
    00067
    00068 #endif //GDCMJPEG2000CODEC_H