24 #ifndef __FIREVISION_UTILS_COMPRESSION_JPEG_COMPRESSOR_LIBJPEG_H_ 25 #define __FIREVISION_UTILS_COMPRESSION_JPEG_COMPRESSOR_LIBJPEG_H_ 27 #ifndef __FIREVISION_UTILS_COMPRESSION_JPEG_COMPRESSOR_H_ 28 # error Do not include jpeg_compressor_libjpeg.h directly, use jpeg_compressor.h 31 #include <fvutils/compression/imagecompressor.h> 58 unsigned char *jpeg_buffer;
59 unsigned int jpeg_buffer_size;
60 unsigned char *buffer;
68 unsigned int jpeg_bytes;
virtual bool supports_compression_destination(ImageCompressor::CompressionDestination cd)
Check if compressor supports desired compression destination.
virtual void set_image_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer to compress.
virtual void compress()
Compress image.
virtual bool supports_vflip()
Check if image compressor can do vflip during compress.
virtual void set_compression_destination(ImageCompressor::CompressionDestination cd)
Set compression destination.
JpegColorspace
JPEG color space.
virtual void set_image_dimensions(unsigned int width, unsigned int height)
Set dimensions of image to compress.
CompressionDestination
Where to put the compressed image.
JpegImageCompressorLibJpeg(unsigned int quality=80, JpegImageCompressor::JpegColorspace jcs=JpegImageCompressor::JPEG_CS_RGB)
Constructor.
virtual size_t compressed_size()
Get compressed size.
virtual void set_vflip(bool enable)
Enable or disable vflipping.
virtual void set_destination_buffer(unsigned char *buf, unsigned int buf_size)
Set destination buffer (if compressing to memory).
virtual ~JpegImageCompressorLibJpeg()
Destructor.
Image compressor interface.
virtual void set_filename(const char *filename)
Set file name.
virtual size_t recommended_compressed_buffer_size()
Get the recommended size for the compressed buffer.