00001
00002 #ifndef SENSOR_MSGS_MESSAGE_COMPRESSEDIMAGE_H
00003 #define SENSOR_MSGS_MESSAGE_COMPRESSEDIMAGE_H
00004 #include <string>
00005 #include <vector>
00006 #include <ostream>
00007 #include "ros/serialization.h"
00008 #include "ros/builtin_message_traits.h"
00009 #include "ros/message_operations.h"
00010 #include "ros/message.h"
00011 #include "ros/time.h"
00012
00013 #include "std_msgs/Header.h"
00014
00015 namespace sensor_msgs
00016 {
00017 template <class ContainerAllocator>
00018 struct CompressedImage_ : public ros::Message
00019 {
00020 typedef CompressedImage_<ContainerAllocator> Type;
00021
00022 CompressedImage_()
00023 : header()
00024 , format()
00025 , data()
00026 {
00027 }
00028
00029 CompressedImage_(const ContainerAllocator& _alloc)
00030 : header(_alloc)
00031 , format(_alloc)
00032 , data(_alloc)
00033 {
00034 }
00035
00036 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00037 ::std_msgs::Header_<ContainerAllocator> header;
00038
00039 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _format_type;
00040 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > format;
00041
00042 typedef std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > _data_type;
00043 std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > data;
00044
00045
00046 ROS_DEPRECATED uint32_t get_data_size() const { return (uint32_t)data.size(); }
00047 ROS_DEPRECATED void set_data_size(uint32_t size) { data.resize((size_t)size); }
00048 ROS_DEPRECATED void get_data_vec(std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) const { vec = this->data; }
00049 ROS_DEPRECATED void set_data_vec(const std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) { this->data = vec; }
00050 private:
00051 static const char* __s_getDataType_() { return "sensor_msgs/CompressedImage"; }
00052 public:
00053 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00054
00055 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00056
00057 private:
00058 static const char* __s_getMD5Sum_() { return "8f7a12909da2c9d3332d540a0977563f"; }
00059 public:
00060 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00061
00062 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00063
00064 private:
00065 static const char* __s_getMessageDefinition_() { return "# This message contains a compressed image\n\
00066 \n\
00067 Header header # Header timestamp should be acquisition time of image\n\
00068 # Header frame_id should be optical frame of camera\n\
00069 # origin of frame should be optical center of cameara\n\
00070 # +x should point to the right in the image\n\
00071 # +y should point down in the image\n\
00072 # +z should point into to plane of the image\n\
00073 \n\
00074 string format # Specifies the format of the data\n\
00075 # Acceptable values:\n\
00076 # jpeg, png\n\
00077 uint8[] data # Compressed image buffer\n\
00078 \n\
00079 ================================================================================\n\
00080 MSG: std_msgs/Header\n\
00081 # Standard metadata for higher-level stamped data types.\n\
00082 # This is generally used to communicate timestamped data \n\
00083 # in a particular coordinate frame.\n\
00084 # \n\
00085 # sequence ID: consecutively increasing ID \n\
00086 uint32 seq\n\
00087 #Two-integer timestamp that is expressed as:\n\
00088 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00089 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00090 # time-handling sugar is provided by the client library\n\
00091 time stamp\n\
00092 #Frame this data is associated with\n\
00093 # 0: no frame\n\
00094 # 1: global frame\n\
00095 string frame_id\n\
00096 \n\
00097 "; }
00098 public:
00099 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00100
00101 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00102
00103 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00104 {
00105 ros::serialization::OStream stream(write_ptr, 1000000000);
00106 ros::serialization::serialize(stream, header);
00107 ros::serialization::serialize(stream, format);
00108 ros::serialization::serialize(stream, data);
00109 return stream.getData();
00110 }
00111
00112 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00113 {
00114 ros::serialization::IStream stream(read_ptr, 1000000000);
00115 ros::serialization::deserialize(stream, header);
00116 ros::serialization::deserialize(stream, format);
00117 ros::serialization::deserialize(stream, data);
00118 return stream.getData();
00119 }
00120
00121 ROS_DEPRECATED virtual uint32_t serializationLength() const
00122 {
00123 uint32_t size = 0;
00124 size += ros::serialization::serializationLength(header);
00125 size += ros::serialization::serializationLength(format);
00126 size += ros::serialization::serializationLength(data);
00127 return size;
00128 }
00129
00130 typedef boost::shared_ptr< ::sensor_msgs::CompressedImage_<ContainerAllocator> > Ptr;
00131 typedef boost::shared_ptr< ::sensor_msgs::CompressedImage_<ContainerAllocator> const> ConstPtr;
00132 };
00133 typedef ::sensor_msgs::CompressedImage_<std::allocator<void> > CompressedImage;
00134
00135 typedef boost::shared_ptr< ::sensor_msgs::CompressedImage> CompressedImagePtr;
00136 typedef boost::shared_ptr< ::sensor_msgs::CompressedImage const> CompressedImageConstPtr;
00137
00138
00139 template<typename ContainerAllocator>
00140 std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::CompressedImage_<ContainerAllocator> & v)
00141 {
00142 ros::message_operations::Printer< ::sensor_msgs::CompressedImage_<ContainerAllocator> >::stream(s, "", v);
00143 return s;}
00144
00145 }
00146
00147 namespace ros
00148 {
00149 namespace message_traits
00150 {
00151 template<class ContainerAllocator>
00152 struct MD5Sum< ::sensor_msgs::CompressedImage_<ContainerAllocator> > {
00153 static const char* value()
00154 {
00155 return "8f7a12909da2c9d3332d540a0977563f";
00156 }
00157
00158 static const char* value(const ::sensor_msgs::CompressedImage_<ContainerAllocator> &) { return value(); }
00159 static const uint64_t static_value1 = 0x8f7a12909da2c9d3ULL;
00160 static const uint64_t static_value2 = 0x332d540a0977563fULL;
00161 };
00162
00163 template<class ContainerAllocator>
00164 struct DataType< ::sensor_msgs::CompressedImage_<ContainerAllocator> > {
00165 static const char* value()
00166 {
00167 return "sensor_msgs/CompressedImage";
00168 }
00169
00170 static const char* value(const ::sensor_msgs::CompressedImage_<ContainerAllocator> &) { return value(); }
00171 };
00172
00173 template<class ContainerAllocator>
00174 struct Definition< ::sensor_msgs::CompressedImage_<ContainerAllocator> > {
00175 static const char* value()
00176 {
00177 return "# This message contains a compressed image\n\
00178 \n\
00179 Header header # Header timestamp should be acquisition time of image\n\
00180 # Header frame_id should be optical frame of camera\n\
00181 # origin of frame should be optical center of cameara\n\
00182 # +x should point to the right in the image\n\
00183 # +y should point down in the image\n\
00184 # +z should point into to plane of the image\n\
00185 \n\
00186 string format # Specifies the format of the data\n\
00187 # Acceptable values:\n\
00188 # jpeg, png\n\
00189 uint8[] data # Compressed image buffer\n\
00190 \n\
00191 ================================================================================\n\
00192 MSG: std_msgs/Header\n\
00193 # Standard metadata for higher-level stamped data types.\n\
00194 # This is generally used to communicate timestamped data \n\
00195 # in a particular coordinate frame.\n\
00196 # \n\
00197 # sequence ID: consecutively increasing ID \n\
00198 uint32 seq\n\
00199 #Two-integer timestamp that is expressed as:\n\
00200 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00201 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00202 # time-handling sugar is provided by the client library\n\
00203 time stamp\n\
00204 #Frame this data is associated with\n\
00205 # 0: no frame\n\
00206 # 1: global frame\n\
00207 string frame_id\n\
00208 \n\
00209 ";
00210 }
00211
00212 static const char* value(const ::sensor_msgs::CompressedImage_<ContainerAllocator> &) { return value(); }
00213 };
00214
00215 template<class ContainerAllocator> struct HasHeader< ::sensor_msgs::CompressedImage_<ContainerAllocator> > : public TrueType {};
00216 template<class ContainerAllocator> struct HasHeader< const ::sensor_msgs::CompressedImage_<ContainerAllocator> > : public TrueType {};
00217 }
00218 }
00219
00220 namespace ros
00221 {
00222 namespace serialization
00223 {
00224
00225 template<class ContainerAllocator> struct Serializer< ::sensor_msgs::CompressedImage_<ContainerAllocator> >
00226 {
00227 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00228 {
00229 stream.next(m.header);
00230 stream.next(m.format);
00231 stream.next(m.data);
00232 }
00233
00234 ROS_DECLARE_ALLINONE_SERIALIZER;
00235 };
00236 }
00237 }
00238
00239 namespace ros
00240 {
00241 namespace message_operations
00242 {
00243
00244 template<class ContainerAllocator>
00245 struct Printer< ::sensor_msgs::CompressedImage_<ContainerAllocator> >
00246 {
00247 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::sensor_msgs::CompressedImage_<ContainerAllocator> & v)
00248 {
00249 s << indent << "header: ";
00250 s << std::endl;
00251 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00252 s << indent << "format: ";
00253 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.format);
00254 s << indent << "data[]" << std::endl;
00255 for (size_t i = 0; i < v.data.size(); ++i)
00256 {
00257 s << indent << " data[" << i << "]: ";
00258 Printer<uint8_t>::stream(s, indent + " ", v.data[i]);
00259 }
00260 }
00261 };
00262
00263
00264 }
00265 }
00266
00267 #endif // SENSOR_MSGS_MESSAGE_COMPRESSEDIMAGE_H
00268