Wrapper class to the IJG JPEG library.
More...
#include <JPEGCompressor.h>
|
| JPEGCompressor (int quality) |
| Constructor. More...
|
|
void | setQuality (int factor) |
| Set the compression quality. More...
|
|
int | getQuality () |
| Get the current quality level.
|
|
void | InitCompression (const RawTile &rawtile, unsigned int strip_height) throw (std::string) |
| Initialise strip based compression. More...
|
|
unsigned int | CompressStrip (unsigned char *s, unsigned char *o, unsigned int tile_height) throw (std::string) |
| Compress a strip of image data. More...
|
|
unsigned int | Finish (unsigned char *output) throw (std::string) |
| Finish the strip based compression and free memory. More...
|
|
int | Compress (RawTile &t) throw (std::string) |
| Compress an entire buffer of image data at once in one command. More...
|
|
void | addMetadata (const std::string &m) |
| Add metadata to the JPEG header. More...
|
|
unsigned int | getHeaderSize () |
| Return the JPEG header size.
|
|
unsigned char * | getHeader () |
| Return a pointer to the header itself.
|
|
Wrapper class to the IJG JPEG library.
JPEGCompressor::JPEGCompressor |
( |
int |
quality | ) |
|
|
inline |
Constructor.
- Parameters
-
quality | JPEG Quality factor (0-100) |
void JPEGCompressor::addMetadata |
( |
const std::string & |
m | ) |
|
Add metadata to the JPEG header.
- Parameters
-
Referenced by getQuality().
int JPEGCompressor::Compress |
( |
RawTile & |
t | ) |
|
throw | ( | std::string |
| ) | | |
Compress an entire buffer of image data at once in one command.
- Parameters
-
Referenced by getQuality().
unsigned int JPEGCompressor::CompressStrip |
( |
unsigned char * |
s, |
|
|
unsigned char * |
o, |
|
|
unsigned int |
tile_height |
|
) |
| |
throw | ( | std::string |
| ) | | |
Compress a strip of image data.
- Parameters
-
s | source image data |
o | output buffer |
tile_height | pixel height of the tile we are compressing |
Referenced by getQuality().
unsigned int JPEGCompressor::Finish |
( |
unsigned char * |
output | ) |
|
throw | ( | std::string |
| ) | | |
Finish the strip based compression and free memory.
- Parameters
-
- Returns
- size of output generated
Referenced by getQuality().
void JPEGCompressor::InitCompression |
( |
const RawTile & |
rawtile, |
|
|
unsigned int |
strip_height |
|
) |
| |
throw | ( | std::string |
| ) | | |
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
- Parameters
-
rawtile | tile containing the image to be compressed |
strip_height | pixel height of the strip we want to compress |
- Returns
- header size
Referenced by getQuality().
void JPEGCompressor::setQuality |
( |
int |
factor | ) |
|
|
inline |
Set the compression quality.
- Parameters
-
factor | Quality factor (0-100) |
The documentation for this class was generated from the following file: