24 #ifndef __FIREVISION_UTILS_COMPRESSION_JPEG_COMPRESSOR_H_ 25 #define __FIREVISION_UTILS_COMPRESSION_JPEG_COMPRESSOR_H_ 27 #include <fvutils/compression/imagecompressor.h> 51 unsigned int quality = 80, JpegColorspace jcs = JPEG_CS_RGB);
55 { impl_->set_image_dimensions(width, height); }
57 { impl_->set_image_buffer(cspace, buffer); }
59 { impl_->set_destination_buffer(buf, buf_size); }
61 {
return impl_->compressed_size(); }
63 { impl_->set_filename(filename); }
65 { impl_->set_compression_destination(cd); }
67 {
return impl_->supports_compression_destination(cd); }
69 { impl_->compress(); }
71 {
return impl_->recommended_compressed_buffer_size(); }
73 {
return impl_->supports_vflip(); }
75 { impl_->set_vflip(enable); }
Force usage of libjpeg for compression.
virtual void set_compression_destination(ImageCompressor::CompressionDestination cd)
Set compression destination.
JpegColorspace
JPEG color space.
virtual size_t compressed_size()
Get compressed size.
JpegCompressorImplementation
JPEG color space.
virtual void compress()
Compress image.
CompressionDestination
Where to put the compressed image.
virtual void set_image_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer to compress.
virtual void set_filename(const char *filename)
Set file name.
virtual void set_image_dimensions(unsigned int width, unsigned int height)
Set dimensions of image to compress.
virtual void set_destination_buffer(unsigned char *buf, unsigned int buf_size)
Set destination buffer (if compressing to memory).
virtual bool supports_vflip()
Check if image compressor can do vflip during compress.
virtual void set_vflip(bool enable)
Enable or disable vflipping.
Image compressor interface.
virtual size_t recommended_compressed_buffer_size()
Get the recommended size for the compressed buffer.
virtual bool supports_compression_destination(ImageCompressor::CompressionDestination cd)
Check if compressor supports desired compression destination.