![]() |
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
|
Wrapper class to the IJG JPEG library. More...
#include <JPEGCompressor.h>
Public Member Functions | |
| JPEGCompressor (int quality) | |
| Constructor. | |
| void | setQuality (int factor) |
| Set the compression quality. | |
| void | InitCompression (const RawTile &rawtile, unsigned int strip_height) |
| Initialise strip based compression. | |
| unsigned int | CompressStrip (unsigned char *s, unsigned char *o, 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 JPEG mime type. | |
| const char * | getSuffix () const |
| Return the image filename suffix. | |
| ImageEncoding | getImageEncoding () const |
| Get compression type. | |
| void | injectMetadata (RawTile &r) |
| Inject metadata into raw JPEG bitstream. | |
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. | |
Additional Inherited Members | |
Protected Member Functions inherited from Compressor | |
| virtual void | writeMetadata () |
| Write 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. | |
Wrapper class to the IJG JPEG library.
|
inline |
Constructor.
| quality | JPEG Quality factor (0-100) |
|
virtual |
Compress an entire buffer of image data at once in one command.
| t | tile of image data |
Reimplemented from Compressor.
References RawTile::bpc, RawTile::capacity, RawTile::channels, RawTile::compressionType, RawTile::data, RawTile::dataLength, Compressor::exif, RawTile::height, Compressor::icc, RawTile::memoryManaged, iip_destination_mgr::pub, Compressor::Q, RawTile::quality, iip_destination_mgr::source, iip_destination_mgr::source_size, iip_destination_mgr::strip_height, RawTile::width, iip_destination_mgr::written, and Compressor::xmp.
|
virtual |
Compress a strip of image data.
| s | source image data |
| o | output buffer |
| tile_height | pixel height of the tile we are compressing |
Reimplemented from Compressor.
References Compressor::header, Compressor::header_size, iip_destination_mgr::pub, iip_destination_mgr::source, and iip_destination_mgr::source_size.
|
virtual |
Finish the strip based compression and free memory.
| output | output buffer |
Reimplemented from Compressor.
References iip_destination_mgr::pub, iip_destination_mgr::source, iip_destination_mgr::source_size, and iip_destination_mgr::strip_height.
|
inlinevirtual |
Get compression type.
Reimplemented from Compressor.
|
inlinevirtual |
Return the JPEG mime type.
Reimplemented from Compressor.
|
inlinevirtual |
Return the image filename suffix.
Reimplemented from Compressor.
|
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
| rawtile | tile containing the image to be compressed |
| strip_height | pixel height of the strip we want to compress |
Reimplemented from Compressor.
References RawTile::bpc, RawTile::channels, RawTile::compressionType, Compressor::exif, Compressor::header, Compressor::header_size, RawTile::height, Compressor::icc, iip_destination_mgr::pub, Compressor::Q, iip_destination_mgr::source, iip_destination_mgr::source_size, iip_destination_mgr::strip_height, RawTile::width, and Compressor::xmp.
Referenced by injectMetadata().
|
virtual |
Inject metadata into raw JPEG bitstream.
| r | image tile |
Reimplemented from Compressor.
References RawTile::capacity, RawTile::data, RawTile::dataLength, Compressor::embedEXIF, Compressor::embedICC, Compressor::embedXMP, Compressor::exif, Compressor::getHeader(), Compressor::getHeaderSize(), Compressor::icc, InitCompression(), RawTile::memoryManaged, and Compressor::xmp.
|
inlinevirtual |
Set the compression quality.
| factor | Quality factor (0-100) |
Reimplemented from Compressor.
References Compressor::default_quality, and Compressor::Q.
Referenced by QLT::run().