ImageCompressor Class Reference
Image compressor interface. More...
#include <fvutils/compression/imagecompressor.h>

Public Types | |
| enum | CompressionDestination { COMP_DEST_FILE, COMP_DEST_MEM } |
| Where to put the compressed image. More... | |
Public Member Functions | |
| virtual | ~ImageCompressor () |
| Virtual empty destructor. | |
| virtual void | set_image_dimensions (unsigned int width, unsigned int height)=0 |
| Set dimensions of image to compress. | |
| virtual void | set_image_buffer (colorspace_t cspace, unsigned char *buffer)=0 |
| Set image buffer to compress. | |
| virtual void | set_destination_buffer (unsigned char *buf, unsigned int buf_size)=0 |
| Set destination buffer (if compressing to memory). | |
| virtual size_t | compressed_size ()=0 |
| Get compressed size. | |
| virtual void | set_filename (const char *filename)=0 |
| Set file name. | |
| virtual void | set_compression_destination (CompressionDestination cd)=0 |
| Set compression destination. | |
| virtual bool | supports_compression_destination (CompressionDestination cd)=0 |
| Check if compressor supports desired compression destination. | |
| virtual size_t | recommended_compressed_buffer_size ()=0 |
| Get the recommended size for the compressed buffer. | |
| virtual void | compress ()=0 |
| Compress image. | |
Detailed Description
Image compressor interface.Definition at line 30 of file imagecompressor.h.
Member Enumeration Documentation
Where to put the compressed image.
- Enumerator:
-
COMP_DEST_FILE write compressed image to file COMP_DEST_MEM write compressed image to buffer in memory
Definition at line 34 of file imagecompressor.h.
Constructor & Destructor Documentation
| ImageCompressor::~ImageCompressor | ( | ) | [virtual] |
Member Function Documentation
| void ImageCompressor::compress | ( | ) | [pure virtual] |
| size_t ImageCompressor::compressed_size | ( | ) | [pure virtual] |
Get compressed size.
- Returns:
- compressed size
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::write().
| size_t ImageCompressor::recommended_compressed_buffer_size | ( | ) | [pure virtual] |
Get the recommended size for the compressed buffer.
It is not guaranteed that this size is really enough for compression but in most cases this should be suitable.
- Returns:
- recommended buffer size
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::write().
| void ImageCompressor::set_compression_destination | ( | CompressionDestination | cd | ) | [pure virtual] |
Set compression destination.
- Parameters:
-
cd compression destination
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::write().
| void ImageCompressor::set_destination_buffer | ( | unsigned char * | buf, | |
| unsigned int | buf_size | |||
| ) | [pure virtual] |
Set destination buffer (if compressing to memory).
- Parameters:
-
buf buffer buf_size buffer size
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::write().
| void ImageCompressor::set_filename | ( | const char * | filename | ) | [pure virtual] |
Set file name.
- Parameters:
-
filename file name (if compressing to file)
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::set_filename(), and CompressedImageWriter::set_image_compressor().
| void ImageCompressor::set_image_buffer | ( | colorspace_t | cspace, | |
| unsigned char * | buffer | |||
| ) | [pure virtual] |
Set image buffer to compress.
- Parameters:
-
cspace colorspace of image buffer buffer that contains the image
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::set_buffer(), and CompressedImageWriter::set_image_compressor().
| void ImageCompressor::set_image_dimensions | ( | unsigned int | width, | |
| unsigned int | height | |||
| ) | [pure virtual] |
Set dimensions of image to compress.
- Parameters:
-
width width of image in pixels height height of image in pixels
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::set_dimensions(), and CompressedImageWriter::set_image_compressor().
| bool ImageCompressor::supports_compression_destination | ( | CompressionDestination | cd | ) | [pure virtual] |
Check if compressor supports desired compression destination.
- Parameters:
-
cd compression destination
Implemented in JpegImageCompressor.
Referenced by CompressedImageWriter::write().
The documentation for this class was generated from the following files:
- src/firevision/fvutils/compression/imagecompressor.h
- src/firevision/fvutils/compression/imagecompressor.cpp

