37 #include <sensor_msgs/Image.h> 60 : image_(image), data_(data)
68 namespace message_traits {
70 template<>
struct MD5Sum<ImageTransportImage>
72 static const char* value() {
return MD5Sum<sensor_msgs::Image>::value(); }
73 static const char* value(
const ImageTransportImage&) {
return value(); }
75 static const uint64_t static_value1 = MD5Sum<sensor_msgs::Image>::static_value1;
76 static const uint64_t static_value2 = MD5Sum<sensor_msgs::Image>::static_value2;
79 ROS_STATIC_ASSERT(MD5Sum<sensor_msgs::Image>::static_value1 == 0x060021388200f6f0ULL);
80 ROS_STATIC_ASSERT(MD5Sum<sensor_msgs::Image>::static_value2 == 0xf447d0fcd9c64743ULL);
83 template<>
struct DataType<ImageTransportImage>
85 static const char* value() {
return DataType<sensor_msgs::Image>::value(); }
86 static const char* value(
const ImageTransportImage&) {
return value(); }
89 template<>
struct Definition<ImageTransportImage>
91 static const char* value() {
return Definition<sensor_msgs::Image>::value(); }
92 static const char* value(
const ImageTransportImage&) {
return value(); }
95 template<>
struct HasHeader<ImageTransportImage> : TrueType {};
99 namespace serialization {
101 template<>
struct Serializer<ImageTransportImage>
105 template<
typename Stream>
106 inline static void write(Stream& stream,
const ImageTransportImage& m)
108 stream.next(m.
image_.header);
109 stream.next((uint32_t)m.
image_.height);
110 stream.next((uint32_t)m.
image_.width);
111 stream.next(m.
image_.encoding);
112 uint8_t is_bigendian = 0;
113 stream.next(is_bigendian);
114 stream.next((uint32_t)m.
image_.step);
116 stream.next((uint32_t)data_size);
118 memcpy(stream.advance(data_size), m.
data_, data_size);
121 inline static uint32_t serializedLength(
const ImageTransportImage& m)
135 void RawPublisher::publish(
const sensor_msgs::Image& message,
const uint8_t* data)
const const uint8_t * data_
Image data for use with OpenCV.
#define ROS_STATIC_ASSERT(cond)
ImageTransportImage(const sensor_msgs::Image &image, const uint8_t *data)
Constructor.
sensor_msgs::Image image_
ROS header.
ImageTransportImage()
Empty constructor.
uint32_t serializationLength(const T &t)