Go to the documentation of this file.
15 #include <dynamic_reconfigure/Config.h>
16 #include <sensor_msgs/Image.h>
17 #include <topic_tools/shape_shifter.h>
89 const dynamic_reconfigure::Config& config)
const = 0;
98 const dynamic_reconfigure::Config& config)
const = 0;
137 template<
typename Codec>
143 this->
codec.setCrasLogger(logHelper);
148 return this->
codec.getTransportName();
152 const dynamic_reconfigure::Config& config)
const override
154 return this->
codec.encode(raw, config);
158 const dynamic_reconfigure::Config& config)
const override
160 return this->
codec.decode(compressed, config);
166 return this->
codec.getCompressedImageContent(compressed, matchFormat);
boost::shared_ptr< const ImageTransportCodecPlugin > ConstPtr
Shared pointer to const ImageTransportCodecPlugin.
void setLogHelper(const cras::LogHelperPtr &logHelper) override
Use the given log helper for logging messages.
Codec codec
The codec used by this plugin.
virtual std::string getTransportName() const =0
Get the name of the codec/transport (used e.g. as topic suffix).
cras::expected< sensor_msgs::Image, std::string > DecodeResult
Result of image decoding. Either a sensor_msgs::Image holding the raw message, or error message.
cras::expected< cras::optional< CompressedImageContent >, std::string > GetCompressedContentResult
Result of getting the actual compressed image data.
Base for all image transport codecs.
virtual ~ImageTransportCodecPlugin()=default
boost::shared_ptr< ImageTransportCodecPlugin > Ptr
Shared pointer to ImageTransportCodecPlugin.
ImageTransportCodec::DecodeResult decode(const topic_tools::ShapeShifter &compressed, const dynamic_reconfigure::Config &config) const override
Decode the given compressed image into a raw image.
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....
std::string getTransportName() const override
Get the name of the codec/transport (used e.g. as topic suffix).
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.
Convenience class for implementing image transport codec plugins, which just relays the whole API to ...
ImageTransportCodec::EncodeResult encode(const sensor_msgs::Image &raw, const dynamic_reconfigure::Config &config) const override
Encode the given raw image into the given shapeshifter object.
ImageTransportCodec::GetCompressedContentResult getCompressedImageContent(const topic_tools::ShapeShifter &compressed, const std::string &matchFormat) const override
Return the part of the encoded message that represents the actual image data (i.e....
::cras::LogHelper::Ptr LogHelperPtr
virtual void setLogHelper(const cras::LogHelperPtr &logHelper)=0
Use the given log helper for logging messages.
cras::expected< cras::ShapeShifter, std::string > EncodeResult
Result of image encoding. Either a shapeshifter holding the compressed message, or error message.
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.
Basic interface of an image transport codec plugin.