Fawkes API
Fawkes Development Version
|
Jpeg image compressor. More...
#include <>>
Public Member Functions | |
JpegImageCompressorMMAL (unsigned int quality=80) | |
Constructor. More... | |
virtual | ~JpegImageCompressorMMAL () |
Destructor. More... | |
virtual void | set_image_dimensions (unsigned int width, unsigned int height) |
Set dimensions of image to compress. More... | |
virtual void | set_image_buffer (colorspace_t cspace, unsigned char *buffer) |
Set image buffer to compress. More... | |
virtual void | set_destination_buffer (unsigned char *buf, unsigned int buf_size) |
Set destination buffer (if compressing to memory). More... | |
virtual size_t | compressed_size () |
Get compressed size. More... | |
virtual void | set_filename (const char *filename) |
Set file name. More... | |
virtual void | set_compression_destination (ImageCompressor::CompressionDestination cd) |
Set compression destination. More... | |
virtual bool | supports_compression_destination (ImageCompressor::CompressionDestination cd) |
Check if compressor supports desired compression destination. More... | |
virtual void | compress () |
Compress image. More... | |
virtual size_t | recommended_compressed_buffer_size () |
Get the recommended size for the compressed buffer. More... | |
virtual bool | supports_vflip () |
Check if image compressor can do vflip during compress. More... | |
virtual void | set_vflip (bool enable) |
Enable or disable vflipping. More... | |
![]() | |
virtual | ~ImageCompressor () |
Virtual empty destructor. More... | |
Additional Inherited Members | |
![]() | |
enum | CompressionDestination { COMP_DEST_FILE, COMP_DEST_MEM } |
Where to put the compressed image. More... | |
Jpeg image compressor.
This JPEG image compressor implementation uses the MMAL hardware encoder of the Raspberry Pi.
Definition at line 42 of file jpeg_compressor_mmal.h.
firevision::JpegImageCompressorMMAL::JpegImageCompressorMMAL | ( | unsigned int | quality = 80 | ) |
Constructor.
quality | JPEG quality in percent (1-100) |
Definition at line 191 of file jpeg_compressor_mmal.cpp.
|
virtual |
Destructor.
Definition at line 202 of file jpeg_compressor_mmal.cpp.
|
virtual |
Compress image.
Implements firevision::ImageCompressor.
Definition at line 223 of file jpeg_compressor_mmal.cpp.
|
virtual |
Get compressed size.
Implements firevision::ImageCompressor.
Definition at line 396 of file jpeg_compressor_mmal.cpp.
|
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.
Implements firevision::ImageCompressor.
Definition at line 402 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set compression destination.
cd | compression destination |
Implements firevision::ImageCompressor.
Definition at line 374 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set destination buffer (if compressing to memory).
buf | buffer |
buf_size | buffer size |
Implements firevision::ImageCompressor.
Definition at line 388 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set file name.
filename | file name (if compressing to file) |
Implements firevision::ImageCompressor.
Definition at line 409 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set image buffer to compress.
cspace | colorspace of image |
buffer | buffer that contains the image |
Implements firevision::ImageCompressor.
Definition at line 363 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set dimensions of image to compress.
width | width of image in pixels |
height | height of image in pixels |
Implements firevision::ImageCompressor.
Definition at line 351 of file jpeg_compressor_mmal.cpp.
|
virtual |
Enable or disable vflipping.
This shall throw an exception if vflipping is not supported.
enable | true to enable vflipping, false to disable |
Exception | thrown if vflipping is not supported. |
Implements firevision::ImageCompressor.
Definition at line 217 of file jpeg_compressor_mmal.cpp.
|
virtual |
Check if compressor supports desired compression destination.
cd | compression destination |
Implements firevision::ImageCompressor.
Definition at line 381 of file jpeg_compressor_mmal.cpp.
|
virtual |
Check if image compressor can do vflip during compress.
Vertical flipping (having the image upside down) is an operation necessary for example for cameras hanging upside down. During compression when the buffer is typically copied or converted line-wise anyway, this is a particularly cheap operation. Therfore we provide an API to implement this.
Implements firevision::ImageCompressor.
Definition at line 210 of file jpeg_compressor_mmal.cpp.