Point Cloud Library (PCL)  1.6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Image.h
Go to the documentation of this file.
1 #ifndef PCL_MESSAGE_IMAGE_H
2 #define PCL_MESSAGE_IMAGE_H
3 #include <string>
4 #include <vector>
5 #include <ostream>
6 
7 // Include the correct Header path here
8 #include "std_msgs/Header.h"
9 
10 namespace sensor_msgs
11 {
12  struct Image
13  {
14  Image () : header (), height (0), width (0), encoding (),
15  is_bigendian (0), step (0), data ()
16  {}
17 
19 
20  pcl::uint32_t height;
21  pcl::uint32_t width;
22  std::string encoding;
23 
24  pcl::uint8_t is_bigendian;
25  pcl::uint32_t step;
26 
27  std::vector<pcl::uint8_t> data;
28 
29  typedef boost::shared_ptr< ::sensor_msgs::Image> Ptr;
30  typedef boost::shared_ptr< ::sensor_msgs::Image const> ConstPtr;
31  }; // struct Image
32 
33  typedef boost::shared_ptr< ::sensor_msgs::Image> ImagePtr;
34  typedef boost::shared_ptr< ::sensor_msgs::Image const> ImageConstPtr;
35 
36  inline std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::Image & v)
37  {
38  s << "header: " << std::endl;
39  s << v.header;
40  s << "height: ";
41  s << " " << v.height << std::endl;
42  s << "width: ";
43  s << " " << v.width << std::endl;
44  s << "encoding: ";
45  s << " " << v.encoding << std::endl;
46  s << "is_bigendian: ";
47  s << " " << v.is_bigendian << std::endl;
48  s << "step: ";
49  s << " " << v.step << std::endl;
50  s << "data[]" << std::endl;
51  for (size_t i = 0; i < v.data.size (); ++i)
52  {
53  s << " data[" << i << "]: ";
54  s << " " << v.data[i] << std::endl;
55  }
56  return (s);
57  }
58 } // namespace sensor_msgs
59 
60 #endif // PCL_MESSAGE_IMAGE_H
61