Fawkes API
Fawkes Development Version
|
#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) |
virtual void | set_image_buffer (colorspace_t cspace, unsigned char *buffer) |
virtual void | set_destination_buffer (unsigned char *buf, unsigned int buf_size) |
virtual size_t | compressed_size () |
virtual void | set_filename (const char *filename) |
virtual void | set_compression_destination (ImageCompressor::CompressionDestination cd) |
virtual bool | supports_compression_destination (ImageCompressor::CompressionDestination cd) |
virtual void | compress () |
virtual size_t | recommended_compressed_buffer_size () |
virtual bool | supports_vflip () |
virtual void | set_vflip (bool enable) |
![]() | |
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 43 of file jpeg_compressor_mmal.h.
firevision::JpegImageCompressorMMAL::JpegImageCompressorMMAL | ( | unsigned int | quality = 80 | ) |
Constructor.
quality | JPEG quality in percent (1-100) |
Definition at line 190 of file jpeg_compressor_mmal.cpp.
|
virtual |
Destructor.
Definition at line 201 of file jpeg_compressor_mmal.cpp.
|
virtual |
Compress image.
Implements firevision::ImageCompressor.
Definition at line 220 of file jpeg_compressor_mmal.cpp.
|
virtual |
Get compressed size.
Implements firevision::ImageCompressor.
Definition at line 390 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 396 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set compression destination.
cd | compression destination |
Implements firevision::ImageCompressor.
Definition at line 370 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 383 of file jpeg_compressor_mmal.cpp.
|
virtual |
Set file name.
filename | file name (if compressing to file) |
Implements firevision::ImageCompressor.
Definition at line 402 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 360 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 349 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 214 of file jpeg_compressor_mmal.cpp.
|
virtual |
Check if compressor supports desired compression destination.
cd | compression destination |
Implements firevision::ImageCompressor.
Definition at line 376 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 208 of file jpeg_compressor_mmal.cpp.