![]() |
iipsrv 1.3
iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images
|
Base class for IIP output images. More...
#include <Compressor.h>
Public Member Functions | |
| Compressor (int compressionLevel) | |
| Constructor. | |
| unsigned int | getHeaderSize () const |
| Return the image header size. | |
| unsigned char * | getHeader () |
| Return a pointer to the image header itself. | |
| int | getQuality () const |
| Get the current quality level. | |
| bool | defaultQuality () const |
| Check whether we are using the default or whether user has requested a specific quality level. | |
| void | setResolution (float x, float y, int units) |
| Set the physical output resolution. | |
| void | embedICCProfile (const bool embed) |
| Embed ICC profile. | |
| void | embedXMPMetadata (const bool embed) |
| Embed XMP metadata. | |
| void | embedExifMetadata (const bool embed) |
| Embed EXIF metadata. | |
| void | setMetadata (const std::map< const std::string, const std::string > &metadata) |
| Set general metadata. | |
| virtual void | setQuality (int quality) |
| Set quality level. | |
| 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 const char * | getMimeType () const |
| Get mime type. | |
| virtual const char * | getSuffix () const |
| Get file suffix. | |
| virtual ImageEncoding | getImageEncoding () const |
| Get compression type. | |
| virtual void | injectMetadata (RawTile &t) |
| Inject metadata into raw bitstream. | |
Protected Member Functions | |
| virtual void | writeMetadata () |
| Write metadata. | |
| virtual void | writeResolution () |
| Write DPI. | |
| virtual void | writeICCProfile () |
| Write ICC profile. | |
| virtual void | writeXMPMetadata () |
| Write XMP metadata. | |
| virtual void | writeExifMetadata () |
| Write EXIF metadata. | |
Protected Attributes | |
| int | Q |
| Quality or compression level for all image types. | |
| bool | default_quality |
| Whether compression level is default or has been set manually. | |
| unsigned char * | header |
| Pointer to the header data for the output image. | |
| unsigned int | header_size |
| Size of the header data. | |
| int | dpi_units |
| Physical resolution units: 0 for unknown, 1 for dots/inch or 2 for dots/cm. | |
| float | dpi_x |
| Physical resolution (pixels per physical unit) for X direction. | |
| float | dpi_y |
| Physical resolution (pixels per phyisical unit) in Y direction. | |
| std::map< const std::string, const std::string > | metadata |
| Metadata. | |
| std::string | icc |
| ICC Profile. | |
| bool | embedICC |
| Whether ICC profile should be embedded. | |
| std::string | xmp |
| XMP metadata. | |
| bool | embedXMP |
| Whether XMP metadata should be embedded. | |
| std::string | exif |
| EXIF metadata. | |
| bool | embedEXIF |
| Whether EXIF metadata should be embedded. | |
Base class for IIP output images.
|
inline |
Constructor.
| compressionLevel | default compression level for codec |
|
inlinevirtual |
Compress an entire buffer of image data at once in one command.
| t | tile of image data |
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by TileManager::getTile(), and JTL::send().
|
inlinevirtual |
Compress a strip of image data.
| s | source image data |
| o | output buffer |
| tile_height | pixel height of the tile we are compressing |
Reimplemented in JPEGCompressor, AVIFCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by CVT::send().
|
inline |
Embed EXIF metadata.
| embed | Whether EXIF metadata should be embedded |
Referenced by CVT::send().
|
inline |
Embed ICC profile.
| embed | Whether ICC profile should be embedded |
Referenced by CVT::send(), and JTL::send().
|
inline |
Embed XMP metadata.
| embed | Whether XMP metadata should be embedded |
Referenced by CVT::send().
|
inlinevirtual |
Finish the strip based compression and free memory.
| output | output buffer |
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by CVT::send().
|
inline |
Return a pointer to the image header itself.
References header.
Referenced by JPEGCompressor::injectMetadata(), and CVT::send().
|
inline |
Return the image header size.
References header_size.
Referenced by JPEGCompressor::injectMetadata(), and CVT::send().
|
inlinevirtual |
Get compression type.
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
|
inlinevirtual |
Get mime type.
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by CVT::send(), and JTL::send().
|
inlinevirtual |
Get file suffix.
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by CVT::send().
|
inlinevirtual |
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
| rawtile | tile containing the image to be compressed |
| strip_height | pixel height of the strip we want to compress |
Reimplemented in AVIFCompressor, JPEGCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.
Referenced by CVT::send().
|
inlinevirtual |
Inject metadata into raw bitstream.
| t | image tile containing raw bitstream |
Reimplemented in JPEGCompressor, and WebPCompressor.
|
inline |
Set general metadata.
| metadata | Metadata list |
References exif, icc, metadata, and xmp.
Referenced by CVT::send(), and JTL::send().
|
inlinevirtual |
Set quality level.
| quality | quality level |
Reimplemented in JPEGCompressor, AVIFCompressor, PNGCompressor, TIFFCompressor, and WebPCompressor.