Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMJPEGCODEC_H
00016 #define GDCMJPEGCODEC_H
00017
00018 #include "gdcmImageCodec.h"
00019
00020 namespace gdcm
00021 {
00022
00023 class PixelFormat;
00024 class TransferSyntax;
00041 class GDCM_EXPORT JPEGCodec : public ImageCodec
00042 {
00043 public:
00044 JPEGCodec();
00045 ~JPEGCodec();
00046 bool CanDecode(TransferSyntax const &ts) const;
00047 bool CanCode(TransferSyntax const &ts) const;
00048 bool Decode(DataElement const &is, DataElement &os);
00049 void SetPixelFormat(PixelFormat const &pf);
00050
00052 void ComputeOffsetTable(bool b);
00053
00055 bool Code(DataElement const &in, DataElement &out);
00056
00057 virtual bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
00058
00059
00060
00061 void SetQuality(double q);
00062 double GetQuality() const;
00063
00064 void SetLossless(bool l);
00065 bool GetLossless() const;
00066
00067 protected:
00068 bool Decode(std::istream &is, std::ostream &os);
00069 bool IsValid(PhotometricInterpretation const &pi);
00070
00071 protected:
00072
00073
00074 void SetBitSample(int bit);
00075
00076 protected:
00077 int BitSample;
00078 bool Lossless;
00079 int Quality;
00080
00081 private:
00082 void SetupJPEGBitCodec(int bit);
00083 JPEGCodec *Internal;
00084 };
00085
00086 }
00087
00088 #endif //GDCMJPEGCODEC_H