DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmRLEDecoder Class Reference

this class implements an RLE decompressor conforming to the DICOM standard. More...

## Public Member Functions
| DcmRLEDecoder (size_t outputBufferSize)
| constructor More...
| ~DcmRLEDecoder ()
| destructor
void | clear ()
| resets the decoder object to newly constructed state. More...
size_t | size () const
| returns the number of bytes written to the output buffer More...
void * | getOutputBuffer () const
| returns pointer to the output buffer
OFBool | fail () const
| returns true if the RLE compressor has failed (out of memory or output buffer too small).

## Private Member Functions
| DcmRLEDecoder (const DcmRLEDecoder &)
| private undefined copy constructor
DcmRLEDecoder & | operator= (const DcmRLEDecoder &)
| private undefined copy assignment operator
void | replicate (unsigned char ch, unsigned char nbytes)
| this method expands a replicate run More...
void | literal (unsigned char *cp, unsigned char nbytes)
| this method expands a literal run More...

## Private Attributes
int | fail_
| this flag indicates a failure of the RLE codec. More...
size_t | outputBufferSize_
| size of output buffer, in bytes
unsigned char * | outputBuffer_
| this member points to a block of size outputBufferSize_ (unless fail_ is true). More...
size_t | offset_
| contains the number of bytes already written to outputBuffer_. More...
unsigned char | suspendInfo_
| contains suspension information. More...

## Detailed Description

this class implements an RLE decompressor conforming to the DICOM standard.

The class is loosely based on an implementation by Phil Norman forre.nosp@m.y@eh.nosp@m..org

## Constructor & Destructor Documentation

## ◆ DcmRLEDecoder()

DcmRLEDecoder::DcmRLEDecoder | ( | size_t | outputBufferSize | ) |
| inline

constructor

Parameters

  outputBufferSize | size of the output buffer (in bytes) to which the RLE codec will write decompressed output.

## Member Function Documentation

## ◆ clear()

void DcmRLEDecoder::clear | ( |  | ) |
| inline

resets the decoder object to newly constructed state.

The size and location of the output buffer is not changed.

## ◆ literal()

void DcmRLEDecoder::literal | ( | unsigned char * | cp,
|  | unsigned char | nbytes
| ) |  |
| inline private

this method expands a literal run

Parameters

  cp | pointer to buffer
  nbytes | number of bytes in buffer

## ◆ replicate()

void DcmRLEDecoder::replicate | ( | unsigned char | ch,
|  | unsigned char | nbytes
| ) |  |
| inline private

this method expands a replicate run

Parameters

  ch | value to replicate
  nbytes | number of repetitions

## ◆ size()

size_t DcmRLEDecoder::size | ( |  | ) | const
| inline

returns the number of bytes written to the output buffer

Returns
  size of decompressed stream, in bytes

## Member Data Documentation

## ◆ fail_

int DcmRLEDecoder::fail_
| private

this flag indicates a failure of the RLE codec.

Once a failure is flagged, the codec will consume all input and not produce any more output.

## ◆ offset_

size_t DcmRLEDecoder::offset_
| private

contains the number of bytes already written to outputBuffer_.

Value is always less or equal to outputBufferSize_.

## ◆ outputBuffer_

unsigned char* DcmRLEDecoder::outputBuffer_
| private

this member points to a block of size outputBufferSize_ (unless fail_ is true).

This is the block of data to which the decompressed stream is written

## ◆ suspendInfo_

unsigned char DcmRLEDecoder::suspendInfo_
| private

contains suspension information.

If not suspended, contains 128. If suspended during a replicate run, contains control byte of repeat run (> 128). If suspended during a literal run, contains number of remaining bytes in literal run minus 1 (< 128).

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

- dcmdata/include/dcmtk/dcmdata/dcrledec.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1