22 #ifndef _JPEGCOMPRESSOR_H 23 #define _JPEGCOMPRESSOR_H 45 struct jpeg_destination_mgr pub;
66 unsigned int width, height, channels;
72 unsigned char header[1024];
78 unsigned int header_size;
81 struct jpeg_compress_struct cinfo;
82 struct jpeg_error_mgr jerr;
97 if( factor < 0 ) Q = 0;
98 else if( factor > 100 ) Q = 100;
120 unsigned int CompressStrip(
unsigned char* s,
unsigned int tile_height )
throw (std::string);
123 unsigned int Finish()
throw (std::string);
int Compress(RawTile &t)
Compress an entire buffer of image data at once in one command.
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
void InitCompression(RawTile &rawtile, unsigned int strip_height)
Initialise strip based compression.
unsigned int CompressStrip(unsigned char *s, unsigned int tile_height)
Compress a strip of image data.
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:96
unsigned int Finish()
Finish the strip based compression and free memory.
JPEGCompressor(int quality)
Constructor.
Definition: JPEGCompressor.h:91
size_t size
Definition: JPEGCompressor.h:47
unsigned int getHeaderSize()
Return the JPEG header size.
Definition: JPEGCompressor.h:132
unsigned char * getHeader()
Return a pointer to the header itself.
Definition: JPEGCompressor.h:135
Class to represent a single image tile.
Definition: RawTile.h:43
int getQuality()
Get the current quality level.
Definition: JPEGCompressor.h:104
JOCTET * buffer
Definition: JPEGCompressor.h:48