Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef GDCMRLECODEC_H
00015 #define GDCMRLECODEC_H
00016
00017 #include "gdcmImageCodec.h"
00018
00019 namespace gdcm
00020 {
00021
00022 class Fragment;
00023 class RLEInternals;
00036 class GDCM_EXPORT RLECodec : public ImageCodec
00037 {
00038 friend class ImageRegionReader;
00039 public:
00040 RLECodec();
00041 ~RLECodec();
00042 bool CanCode(TransferSyntax const &ts) const;
00043 bool CanDecode(TransferSyntax const &ts) const;
00044 bool Decode(DataElement const &is, DataElement &os);
00045 unsigned long GetBufferLength() const { return BufferLength; }
00046 void SetBufferLength(unsigned long l) { BufferLength = l; }
00047
00048 bool Code(DataElement const &in, DataElement &out);
00049 bool GetHeaderInfo(std::istream &is, TransferSyntax &ts);
00050
00051 protected:
00052 bool DecodeExtent(
00053 char *buffer,
00054 unsigned int XMin, unsigned int XMax,
00055 unsigned int YMin, unsigned int YMax,
00056 unsigned int ZMin, unsigned int ZMax,
00057 std::istream & is
00058 );
00059
00060 bool DecodeByStreams(std::istream &is, std::ostream &os);
00061 public:
00062
00063 void SetLength(unsigned long l)
00064 {
00065 Length = l;
00066 }
00067 private:
00068 bool DecodeByStreamsCommon(std::istream &is, std::ostream &os);
00069 RLEInternals *Internals;
00070 unsigned long Length;
00071 unsigned long BufferLength;
00072 size_t DecodeFragment(Fragment const & frag, char *buffer, unsigned long llen);
00073 };
00074
00075 }
00076
00077 #endif //GDCMRLECODEC_H