GDCM: gdcm::ImageCodec Class Reference

GDCM 3.2.10

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
gdcm::ImageCodec Class Referenceabstract

ImageCodec. More...

`#include <gdcmImageCodec.h>`

Inheritance diagram for gdcm::ImageCodec:
[legend]
Collaboration diagram for gdcm::ImageCodec:
[legend]

## Public Member Functions
| ImageCodec ()
| ~ImageCodec () override
bool | CanCode (TransferSyntax const &) const override
| Return whether this coder support this transfer syntax (can code it).
bool | CanDecode (TransferSyntax const &) const override
| Return whether this decoder support this transfer syntax (can decode it).
bool | CleanupUnusedBits (char *data, size_t datalen)
virtual ImageCodec * | Clone () const =0
bool | Decode (DataElement const &is_, DataElement &os) override
| Decode.
const unsigned int * | GetDimensions () const
virtual bool | GetHeaderInfo (std::istream &is_, TransferSyntax &ts)
bool | GetLossyFlag () const
const LookupTable & | GetLUT () const
bool | GetNeedByteSwap () const
unsigned int | GetNumberOfDimensions () const
const PhotometricInterpretation & | GetPhotometricInterpretation () const
PixelFormat & | GetPixelFormat ()
const PixelFormat & | GetPixelFormat () const
unsigned int | GetPlanarConfiguration () const
bool | IsLossy () const
void | SetDimensions (const std::vector< unsigned int > &d)
void | SetDimensions (const unsigned int d[3])
void | SetLossyFlag (bool l)
void | SetLUT (LookupTable const &lut)
void | SetNeedByteSwap (bool b)
void | SetNeedOverlayCleanup (bool b)
void | SetNumberOfDimensions (unsigned int dim)
void | SetPhotometricInterpretation (PhotometricInterpretation const &pi)
virtual void | SetPixelFormat (PixelFormat const &pf)
void | SetPlanarConfiguration (unsigned int pc)
Public Member Functions inherited from gdcm::Coder
virtual | ~Coder ()=default
virtual bool | Code (DataElement const &in_, DataElement &out_)
| Code.
Public Member Functions inherited from gdcm::Decoder
virtual | ~Decoder ()=default

## Protected Types
typedef SmartPointer< LookupTable > | LUTPtr

## Protected Member Functions
virtual bool | AppendFrameEncode (std::ostream &out, const char *data, size_t datalen)
virtual bool | AppendRowEncode (std::ostream &out, const char *data, size_t datalen)
bool | DecodeByStreams (std::istream &is_, std::ostream &os) override
bool | DoByteSwap (std::istream &is_, std::ostream &os)
bool | DoInvertMonochrome (std::istream &is_, std::ostream &os)
bool | DoOverlayCleanup (std::istream &is_, std::ostream &os)
bool | DoPaddedCompositePixelCode (std::istream &is_, std::ostream &os)
bool | DoPlanarConfiguration (std::istream &is_, std::ostream &os)
bool | DoSimpleCopy (std::istream &is_, std::ostream &os)
bool | DoYBR (std::istream &is_, std::ostream &os)
bool | DoYBRFull422 (std::istream &is_, std::ostream &os)
virtual bool | IsFrameEncoder ()
virtual bool | IsRowEncoder ()
virtual bool | IsValid (PhotometricInterpretation const &pi)
virtual bool | StartEncode (std::ostream &os)
virtual bool | StopEncode (std::ostream &os)
Protected Member Functions inherited from gdcm::Coder
virtual bool | InternalCode (const char *bv, unsigned long len, std::ostream &os)

## Protected Attributes
unsigned int | Dimensions [3]
bool | LossyFlag
LUTPtr | LUT
bool | NeedByteSwap
bool | NeedOverlayCleanup
unsigned int | NumberOfDimensions
PixelFormat | PF
PhotometricInterpretation | PI
unsigned int | PlanarConfiguration
bool | RequestPaddedCompositePixelCode
bool | RequestPlanarConfiguration

## Friends
class | FileChangeTransferSyntax
class | ImageChangePhotometricInterpretation

## Detailed Description

ImageCodec.

Note
  Main codec, this is a central place for all implementation

Examples
  FileChangeTSLossy.cs.

## Member Typedef Documentation

## ◆ LUTPtr

typedef SmartPointer<LookupTable> gdcm::ImageCodec::LUTPtr
| protected

## Constructor & Destructor Documentation

## ◆ ImageCodec()

gdcm::ImageCodec::ImageCodec | ( |  | ) |

Referenced by Clone(), gdcm::JPEG2000Codec::Clone(), gdcm::JPEGCodec::Clone(), gdcm::JPEGLSCodec::Clone(), gdcm::KAKADUCodec::Clone(), gdcm::PGXCodec::Clone(), gdcm::PNMCodec::Clone(), gdcm::PVRGCodec::Clone(), gdcm::RAWCodec::Clone(), and gdcm::RLECodec::Clone().

## ◆ ~ImageCodec()

gdcm::ImageCodec::~ImageCodec | ( |  | ) |
| override

## Member Function Documentation

## ◆ AppendFrameEncode()

virtual bool gdcm::ImageCodec::AppendFrameEncode | ( | std::ostream & | out,
|  | const char * | data,
|  | size_t | datalen )
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## ◆ AppendRowEncode()

virtual bool gdcm::ImageCodec::AppendRowEncode | ( | std::ostream & | out,
|  | const char * | data,
|  | size_t | datalen )
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## ◆ CanCode()

bool gdcm::ImageCodec::CanCode | ( | TransferSyntax const & |  | ) | const
| inlineoverridevirtual

Return whether this coder support this transfer syntax (can code it).

Implements gdcm::Coder.

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, gdcm::KAKADUCodec, gdcm::PGXCodec, gdcm::PNMCodec, gdcm::PVRGCodec, gdcm::RAWCodec, and gdcm::RLECodec.

## ◆ CanDecode()

bool gdcm::ImageCodec::CanDecode | ( | TransferSyntax const & |  | ) | const
| inlineoverridevirtual

Return whether this decoder support this transfer syntax (can decode it).

Implements gdcm::Decoder.

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, gdcm::KAKADUCodec, gdcm::PGXCodec, gdcm::PNMCodec, gdcm::PVRGCodec, gdcm::RAWCodec, and gdcm::RLECodec.

## ◆ CleanupUnusedBits()

bool gdcm::ImageCodec::CleanupUnusedBits | ( | char * | data,
|  | size_t | datalen )

## ◆ Clone()

virtual ImageCodec * gdcm::ImageCodec::Clone | ( |  | ) | const
| pure virtual

Implemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, gdcm::KAKADUCodec, gdcm::PGXCodec, gdcm::PNMCodec, gdcm::PVRGCodec, gdcm::RAWCodec, and gdcm::RLECodec.

References ImageCodec().

## ◆ Decode()

bool gdcm::ImageCodec::Decode | ( | DataElement const & | ,
|  | DataElement & | )
| overridevirtual

Decode.

Reimplemented from gdcm::Decoder.

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, gdcm::KAKADUCodec, gdcm::PVRGCodec, gdcm::RAWCodec, and gdcm::RLECodec.

## ◆ DecodeByStreams()

bool gdcm::ImageCodec::DecodeByStreams | ( | std::istream & | is_,
|  | std::ostream & | os )
| overrideprotectedvirtual

Reimplemented from gdcm::Decoder.

Reimplemented in gdcm::JPEG12Codec, gdcm::JPEG16Codec, gdcm::JPEG2000Codec, gdcm::JPEG8Codec, gdcm::JPEGCodec, gdcm::JPEGTurboCodec, gdcm::RAWCodec, and gdcm::RLECodec.

## ◆ DoByteSwap()

bool gdcm::ImageCodec::DoByteSwap | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoInvertMonochrome()

bool gdcm::ImageCodec::DoInvertMonochrome | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoOverlayCleanup()

bool gdcm::ImageCodec::DoOverlayCleanup | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoPaddedCompositePixelCode()

bool gdcm::ImageCodec::DoPaddedCompositePixelCode | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoPlanarConfiguration()

bool gdcm::ImageCodec::DoPlanarConfiguration | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoSimpleCopy()

bool gdcm::ImageCodec::DoSimpleCopy | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoYBR()

bool gdcm::ImageCodec::DoYBR | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ DoYBRFull422()

bool gdcm::ImageCodec::DoYBRFull422 | ( | std::istream & | is_,
|  | std::ostream & | os )
| protected

## ◆ GetDimensions()

const unsigned int * gdcm::ImageCodec::GetDimensions | ( |  | ) | const
| inline

References Dimensions.

## ◆ GetHeaderInfo()

virtual bool gdcm::ImageCodec::GetHeaderInfo | ( | std::istream & | is_,
|  | TransferSyntax & | ts )
| virtual

Reimplemented in gdcm::JPEG12Codec, gdcm::JPEG16Codec, gdcm::JPEG2000Codec, gdcm::JPEG8Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, gdcm::JPEGTurboCodec, gdcm::PGXCodec, gdcm::PNMCodec, gdcm::RAWCodec, and gdcm::RLECodec.

## ◆ GetLossyFlag()

bool gdcm::ImageCodec::GetLossyFlag | ( |  | ) | const

## ◆ GetLUT()

const LookupTable & gdcm::ImageCodec::GetLUT | ( |  | ) | const
| inline

References LUT.

## ◆ GetNeedByteSwap()

bool gdcm::ImageCodec::GetNeedByteSwap | ( |  | ) | const
| inline

References NeedByteSwap.

## ◆ GetNumberOfDimensions()

unsigned int gdcm::ImageCodec::GetNumberOfDimensions | ( |  | ) | const

## ◆ GetPhotometricInterpretation()

const PhotometricInterpretation & gdcm::ImageCodec::GetPhotometricInterpretation | ( |  | ) | const

## ◆ GetPixelFormat() [1/2]

PixelFormat & gdcm::ImageCodec::GetPixelFormat | ( |  | ) |
| inline

Examples
  GetJPEGSamplePrecision.cxx.

References PF.

## ◆ GetPixelFormat() [2/2]

const PixelFormat & gdcm::ImageCodec::GetPixelFormat | ( |  | ) | const
| inline

References PF.

## ◆ GetPlanarConfiguration()

unsigned int gdcm::ImageCodec::GetPlanarConfiguration | ( |  | ) | const
| inline

References PlanarConfiguration.

## ◆ IsFrameEncoder()

virtual bool gdcm::ImageCodec::IsFrameEncoder | ( |  | ) |
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## ◆ IsLossy()

bool gdcm::ImageCodec::IsLossy | ( |  | ) | const

## ◆ IsRowEncoder()

virtual bool gdcm::ImageCodec::IsRowEncoder | ( |  | ) |
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## ◆ IsValid()

virtual bool gdcm::ImageCodec::IsValid | ( | PhotometricInterpretation const & | pi | ) |
| protectedvirtual

Reimplemented in gdcm::JPEGCodec.

## ◆ SetDimensions() [1/2]

void gdcm::ImageCodec::SetDimensions | ( | const std::vector< unsigned int > & | d | ) |

## ◆ SetDimensions() [2/2]

void gdcm::ImageCodec::SetDimensions | ( | const unsigned int | d[3] | ) |

Examples
  ExtractIconFromFile.cxx.

## ◆ SetLossyFlag()

void gdcm::ImageCodec::SetLossyFlag | ( | bool | l | ) |

## ◆ SetLUT()

void gdcm::ImageCodec::SetLUT | ( | LookupTable const & | lut | ) |
| inline

Examples
  ExtractIconFromFile.cxx.

References LUT.

## ◆ SetNeedByteSwap()

void gdcm::ImageCodec::SetNeedByteSwap | ( | bool | b | ) |
| inline

References NeedByteSwap.

## ◆ SetNeedOverlayCleanup()

void gdcm::ImageCodec::SetNeedOverlayCleanup | ( | bool | b | ) |
| inline

References NeedOverlayCleanup.

## ◆ SetNumberOfDimensions()

void gdcm::ImageCodec::SetNumberOfDimensions | ( | unsigned int | dim | ) |

## ◆ SetPhotometricInterpretation()

void gdcm::ImageCodec::SetPhotometricInterpretation | ( | PhotometricInterpretation const & | pi | ) |

Examples
  ExtractIconFromFile.cxx.

## ◆ SetPixelFormat()

virtual void gdcm::ImageCodec::SetPixelFormat | ( | PixelFormat const & | pf | ) |
| inlinevirtual

Reimplemented in gdcm::JPEGCodec.

Examples
  ExtractIconFromFile.cxx.

References PF.

## ◆ SetPlanarConfiguration()

void gdcm::ImageCodec::SetPlanarConfiguration | ( | unsigned int | pc | ) |
| inline

References gdcm_assert, and PlanarConfiguration.

## ◆ StartEncode()

virtual bool gdcm::ImageCodec::StartEncode | ( | std::ostream & | os | ) |
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## ◆ StopEncode()

virtual bool gdcm::ImageCodec::StopEncode | ( | std::ostream & | os | ) |
| protectedvirtual

Reimplemented in gdcm::JPEG2000Codec, gdcm::JPEGCodec, gdcm::JPEGLSCodec, and gdcm::RLECodec.

## Friends And Related Symbol Documentation

## ◆ FileChangeTransferSyntax

friend class FileChangeTransferSyntax
| friend

This is a high level API to encode in a streaming fashion. Each plugin will handle differently the caching mechanism so that a limited memory is used when compressing dataset. Codec will fall into two categories:

- Full row encoder: only a single scanline (row) of data is needed to be loaded at a time;
- Full frame encoder (default): a complete frame (row x col) is needed to be loaded at a time

References FileChangeTransferSyntax.

Referenced by FileChangeTransferSyntax.

## ◆ ImageChangePhotometricInterpretation

friend class ImageChangePhotometricInterpretation
| friend

References ImageChangePhotometricInterpretation.

Referenced by ImageChangePhotometricInterpretation.

## Member Data Documentation

## ◆ Dimensions

unsigned int gdcm::ImageCodec::Dimensions[3]
| protected

Referenced by GetDimensions().

## ◆ LossyFlag

bool gdcm::ImageCodec::LossyFlag
| protected

## ◆ LUT

LUTPtr gdcm::ImageCodec::LUT
| protected

Referenced by GetLUT(), and SetLUT().

## ◆ NeedByteSwap

bool gdcm::ImageCodec::NeedByteSwap
| protected

Referenced by GetNeedByteSwap(), and SetNeedByteSwap().

## ◆ NeedOverlayCleanup

bool gdcm::ImageCodec::NeedOverlayCleanup
| protected

Referenced by SetNeedOverlayCleanup().

## ◆ NumberOfDimensions

unsigned int gdcm::ImageCodec::NumberOfDimensions
| protected

## ◆ PF

PixelFormat gdcm::ImageCodec::PF
| protected

Referenced by GetPixelFormat(), GetPixelFormat(), and SetPixelFormat().

## ◆ PI

PhotometricInterpretation gdcm::ImageCodec::PI
| protected

## ◆ PlanarConfiguration

unsigned int gdcm::ImageCodec::PlanarConfiguration
| protected

Referenced by GetPlanarConfiguration(), and SetPlanarConfiguration().

## ◆ RequestPaddedCompositePixelCode

bool gdcm::ImageCodec::RequestPaddedCompositePixelCode
| protected

## ◆ RequestPlanarConfiguration

bool gdcm::ImageCodec::RequestPlanarConfiguration
| protected

The documentation for this class was generated from the following file:

- gdcmImageCodec.h