DCMTK Version 3.7.0 OFFIS DICOM Toolkit

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

this class encapsulates the compression routines of the IJG JPEG library configured for 8 bits/sample. More...

Inheritance diagram for DJCompressIJG8Bit:

## Public Member Functions
| DJCompressIJG8Bit (const DJCodecParameter &cp, EJ_Mode mode, Uint8 quality)
| constructor for lossy JPEG More...
| DJCompressIJG8Bit (const DJCodecParameter &cp, EJ_Mode mode, int prediction, int ptrans)
| constructor for lossless JPEG More...
virtual | ~DJCompressIJG8Bit ()
| destructor
virtual OFCondition | encode (Uint16 columns, Uint16 rows, EP_Interpretation interpr, Uint16 samplesPerPixel, Uint16 *image_buffer, Uint8 *&to, Uint32 &length)
| single frame compression routine for 16-bit raw pixel data. More...
virtual OFCondition | encode (Uint16 columns, Uint16 rows, EP_Interpretation interpr, Uint16 samplesPerPixel, Uint8 *image_buffer, Uint8 *&to, Uint32 &length)
| single frame compression routine for 8-bit raw pixel data. More...
virtual Uint16 | bytesPerSample () const
| returns the number of bytes per sample that will be expected when encoding.
virtual Uint16 | bitsPerSample () const
| returns the number of bits per sample that will be expected when encoding.
void | initDestination (dcmtk_jpeg8_compress_struct *cinfo)
| callback for IJG compress destination manager. More...
int | emptyOutputBuffer (dcmtk_jpeg8_compress_struct *cinfo)
| callback for IJG compress destination manager. More...
void | termDestination (dcmtk_jpeg8_compress_struct *cinfo)
| callback for IJG compress destination manager. More...
virtual void | emitMessage (void *arg, int msg_level) const
| callback function used to report warning messages and the like. More...
Public Member Functions inherited from DJEncoder
| DJEncoder ()
| default constructor
virtual | ~DJEncoder ()
| destructor

## Private Member Functions
| DJCompressIJG8Bit (const DJCompressIJG8Bit &)
| private undefined copy constructor
DJCompressIJG8Bit & | operator= (const DJCompressIJG8Bit &)
| private undefined copy assignment operator
void | cleanup ()
| cleans up pixelDataList, called from destructor and error handlers

## Private Attributes
const DJCodecParameter * | cparam
| codec parameters
Uint8 | quality
| for lossy compression, defines compression quality factor
int | psv
| for lossless compression, defines selection value
int | pt
| for lossless compression, defines point transform
EJ_Mode | modeofOperation
| enum for mode of operation (baseline, sequential, progressive etc.)
OFList< unsigned char * > | pixelDataList
| list of compressed pixel data blocks
size_t | bytesInLastBlock
| filled number of bytes in last block in pixelDataList

## Detailed Description

this class encapsulates the compression routines of the IJG JPEG library configured for 8 bits/sample.

## Constructor & Destructor Documentation

## ◆ DJCompressIJG8Bit() [1/2]

DJCompressIJG8Bit::DJCompressIJG8Bit | ( | const DJCodecParameter & | cp,
|  | EJ_Mode | mode,
|  | Uint8 | quality
| ) |  |

constructor for lossy JPEG

Parameters

  cp | codec parameters
  mode | mode of operation
  quality | compression quality

## ◆ DJCompressIJG8Bit() [2/2]

DJCompressIJG8Bit::DJCompressIJG8Bit | ( | const DJCodecParameter & | cp,
|  | EJ_Mode | mode,
|  | int | prediction,
|  | int | ptrans
| ) |  |

constructor for lossless JPEG

Parameters

  cp | codec parameters
  prediction | predictor
  ptrans | point transform

## Member Function Documentation

## ◆ emitMessage()

virtual void DJCompressIJG8Bit::emitMessage | ( | void * | arg,
|  | int | msg_level
| ) |  | const
| virtual

callback function used to report warning messages and the like.

Should not be called by user code directly.

Parameters

  arg | opaque pointer to JPEG compress structure
  msg_level | -1 for warnings, 0 and above for trace messages

## ◆ emptyOutputBuffer()

int DJCompressIJG8Bit::emptyOutputBuffer | ( | dcmtk_jpeg8_compress_struct * | cinfo | ) |

callback for IJG compress destination manager.

Internal use only, not to be called by client code.

Parameters

  cinfo | pointer to compress info

## ◆ encode() [1/2]

virtual OFCondition DJCompressIJG8Bit::encode | ( | Uint16 | columns,
|  | Uint16 | rows,
|  | EP_Interpretation | interpr,
|  | Uint16 | samplesPerPixel,
|  | Uint16 * | image_buffer,
|  | Uint8 *& | to,
|  | Uint32 & | length
| ) |  |
| virtual

single frame compression routine for 16-bit raw pixel data.

May only be called if bytesPerSample() == 2.

Parameters

  columns | columns of frame
  rows | rows of frame
  interpr | photometric interpretation of input frame
  samplesPerPixel | samples per pixel of input frame
  image_buffer | pointer to frame buffer
  to | compressed frame returned in this parameter upon success
  length | length of compressed frame (in bytes) returned in this parameter upon success; length guaranteed to be always even.

Returns
  EC_Normal if successful, an error code otherwise.

Implements DJEncoder.

## ◆ encode() [2/2]

virtual OFCondition DJCompressIJG8Bit::encode | ( | Uint16 | columns,
|  | Uint16 | rows,
|  | EP_Interpretation | interpr,
|  | Uint16 | samplesPerPixel,
|  | Uint8 * | image_buffer,
|  | Uint8 *& | to,
|  | Uint32 & | length
| ) |  |
| virtual

single frame compression routine for 8-bit raw pixel data.

May only be called if bytesPerSample() == 1.

Parameters

  columns | columns of frame
  rows | rows of frame
  interpr | photometric interpretation of input frame
  samplesPerPixel | samples per pixel of input frame
  image_buffer | pointer to frame buffer
  to | compressed frame returned in this parameter upon success
  length | length of compressed frame (in bytes) returned in this parameter upon success; length guaranteed to be always even.

Returns
  EC_Normal if successful, an error code otherwise.

Implements DJEncoder.

## ◆ initDestination()

void DJCompressIJG8Bit::initDestination | ( | dcmtk_jpeg8_compress_struct * | cinfo | ) |

callback for IJG compress destination manager.

Internal use only, not to be called by client code.

Parameters

  cinfo | pointer to compress info

## ◆ termDestination()

void DJCompressIJG8Bit::termDestination | ( | dcmtk_jpeg8_compress_struct * | cinfo | ) |

callback for IJG compress destination manager.

Internal use only, not to be called by client code.

Parameters

  cinfo | pointer to compress info

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

- dcmjpeg/include/dcmtk/dcmjpeg/djeijg8.h

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