22 #ifndef _JPEGCOMPRESSOR_H 23 #define _JPEGCOMPRESSOR_H 45 struct jpeg_destination_mgr pub;
65 unsigned int width, height, channels;
71 unsigned char header[1024];
77 unsigned int header_size;
80 struct jpeg_compress_struct cinfo;
81 struct jpeg_error_mgr jerr;
96 if( factor < 0 ) Q = 0;
97 else if( factor > 100 ) Q = 100;
121 unsigned int CompressStrip(
unsigned char* s,
unsigned char* o,
unsigned int tile_height )
throw (std::string);
127 unsigned int Finish(
unsigned char* output )
throw (std::string);
int Compress(RawTile &t)
Compress an entire buffer of image data at once in one command.
unsigned int CompressStrip(unsigned char *s, unsigned char *o, unsigned int tile_height)
Compress a strip of image data.
Wrapper class to the IJG JPEG library.
Definition: JPEGCompressor.h:60
Expanded data destination object for buffered output used by IJG JPEG library.
Definition: JPEGCompressor.h:44
unsigned int Finish(unsigned char *output)
Finish the strip based compression and free memory.
unsigned int strip_height
Definition: JPEGCompressor.h:50
unsigned char * source
Definition: JPEGCompressor.h:49
void setQuality(int factor)
Set the compression quality.
Definition: JPEGCompressor.h:95
JPEGCompressor(int quality)
Constructor.
Definition: JPEGCompressor.h:90
size_t size
Definition: JPEGCompressor.h:47
void addMetadata(const std::string &m)
Add metadata to the JPEG header.
unsigned int getHeaderSize()
Return the JPEG header size.
Definition: JPEGCompressor.h:141
void InitCompression(const RawTile &rawtile, unsigned int strip_height)
Initialise strip based compression.
unsigned char * getHeader()
Return a pointer to the header itself.
Definition: JPEGCompressor.h:144
Class to represent a single image tile.
Definition: RawTile.h:45
int getQuality()
Get the current quality level.
Definition: JPEGCompressor.h:103
JOCTET * buffer
Definition: JPEGCompressor.h:48