gdcmRLECodec.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMRLECODEC_H
#define GDCMRLECODEC_H
#include "gdcmImageCodec.h"
namespace gdcm
{
class Fragment;
class RLEInternals;
class GDCM_EXPORT RLECodec : public ImageCodec
{
friend class ImageRegionReader;
public:
RLECodec();
~RLECodec() override;
bool CanCode(TransferSyntax const &ts) const override;
bool CanDecode(TransferSyntax const &ts) const override;
bool Decode(DataElement const &is, DataElement &os) override;
unsigned long GetBufferLength() const { return BufferLength; }
void SetBufferLength(unsigned long l) { BufferLength = l; }
bool Code(DataElement const &in, DataElement &out) override;
bool GetHeaderInfo(std::istream &is, TransferSyntax &ts) override;
ImageCodec * Clone() const override;
protected:
bool DecodeExtent(
char *buffer,
unsigned int XMin, unsigned int XMax,
unsigned int YMin, unsigned int YMax,
unsigned int ZMin, unsigned int ZMax,
std::istream & is
);
bool DecodeByStreams(std::istream &is, std::ostream &os) override;
public:
void SetLength(unsigned long l)
{
Length = l;
}
protected:
bool StartEncode( std::ostream & ) override;
bool IsRowEncoder() override;
bool IsFrameEncoder() override;
bool AppendRowEncode( std::ostream & out, const char * data, size_t datalen ) override;
bool AppendFrameEncode( std::ostream & out, const char * data, size_t datalen ) override;
bool StopEncode( std::ostream & ) override;
private:
bool DecodeByStreamsCommon(std::istream &is, std::ostream &os);
RLEInternals *Internals;
unsigned long Length;
unsigned long BufferLength;
size_t DecodeFragment(Fragment const & frag, char *buffer, size_t llen);
};
} // end namespace gdcm
#endif //GDCMRLECODEC_H
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::Fragment
Class to represent a Fragment.
Definition gdcmFragment.h:44
gdcm::ImageCodec::ImageCodec
ImageCodec()
gdcm::RLECodec::DecodeByStreams
bool DecodeByStreams(std::istream &is, std::ostream &os) override
gdcm::RLECodec::RLECodec
RLECodec()
gdcm::RLECodec::ImageRegionReader
friend class ImageRegionReader
Definition gdcmRLECodec.h:38
gdcm::RLECodec::Clone
ImageCodec * Clone() const override
gdcm::RLECodec::AppendRowEncode
bool AppendRowEncode(std::ostream &out, const char *data, size_t datalen) override
gdcm::RLECodec::AppendFrameEncode
bool AppendFrameEncode(std::ostream &out, const char *data, size_t datalen) override
gdcm::RLECodec::CanCode
bool CanCode(TransferSyntax const &ts) const override
Return whether this coder support this transfer syntax (can code it).
gdcm::RLECodec::IsFrameEncoder
bool IsFrameEncoder() override
gdcm::RLECodec::Code
bool Code(DataElement const &in, DataElement &out) override
Code.
gdcm::RLECodec::GetBufferLength
unsigned long GetBufferLength() const
Definition gdcmRLECodec.h:45
gdcm::RLECodec::~RLECodec
~RLECodec() override
gdcm::RLECodec::StartEncode
bool StartEncode(std::ostream &) override
gdcm::RLECodec::DecodeExtent
bool DecodeExtent(char *buffer, unsigned int XMin, unsigned int XMax, unsigned int YMin, unsigned int YMax, unsigned int ZMin, unsigned int ZMax, std::istream &is)
gdcm::RLECodec::GetHeaderInfo
bool GetHeaderInfo(std::istream &is, TransferSyntax &ts) override
gdcm::RLECodec::CanDecode
bool CanDecode(TransferSyntax const &ts) const override
Return whether this decoder support this transfer syntax (can decode it).
gdcm::RLECodec::SetLength
void SetLength(unsigned long l)
Definition gdcmRLECodec.h:64
gdcm::RLECodec::IsRowEncoder
bool IsRowEncoder() override
gdcm::RLECodec::SetBufferLength
void SetBufferLength(unsigned long l)
Definition gdcmRLECodec.h:46
gdcm::RLECodec::StopEncode
bool StopEncode(std::ostream &) override
gdcm::RLECodec::Decode
bool Decode(DataElement const &is, DataElement &os) override
Decode.
gdcm::TransferSyntax
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
gdcmImageCodec.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21