24 #ifndef __JPEGHANDLER_HH__
25 #define __JPEGHANDLER_HH__
33 #include <Base/Image/ImageIO.hh>
34 #include <Base/Image/ImageConvert.hh>
70 int Init(
long size = 10485760);
93 int Compress(
unsigned int width,
unsigned int height,
unsigned int channels,
94 unsigned char* data,
int quality = 60);
112 int Decompress(
unsigned int &width,
unsigned int &height,
113 unsigned int &channels,
unsigned char* &data);
121 int Compress(
unsigned int width,
unsigned int height,
unsigned int channels,
122 unsigned char* inData,
unsigned char *outData,
long &outBytes,
131 int Decompress(
unsigned int &width,
unsigned int &height,
unsigned int &channels,
132 unsigned char* inData,
long inBytes,
unsigned char* outData);
142 length = dataLength_;
155 dataLength_ = length;
156 memcpy(data_, data, dataLength_);
163 int WriteJPEG(
const std::string &filename);
170 int ReadJPEG(
const std::string &filename);
195 #endif //__JPEGHANDLER_HH__
Wrapper for fast libjpeg methods.
long bufferSize_
Length in byte of compression buffer (max.
bool verbose_
Print error messages or keep quiet?
void GetCompressedData(void *&data, long &length)
Get pointer to memory where to find compressed data and its length in byte.
long dataLength_
Length in byte of compressed data.
void SetVerbose(const bool verbose)
Print error messages to standard output or keep quiet?
bool IsInitialized()
Returns if an internal buffer has been initialized.
long GetCompressedDataSize()
Return compressed data length in bytes.
void SetCompressedData(void *data, long length)
Copy memory area in which compressed data can be found and set its length in byte.
void * data_
Pointer to compression buffer (compressed data)