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