![]() |
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
|
TIFF encoder class. More...
#include <TIFFCompressor.h>
Public Member Functions | |
| TIFFCompressor (int compression, int quality) | |
| Constructor. | |
| void | setCompression (int compression) |
| Set compression type: 0: None, 1: LZW, 2: Deflate, 3: JPEG, 4: WebP, 5: ZStandard. | |
| void | setQuality (int quality) |
| Set the compression level. | |
| void | InitCompression (const RawTile &rawtile, unsigned int strip_height) |
| Initialize strip based compression. | |
| unsigned int | CompressStrip (unsigned char *source, unsigned char *output, unsigned int tile_height) |
| Compress a strip of image data. | |
| unsigned int | Finish (unsigned char *output) |
| Finish the strip based compression and free memory. | |
| unsigned int | Compress (RawTile &t) |
| Compress an entire buffer of image data at once in one command. | |
| const char * | getMimeType () const |
| Return the TIFF mime type. | |
| const char * | getSuffix () const |
| Return the image filename suffix. | |
| ImageEncoding | getImageEncoding () const |
| Get compression type. | |
Public Member Functions inherited from Compressor | |
| 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 | injectMetadata (RawTile &t) |
| Inject metadata into raw bitstream. | |
Static Public Member Functions | |
| static std::string | getCompressionName (int code) |
| Static utility function to get compression in human-readable form. | |
Additional Inherited Members | |
Protected Member Functions inherited from Compressor | |
| virtual void | writeExifMetadata () |
| Write EXIF metadata. | |
Protected Attributes inherited from Compressor | |
| 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. | |
TIFF encoder class.
|
inline |
Constructor.
| compression | compression (encoding) type: 0: None, 1: LZW, 2: Deflate, 3: JPEG, 4: WebP, 5: ZStandard |
| quality | compression level |
References Compressor::Q, and setCompression().
|
virtual |
Compress an entire buffer of image data at once in one command.
| t | tile of image data |
Reimplemented from Compressor.
References RawTile::allocate(), RawTile::bpc, tiff_mem::buffer, RawTile::capacity, tiff_mem::capacity, RawTile::channels, RawTile::compressionType, tiff_mem::current, RawTile::data, RawTile::dataLength, RawTile::deallocate(), tiff_mem::end, RawTile::height, Compressor::icc, RawTile::memoryManaged, Compressor::Q, RawTile::quality, RawTile::width, and Compressor::xmp.
|
virtual |
Compress a strip of image data.
| source | source image data |
| tile_height | pixel height of the tile we are compressing |
| output | output_buffer |
Reimplemented from Compressor.
References tiff_mem::buffer, and tiff_mem::end.
|
virtual |
Finish the strip based compression and free memory.
| output | Output buffer |
Reimplemented from Compressor.
References tiff_mem::buffer, and tiff_mem::end.
|
inlinestatic |
Static utility function to get compression in human-readable form.
| code | compression code |
Referenced by QLT::run().
|
inlinevirtual |
Get compression type.
Reimplemented from Compressor.
|
inlinevirtual |
Return the TIFF mime type.
Reimplemented from Compressor.
|
inlinevirtual |
Return the image filename suffix.
Reimplemented from Compressor.
|
virtual |
Initialize strip based compression.
For strip based encoding, we need to first initialize with InitCompression, then compress a single strip at a time using CompressStrip and finally clean up using Finish
| rawtile | RawTile object containing the image to be compressed |
| strip_height | height in pixels of the strip we want to compress |
Reimplemented from Compressor.
References RawTile::bpc, tiff_mem::buffer, tiff_mem::capacity, RawTile::channels, tiff_mem::current, RawTile::data, RawTile::dataLength, tiff_mem::end, RawTile::height, Compressor::icc, RawTile::width, and Compressor::xmp.
|
inline |
Set compression type: 0: None, 1: LZW, 2: Deflate, 3: JPEG, 4: WebP, 5: ZStandard.
| compression | compression type |
Referenced by QLT::run(), and TIFFCompressor().
|
inlinevirtual |
Set the compression level.
| quality | compression level for JPEG or WebP (both 0-100) |
Reimplemented from Compressor.
References Compressor::default_quality, and Compressor::Q.
Referenced by QLT::run().