15 #include <dynamic_reconfigure/Config.h> 17 #include <sensor_msgs/Image.h> 18 #include <topic_tools/shape_shifter.h> 92 typedef cras::expected<cras::ShapeShifter, std::string>
EncodeResult;
95 typedef cras::expected<sensor_msgs::Image, std::string>
DecodeResult;
113 virtual std::string getTransportName()
const = 0;
121 virtual EncodeResult encode(
const sensor_msgs::Image& raw,
const dynamic_reconfigure::Config& config)
const = 0;
130 const dynamic_reconfigure::Config& config)
const = 0;
142 virtual GetCompressedContentResult getCompressedImageContent(
160 EncodeResult encode(
const sensor_msgs::Image& raw)
const;
175 EncodeResult encode(
const sensor_msgs::Image& raw,
const XmlRpc::XmlRpcValue& config)
const;
192 EncodeResult encode(
const sensor_msgs::Image& raw,
const ros::NodeHandle& nh,
const std::string& param)
const;
203 const std::string& param)
const;
213 template<
typename Config>
214 EncodeResult
encode(
const sensor_msgs::Image& raw,
const Config& config)
const 216 dynamic_reconfigure::Config configMsg;
217 config.__toMessage__(configMsg);
218 return this->encode(raw, configMsg);
229 template<
typename Config>
232 dynamic_reconfigure::Config configMsg;
233 config.__toMessage__(configMsg);
234 return this->decode(compressed, configMsg);
cras::expected< cras::ShapeShifter, std::string > EncodeResult
Result of image encoding. Either a shapeshifter holding the compressed message, or error message...
boost::shared_ptr< ImageTransportCodec > Ptr
Shared pointer to ImageTransportCodec.
std::vector< uint8_t > data
The image content.
std::string format
Format of the image. This should be a string recognized by OpenCV, ffmpeg or similar tools...
cras::expected< sensor_msgs::Image, std::string > DecodeResult
Result of image decoding. Either a sensor_msgs::Image holding the raw message, or error message...
The part of a compressed message that represents the actual image data (i.e. data that can be passed ...
boost::shared_ptr< const ImageTransportCodec > ConstPtr
Shared pointer to const ImageTransportCodec.
DecodeResult decode(const topic_tools::ShapeShifter &compressed, const Config &config) const
Decode the given compressed image into a raw image.
cras::expected< cras::optional< CompressedImageContent >, std::string > GetCompressedContentResult
Result of getting the actual compressed image data.
Base for all image transport codecs. All codecs have to extend class ImageTransportCodec and implemen...
EncodeResult encode(const sensor_msgs::Image &raw, const Config &config) const
Encode the given raw image into the given shapeshifter object.
::cras::LogHelper::Ptr LogHelperPtr