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);
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.
virtual std::string getTransportName() const =0
Get the name of the codec/transport (used e.g. as topic suffix).
virtual ~ImageTransportCodecPlugin()=default
cras::expected< sensor_msgs::Image, std::string > DecodeResult
Result of image decoding. Either a sensor_msgs::Image holding the raw message, or error message...
boost::shared_ptr< ImageTransportCodecPlugin > Ptr
Shared pointer to ImageTransportCodecPlugin.
Convenience class for implementing image transport codec plugins, which just relays the whole API to ...
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.
cras::expected< cras::optional< CompressedImageContent >, std::string > GetCompressedContentResult
Result of getting the actual compressed image data.
Base for all image transport codecs.
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.
void setLogHelper(const cras::LogHelperPtr &logHelper) override
Use the given log helper for logging messages.
virtual void setLogHelper(const cras::LogHelperPtr &logHelper)=0
Use the given log helper for logging messages.
ImageTransportCodec::DecodeResult decode(const topic_tools::ShapeShifter &compressed, const dynamic_reconfigure::Config &config) const override
Decode the given compressed image into a raw image.
Basic interface of an image transport codec plugin.
std::string getTransportName() const override
Get the name of the codec/transport (used e.g. as topic suffix).
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. 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.
boost::shared_ptr< const ImageTransportCodecPlugin > ConstPtr
Shared pointer to const ImageTransportCodecPlugin.
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.
Codec codec
The codec used by this plugin.
::cras::LogHelper::Ptr LogHelperPtr