Compressor Class Reference

Base class for IIP output images. More...

`#include <Compressor.h>`

Inheritance diagram for Compressor:

## Public Member Functions

int | getQuality ()
| Get the current quality level.
void | setICCProfile (const std::string &profile)
| Set the ICC profile.
void | setXMPMetadata (const std::string &x)
| Set XMP metadata.
virtual unsigned int | getHeaderSize ()
| Return the image header size.
virtual unsigned char * | getHeader ()
| Return a pointer to the image header itself.
virtual void | InitCompression (const RawTile &rawtile, unsigned int strip_height)
| Initialise strip based compression.
virtual unsigned int | CompressStrip (unsigned char *s, unsigned char *o, unsigned int tile_height)
| Compress a strip of image data.
virtual unsigned int | Finish (unsigned char *output)
| Finish the strip based compression and free memory.
virtual unsigned int | Compress (RawTile &t)
| Compress an entire buffer of image data at once in one command.
virtual void | addXMPMetadata (const std::string &m)
| Add metadata to the image header.
virtual const char * | getMimeType ()
| Get mime type.
virtual const char * | getSuffix ()
| Get file suffix.

## Protected Member Functions

virtual void | writeICCProfile ()
| Write ICC profile.
virtual void | writeXMPMetadata ()
| Write XMP metadata.

## Protected Attributes

int | Q
| Quality level.
std::string | icc
| ICC Profile.
std::string | xmp
| XMP metadata.

## Detailed Description

Base class for IIP output images.

## Member Function Documentation

## addXMPMetadata()

virtual void Compressor::addXMPMetadata | ( | const std::string & | m | ) |

inline virtual

Add metadata to the image header.

Parameters

  m | metadata

## Compress()

virtual unsigned int Compressor::Compress | ( | RawTile & | t | ) |

inline virtual

Compress an entire buffer of image data at once in one command.

Parameters

  t | tile of image data

Returns
  number of bytes used

Reimplemented in JPEGCompressor.

## CompressStrip()

virtual unsigned int Compressor::CompressStrip | ( | unsigned char * | s,
|  | unsigned char * | o,
|  | unsigned int | tile_height )

inline virtual

Compress a strip of image data.

Parameters

  s | source image data
  o | output buffer
  tile_height | pixel height of the tile we are compressing

Returns
  number of bytes used for strip

Reimplemented in JPEGCompressor.

## Finish()

virtual unsigned int Compressor::Finish | ( | unsigned char * | output | ) |

inline virtual

Finish the strip based compression and free memory.

Parameters

  output | output buffer

Returns
  size of output generated in bytes

Reimplemented in JPEGCompressor.

## getHeader()

virtual unsigned char * Compressor::getHeader | ( |  | ) |

inline virtual

Return a pointer to the image header itself.

Returns
  binary header blob

Reimplemented in JPEGCompressor.

## getHeaderSize()

virtual unsigned int Compressor::getHeaderSize | ( |  | ) |

inline virtual

Return the image header size.

Returns
  header size in bytes

Reimplemented in JPEGCompressor.

## getMimeType()

virtual const char * Compressor::getMimeType | ( |  | ) |

inline virtual

Get mime type.

Returns
  IANA mime type as const char*

Reimplemented in JPEGCompressor.

## getSuffix()

virtual const char * Compressor::getSuffix | ( |  | ) |

inline virtual

Get file suffix.

Returns
  suffix as const char*

Reimplemented in JPEGCompressor.

## InitCompression()

virtual void Compressor::InitCompression | ( | const RawTile & | rawtile,
|  | unsigned int | strip_height )

inline virtual

Initialise strip based compression.

If we are doing a strip based encoding, we need to first initialise with InitCompression, then compress a single strip at a time using CompressStrip and finally clean up using Finish

Parameters

  rawtile | tile containing the image to be compressed
  strip_height | pixel height of the strip we want to compress

Reimplemented in JPEGCompressor.

## setICCProfile()

void Compressor::setICCProfile | ( | const std::string & | profile | ) |

inline

Set the ICC profile.

Parameters

  profile | ICC profile string

References icc.

## setXMPMetadata()

void Compressor::setXMPMetadata | ( | const std::string & | x | ) |

inline

Set XMP metadata.

Parameters

  x | XMP metadata string

References xmp.

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

- Compressor.h