22#ifndef _JPEGCOMPRESSOR_H
23#define _JPEGCOMPRESSOR_H
26#include "Compressor.h"
31#define snprintf _snprintf
48 struct jpeg_destination_mgr pub;
68 unsigned int width, height, channels;
74 unsigned char header[1024];
80 unsigned int header_size;
83 struct jpeg_compress_struct cinfo;
84 struct jpeg_error_mgr jerr;
89 void writeICCProfile();
92 void writeXMPMetadata();
105 if( factor < 0 ) Q = 0;
106 else if( factor > 100 ) Q = 100;
130 unsigned int CompressStrip(
unsigned char* s,
unsigned char* o,
unsigned int tile_height );
136 unsigned int Finish(
unsigned char* output );
Base class for IIP output images.
Definition Compressor.h:32
Wrapper class to the IJG JPEG library.
Definition JPEGCompressor.h:63
JPEGCompressor(int quality)
Constructor.
Definition JPEGCompressor.h:99
void InitCompression(const RawTile &rawtile, unsigned int strip_height)
Initialise strip based compression.
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:104
unsigned int getHeaderSize()
Return the JPEG header size.
Definition JPEGCompressor.h:143
unsigned int CompressStrip(unsigned char *s, unsigned char *o, unsigned int tile_height)
Compress a strip of image data.
const char * getSuffix()
Return the image filename suffix.
Definition JPEGCompressor.h:152
const char * getMimeType()
Return the JPEG mime type.
Definition JPEGCompressor.h:149
unsigned int Finish(unsigned char *output)
Finish the strip based compression and free memory.
int getQuality()
Get the current quality level.
Definition JPEGCompressor.h:112
unsigned char * getHeader()
Return a pointer to the header itself.
Definition JPEGCompressor.h:146
Class to represent a single image tile.
Definition RawTile.h:45
Expanded data destination object for buffered output used by IJG JPEG library.
Definition JPEGCompressor.h:47
JOCTET * buffer
Definition JPEGCompressor.h:51
unsigned char * source
Definition JPEGCompressor.h:52
size_t size
Definition JPEGCompressor.h:50
unsigned int strip_height
Definition JPEGCompressor.h:53