00001
00002 #ifndef SENSOR_MSGS_MESSAGE_IMAGE_H
00003 #define SENSOR_MSGS_MESSAGE_IMAGE_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 Image_ : public ros::Message
00019 {
00020 typedef Image_<ContainerAllocator> Type;
00021
00022 Image_()
00023 : header()
00024 , height(0)
00025 , width(0)
00026 , encoding()
00027 , is_bigendian(0)
00028 , step(0)
00029 , data()
00030 {
00031 }
00032
00033 Image_(const ContainerAllocator& _alloc)
00034 : header(_alloc)
00035 , height(0)
00036 , width(0)
00037 , encoding(_alloc)
00038 , is_bigendian(0)
00039 , step(0)
00040 , data(_alloc)
00041 {
00042 }
00043
00044 typedef ::std_msgs::Header_<ContainerAllocator> _header_type;
00045 ::std_msgs::Header_<ContainerAllocator> header;
00046
00047 typedef uint32_t _height_type;
00048 uint32_t height;
00049
00050 typedef uint32_t _width_type;
00051 uint32_t width;
00052
00053 typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _encoding_type;
00054 std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > encoding;
00055
00056 typedef uint8_t _is_bigendian_type;
00057 uint8_t is_bigendian;
00058
00059 typedef uint32_t _step_type;
00060 uint32_t step;
00061
00062 typedef std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > _data_type;
00063 std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > data;
00064
00065
00066 ROS_DEPRECATED uint32_t get_data_size() const { return (uint32_t)data.size(); }
00067 ROS_DEPRECATED void set_data_size(uint32_t size) { data.resize((size_t)size); }
00068 ROS_DEPRECATED void get_data_vec(std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) const { vec = this->data; }
00069 ROS_DEPRECATED void set_data_vec(const std::vector<uint8_t, typename ContainerAllocator::template rebind<uint8_t>::other > & vec) { this->data = vec; }
00070 private:
00071 static const char* __s_getDataType_() { return "sensor_msgs/Image"; }
00072 public:
00073 ROS_DEPRECATED static const std::string __s_getDataType() { return __s_getDataType_(); }
00074
00075 ROS_DEPRECATED const std::string __getDataType() const { return __s_getDataType_(); }
00076
00077 private:
00078 static const char* __s_getMD5Sum_() { return "060021388200f6f0f447d0fcd9c64743"; }
00079 public:
00080 ROS_DEPRECATED static const std::string __s_getMD5Sum() { return __s_getMD5Sum_(); }
00081
00082 ROS_DEPRECATED const std::string __getMD5Sum() const { return __s_getMD5Sum_(); }
00083
00084 private:
00085 static const char* __s_getMessageDefinition_() { return "# This message contains an uncompressed image\n\
00086 # (0, 0) is at top-left corner of image\n\
00087 #\n\
00088 \n\
00089 Header header # Header timestamp should be acquisition time of image\n\
00090 # Header frame_id should be optical frame of camera\n\
00091 # origin of frame should be optical center of cameara\n\
00092 # +x should point to the right in the image\n\
00093 # +y should point down in the image\n\
00094 # +z should point into to plane of the image\n\
00095 # If the frame_id here and the frame_id of the CameraInfo\n\
00096 # message associated with the image conflict\n\
00097 # the behavior is undefined\n\
00098 \n\
00099 uint32 height # image height, that is, number of rows\n\
00100 uint32 width # image width, that is, number of columns\n\
00101 \n\
00102 # The legal values for encoding are in file src/image_encodings.cpp\n\
00103 # If you want to standardize a new string format, join\n\
00104 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n\
00105 \n\
00106 string encoding # Encoding of pixels -- channel meaning, ordering, size\n\
00107 # taken from the list of strings in src/image_encodings.cpp\n\
00108 \n\
00109 uint8 is_bigendian # is this data bigendian?\n\
00110 uint32 step # Full row length in bytes\n\
00111 uint8[] data # actual matrix data, size is (step * rows)\n\
00112 \n\
00113 ================================================================================\n\
00114 MSG: std_msgs/Header\n\
00115 # Standard metadata for higher-level stamped data types.\n\
00116 # This is generally used to communicate timestamped data \n\
00117 # in a particular coordinate frame.\n\
00118 # \n\
00119 # sequence ID: consecutively increasing ID \n\
00120 uint32 seq\n\
00121 #Two-integer timestamp that is expressed as:\n\
00122 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00123 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00124 # time-handling sugar is provided by the client library\n\
00125 time stamp\n\
00126 #Frame this data is associated with\n\
00127 # 0: no frame\n\
00128 # 1: global frame\n\
00129 string frame_id\n\
00130 \n\
00131 "; }
00132 public:
00133 ROS_DEPRECATED static const std::string __s_getMessageDefinition() { return __s_getMessageDefinition_(); }
00134
00135 ROS_DEPRECATED const std::string __getMessageDefinition() const { return __s_getMessageDefinition_(); }
00136
00137 ROS_DEPRECATED virtual uint8_t *serialize(uint8_t *write_ptr, uint32_t seq) const
00138 {
00139 ros::serialization::OStream stream(write_ptr, 1000000000);
00140 ros::serialization::serialize(stream, header);
00141 ros::serialization::serialize(stream, height);
00142 ros::serialization::serialize(stream, width);
00143 ros::serialization::serialize(stream, encoding);
00144 ros::serialization::serialize(stream, is_bigendian);
00145 ros::serialization::serialize(stream, step);
00146 ros::serialization::serialize(stream, data);
00147 return stream.getData();
00148 }
00149
00150 ROS_DEPRECATED virtual uint8_t *deserialize(uint8_t *read_ptr)
00151 {
00152 ros::serialization::IStream stream(read_ptr, 1000000000);
00153 ros::serialization::deserialize(stream, header);
00154 ros::serialization::deserialize(stream, height);
00155 ros::serialization::deserialize(stream, width);
00156 ros::serialization::deserialize(stream, encoding);
00157 ros::serialization::deserialize(stream, is_bigendian);
00158 ros::serialization::deserialize(stream, step);
00159 ros::serialization::deserialize(stream, data);
00160 return stream.getData();
00161 }
00162
00163 ROS_DEPRECATED virtual uint32_t serializationLength() const
00164 {
00165 uint32_t size = 0;
00166 size += ros::serialization::serializationLength(header);
00167 size += ros::serialization::serializationLength(height);
00168 size += ros::serialization::serializationLength(width);
00169 size += ros::serialization::serializationLength(encoding);
00170 size += ros::serialization::serializationLength(is_bigendian);
00171 size += ros::serialization::serializationLength(step);
00172 size += ros::serialization::serializationLength(data);
00173 return size;
00174 }
00175
00176 typedef boost::shared_ptr< ::sensor_msgs::Image_<ContainerAllocator> > Ptr;
00177 typedef boost::shared_ptr< ::sensor_msgs::Image_<ContainerAllocator> const> ConstPtr;
00178 };
00179 typedef ::sensor_msgs::Image_<std::allocator<void> > Image;
00180
00181 typedef boost::shared_ptr< ::sensor_msgs::Image> ImagePtr;
00182 typedef boost::shared_ptr< ::sensor_msgs::Image const> ImageConstPtr;
00183
00184
00185 template<typename ContainerAllocator>
00186 std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::Image_<ContainerAllocator> & v)
00187 {
00188 ros::message_operations::Printer< ::sensor_msgs::Image_<ContainerAllocator> >::stream(s, "", v);
00189 return s;}
00190
00191 }
00192
00193 namespace ros
00194 {
00195 namespace message_traits
00196 {
00197 template<class ContainerAllocator>
00198 struct MD5Sum< ::sensor_msgs::Image_<ContainerAllocator> > {
00199 static const char* value()
00200 {
00201 return "060021388200f6f0f447d0fcd9c64743";
00202 }
00203
00204 static const char* value(const ::sensor_msgs::Image_<ContainerAllocator> &) { return value(); }
00205 static const uint64_t static_value1 = 0x060021388200f6f0ULL;
00206 static const uint64_t static_value2 = 0xf447d0fcd9c64743ULL;
00207 };
00208
00209 template<class ContainerAllocator>
00210 struct DataType< ::sensor_msgs::Image_<ContainerAllocator> > {
00211 static const char* value()
00212 {
00213 return "sensor_msgs/Image";
00214 }
00215
00216 static const char* value(const ::sensor_msgs::Image_<ContainerAllocator> &) { return value(); }
00217 };
00218
00219 template<class ContainerAllocator>
00220 struct Definition< ::sensor_msgs::Image_<ContainerAllocator> > {
00221 static const char* value()
00222 {
00223 return "# This message contains an uncompressed image\n\
00224 # (0, 0) is at top-left corner of image\n\
00225 #\n\
00226 \n\
00227 Header header # Header timestamp should be acquisition time of image\n\
00228 # Header frame_id should be optical frame of camera\n\
00229 # origin of frame should be optical center of cameara\n\
00230 # +x should point to the right in the image\n\
00231 # +y should point down in the image\n\
00232 # +z should point into to plane of the image\n\
00233 # If the frame_id here and the frame_id of the CameraInfo\n\
00234 # message associated with the image conflict\n\
00235 # the behavior is undefined\n\
00236 \n\
00237 uint32 height # image height, that is, number of rows\n\
00238 uint32 width # image width, that is, number of columns\n\
00239 \n\
00240 # The legal values for encoding are in file src/image_encodings.cpp\n\
00241 # If you want to standardize a new string format, join\n\
00242 # ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n\
00243 \n\
00244 string encoding # Encoding of pixels -- channel meaning, ordering, size\n\
00245 # taken from the list of strings in src/image_encodings.cpp\n\
00246 \n\
00247 uint8 is_bigendian # is this data bigendian?\n\
00248 uint32 step # Full row length in bytes\n\
00249 uint8[] data # actual matrix data, size is (step * rows)\n\
00250 \n\
00251 ================================================================================\n\
00252 MSG: std_msgs/Header\n\
00253 # Standard metadata for higher-level stamped data types.\n\
00254 # This is generally used to communicate timestamped data \n\
00255 # in a particular coordinate frame.\n\
00256 # \n\
00257 # sequence ID: consecutively increasing ID \n\
00258 uint32 seq\n\
00259 #Two-integer timestamp that is expressed as:\n\
00260 # * stamp.secs: seconds (stamp_secs) since epoch\n\
00261 # * stamp.nsecs: nanoseconds since stamp_secs\n\
00262 # time-handling sugar is provided by the client library\n\
00263 time stamp\n\
00264 #Frame this data is associated with\n\
00265 # 0: no frame\n\
00266 # 1: global frame\n\
00267 string frame_id\n\
00268 \n\
00269 ";
00270 }
00271
00272 static const char* value(const ::sensor_msgs::Image_<ContainerAllocator> &) { return value(); }
00273 };
00274
00275 template<class ContainerAllocator> struct HasHeader< ::sensor_msgs::Image_<ContainerAllocator> > : public TrueType {};
00276 template<class ContainerAllocator> struct HasHeader< const ::sensor_msgs::Image_<ContainerAllocator> > : public TrueType {};
00277 }
00278 }
00279
00280 namespace ros
00281 {
00282 namespace serialization
00283 {
00284
00285 template<class ContainerAllocator> struct Serializer< ::sensor_msgs::Image_<ContainerAllocator> >
00286 {
00287 template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m)
00288 {
00289 stream.next(m.header);
00290 stream.next(m.height);
00291 stream.next(m.width);
00292 stream.next(m.encoding);
00293 stream.next(m.is_bigendian);
00294 stream.next(m.step);
00295 stream.next(m.data);
00296 }
00297
00298 ROS_DECLARE_ALLINONE_SERIALIZER;
00299 };
00300 }
00301 }
00302
00303 namespace ros
00304 {
00305 namespace message_operations
00306 {
00307
00308 template<class ContainerAllocator>
00309 struct Printer< ::sensor_msgs::Image_<ContainerAllocator> >
00310 {
00311 template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::sensor_msgs::Image_<ContainerAllocator> & v)
00312 {
00313 s << indent << "header: ";
00314 s << std::endl;
00315 Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header);
00316 s << indent << "height: ";
00317 Printer<uint32_t>::stream(s, indent + " ", v.height);
00318 s << indent << "width: ";
00319 Printer<uint32_t>::stream(s, indent + " ", v.width);
00320 s << indent << "encoding: ";
00321 Printer<std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > >::stream(s, indent + " ", v.encoding);
00322 s << indent << "is_bigendian: ";
00323 Printer<uint8_t>::stream(s, indent + " ", v.is_bigendian);
00324 s << indent << "step: ";
00325 Printer<uint32_t>::stream(s, indent + " ", v.step);
00326 s << indent << "data[]" << std::endl;
00327 for (size_t i = 0; i < v.data.size(); ++i)
00328 {
00329 s << indent << " data[" << i << "]: ";
00330 Printer<uint8_t>::stream(s, indent + " ", v.data[i]);
00331 }
00332 }
00333 };
00334
00335
00336 }
00337 }
00338
00339 #endif // SENSOR_MSGS_MESSAGE_IMAGE_H
00340