22#ifndef _JPEGCOMPRESSOR_H
23#define _JPEGCOMPRESSOR_H
26#include "Compressor.h"
31#define snprintf _snprintf
47 struct jpeg_destination_mgr pub;
65 unsigned int width, height, channels;
71 struct jpeg_compress_struct cinfo;
72 struct jpeg_error_mgr jerr;
77 void writeICCProfile();
80 void writeXMPMetadata();
93 if( factor < 0 )
Q = 0;
94 else if( factor > 100 )
Q = 100;
118 unsigned int CompressStrip(
unsigned char* s,
unsigned char* o,
unsigned int tile_height );
124 unsigned int Finish(
unsigned char* output );
Base class for IIP output images.
Definition: Compressor.h:32
unsigned int header_size
Size of the header data.
Definition: Compressor.h:43
int Q
Quality or compression level for all image types.
Definition: Compressor.h:37
unsigned char * header
Pointer to the header data for the output image.
Definition: Compressor.h:40
Wrapper class to the IJG JPEG library.
Definition: JPEGCompressor.h:60
JPEGCompressor(int quality)
Constructor.
Definition: JPEGCompressor.h:87
unsigned int getHeaderSize() const
Return the JPEG header size.
Definition: JPEGCompressor.h:131
void InitCompression(const RawTile &rawtile, unsigned int strip_height)
Initialise strip based compression.
CompressionType getCompressionType() const
Get compression type.
Definition: JPEGCompressor.h:143
const char * getMimeType() const
Return the JPEG mime type.
Definition: JPEGCompressor.h:137
unsigned int Compress(RawTile &t)
Compress an entire buffer of image data at once in one command.
void setQuality(int factor)
Set the compression quality.
Definition: JPEGCompressor.h:92
unsigned int CompressStrip(unsigned char *s, unsigned char *o, unsigned int tile_height)
Compress a strip of image data.
int getQuality() const
Get the current quality level.
Definition: JPEGCompressor.h:100
unsigned int Finish(unsigned char *output)
Finish the strip based compression and free memory.
unsigned char * getHeader()
Return a pointer to the header itself.
Definition: JPEGCompressor.h:134
const char * getSuffix() const
Return the image filename suffix.
Definition: JPEGCompressor.h:140
Class to represent a single image tile.
Definition: RawTile.h:47
Expanded data destination object for buffered output used by IJG JPEG library.
Definition: JPEGCompressor.h:45
size_t source_size
size of output buffer
Definition: JPEGCompressor.h:50
unsigned char * source
output data buffer pointer
Definition: JPEGCompressor.h:49
size_t written
number of bytes written to buffer
Definition: JPEGCompressor.h:51
unsigned int strip_height
used for stream-based encoding
Definition: JPEGCompressor.h:52