# gdcm::JPEGCodec Class Reference

JPEG codec Class to do JPEG (8bits, 12bits, 16bits lossy & lossless). It redispatch in between the different codec implementation: gdcm::JPEG8Codec, gdcm::JPEG12Codec & gdcm::JPEG16Codec It also support inconsistency in between DICOM header and JPEG compressed stream ImageCodec implementation for the JPEG case. More...

`#include <gdcmJPEGCodec.h>`

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

List of all members.

## Public Member Functions

| JPEGCodec ()
| ~JPEGCodec ()
bool | CanCode (TransferSyntax const &ts) const
| Return whether this coder support this transfer syntax (can code it)
bool | CanDecode (TransferSyntax const &ts) const
| Return whether this decoder support this transfer syntax (can decode it)
bool | Code (DataElement const &in, DataElement &out)
| Compress into JPEG.
void | ComputeOffsetTable (bool b)
| Compute the offset table:
bool | Decode (DataElement const &is, DataElement &os)
| Decode.
virtual bool | GetHeaderInfo (std::istream &is, TransferSyntax &ts)
bool | GetLossless () const
double | GetQuality () const
void | SetLossless (bool l)
void | SetPixelFormat (PixelFormat const &pf)
void | SetQuality (double q)

## Protected Member Functions

bool | Decode (std::istream &is, std::ostream &os)
bool | IsValid (PhotometricInterpretation const &pi)
void | SetBitSample (int bit)

## Protected Attributes

int | BitSample
bool | Lossless
int | Quality

## Detailed Description

JPEG codec Class to do JPEG (8bits, 12bits, 16bits lossy & lossless). It redispatch in between the different codec implementation: gdcm::JPEG8Codec, gdcm::JPEG12Codec & gdcm::JPEG16Codec It also support inconsistency in between DICOM header and JPEG compressed stream ImageCodec implementation for the JPEG case.

Note:
  Things you should know if you ever want to dive into DICOM/JPEG world (among other):

- http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/625e46919f2080e1
- http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/75fdfccc65a6243
- http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/2d525ef6a2f093ed
- http://groups.google.com/group/comp.protocols.dicom/browse_thread/thread/6b93af410f8c921f

Examples:

  GetJPEGSamplePrecision.cxx.

## Constructor & Destructor Documentation

gdcm::JPEGCodec::JPEGCodec | ( |  | ) |

gdcm::JPEGCodec::~JPEGCodec | ( |  | ) |

## Member Function Documentation

bool gdcm::JPEGCodec::CanCode | ( | TransferSyntax const & |  | ) | const`[virtual]`

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

Reimplemented from gdcm::ImageCodec.

bool gdcm::JPEGCodec::CanDecode | ( | TransferSyntax const & |  | ) | const`[virtual]`

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

Reimplemented from gdcm::ImageCodec.

bool gdcm::JPEGCodec::Code | ( | DataElement const & | in,
|  | DataElement & | out
| ) |  | `[virtual]`

Compress into JPEG.

Reimplemented from gdcm::Coder.

void gdcm::JPEGCodec::ComputeOffsetTable | ( | bool | b | ) |

Compute the offset table:

bool gdcm::JPEGCodec::Decode | ( | DataElement const & | is_,
|  | DataElement & | os
| ) |  | `[virtual]`

Decode.

Reimplemented from gdcm::ImageCodec.

bool gdcm::JPEGCodec::Decode | ( | std::istream & | is,
|  | std::ostream & | os
| ) |  | `[protected, virtual]`

Reimplemented from gdcm::ImageCodec.

Reimplemented in gdcm::JPEG12Codec, gdcm::JPEG16Codec, and gdcm::JPEG8Codec.

virtual bool gdcm::JPEGCodec::GetHeaderInfo | ( | std::istream & | is,
|  | TransferSyntax & | ts
| ) |  | `[virtual]`

Reimplemented from gdcm::ImageCodec.

Reimplemented in gdcm::JPEG12Codec, gdcm::JPEG16Codec, and gdcm::JPEG8Codec.

Examples:
  GetJPEGSamplePrecision.cxx.

bool gdcm::JPEGCodec::GetLossless | ( |  | ) | const

double gdcm::JPEGCodec::GetQuality | ( |  | ) | const

bool gdcm::JPEGCodec::IsValid | ( | PhotometricInterpretation const & | pi | ) | `[protected, virtual]`

Reimplemented from gdcm::ImageCodec.

void gdcm::JPEGCodec::SetBitSample | ( | int | bit | ) | `[protected]`

void gdcm::JPEGCodec::SetLossless | ( | bool | l | ) |

void gdcm::JPEGCodec::SetPixelFormat | ( | PixelFormat const & | pf | ) | `[virtual]`

Reimplemented from gdcm::ImageCodec.

Examples:
  GetJPEGSamplePrecision.cxx.

void gdcm::JPEGCodec::SetQuality | ( | double | q | ) |

## Member Data Documentation

int gdcm::JPEGCodec::BitSample `[protected]`

bool gdcm::JPEGCodec::Lossless `[protected]`

int gdcm::JPEGCodec::Quality `[protected]`

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

- gdcmJPEGCodec.h