Basic interface of an image transport codec plugin. More...
#include <image_transport_codec_plugin.h>
Public Types | |
typedef boost::shared_ptr< const ImageTransportCodecPlugin > | ConstPtr |
Shared pointer to const ImageTransportCodecPlugin . More... | |
typedef boost::shared_ptr< ImageTransportCodecPlugin > | Ptr |
Shared pointer to ImageTransportCodecPlugin . More... | |
Public Member Functions | |
virtual ImageTransportCodec::DecodeResult | decode (const topic_tools::ShapeShifter &compressed, const dynamic_reconfigure::Config &config) const =0 |
Decode the given compressed image into a raw image. More... | |
virtual ImageTransportCodec::EncodeResult | encode (const sensor_msgs::Image &raw, const dynamic_reconfigure::Config &config) const =0 |
Encode the given raw image into the given shapeshifter object. More... | |
virtual ImageTransportCodec::GetCompressedContentResult | getCompressedImageContent (const topic_tools::ShapeShifter &compressed, const std::string &matchFormat) const =0 |
Return the part of the encoded message that represents the actual image data (i.e. the part that can be passed to external decoders or saved to a file). If the codec messages have no such meaning, empty result is returned. More... | |
virtual std::string | getTransportName () const =0 |
Get the name of the codec/transport (used e.g. as topic suffix). More... | |
virtual void | setLogHelper (const cras::LogHelperPtr &logHelper)=0 |
Use the given log helper for logging messages. More... | |
virtual | ~ImageTransportCodecPlugin ()=default |
Basic interface of an image transport codec plugin.
ImageTransportCodec
interface. "codec
plugin library" is a different library (cannot be the same!) which implements the ImageTransportCodecPlugin
interface.#include <pluginlib/class_list_macros.h>
PLUGINLIB_EXPORT_CLASS(<PLUGIN>, image_transport_codecs::ImageTransportCodecPlugin)
<PLUGIN>
with the fully qualified name of your plugin classcatkin_package(LIBRARIES...)
in your CMakeLists.txt
.catkin_package(LIBRARIES...)
in your CMakeLists.txt
.ImageTransportCodecPluginBase
can make that really easy)<exec_depend>image_transport_codecs</exec_depend>
to your package.xml<export><image_transport_codecs plugin="${prefix}/plugins.xml" /></export>
to your package.xmlplugins.xml
in the root of your package with the following content - substitute `CODEC` with the topic suffix your codec uses - substitute `PLUGIN` with the fully qualified name of your codec plugin class - substitute `PLUGIN_LIB_NAME` with the name of the dynamic library your codec plugin uses - substitute `MY PLUGIN DESCRIPTION` with some meaningful description of the codec - do not forget to install the codec library, codec plugin library, includes of the codec library and `plugins.xml` files in your `CMakeLists.txt`.
Definition at line 58 of file image_transport_codec_plugin.h.
typedef boost::shared_ptr<const ImageTransportCodecPlugin> image_transport_codecs::ImageTransportCodecPlugin::ConstPtr |
Shared pointer to const ImageTransportCodecPlugin
.
Definition at line 65 of file image_transport_codec_plugin.h.
typedef boost::shared_ptr<ImageTransportCodecPlugin> image_transport_codecs::ImageTransportCodecPlugin::Ptr |
Shared pointer to ImageTransportCodecPlugin
.
Definition at line 62 of file image_transport_codec_plugin.h.
|
virtualdefault |
|
pure virtual |
Decode the given compressed image into a raw image.
[in] | compressed | The shapeshifter of the compressed image to be decoded. |
[in] | config | Config of the decompression (if it has any parameters). |
Implemented in image_transport_codecs::ImageTransportCodecPluginBase< Codec >.
|
pure virtual |
Encode the given raw image into the given shapeshifter object.
[in] | raw | The input raw image. |
[in] | config | Config of the compression (if it has any parameters). |
Implemented in image_transport_codecs::ImageTransportCodecPluginBase< Codec >.
|
pure virtual |
Return the part of the encoded message that represents the actual image data (i.e. the part that can be passed to external decoders or saved to a file). If the codec messages have no such meaning, empty result is returned.
[in] | compressed | The compressed image. |
[in] | matchFormat | If nonempty, the image data is only returned if their format field would match the given one. The matching should be case-insensitive. |
Implemented in image_transport_codecs::ImageTransportCodecPluginBase< Codec >.
|
pure virtual |
Get the name of the codec/transport (used e.g. as topic suffix).
Implemented in image_transport_codecs::ImageTransportCodecPluginBase< Codec >.
|
pure virtual |
Use the given log helper for logging messages.
[in] | logHelper | The log helper to use. |
Implemented in image_transport_codecs::ImageTransportCodecPluginBase< Codec >.