00001
00002
00003 package ros.pkg.sensor_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class Image extends ros.communication.Message {
00008
00009 public ros.pkg.std_msgs.msg.Header header = new ros.pkg.std_msgs.msg.Header();
00010 public long height;
00011 public long width;
00012 public java.lang.String encoding = new java.lang.String();
00013 public short is_bigendian;
00014 public long step;
00015 public short[] data = new short[0];
00016
00017 public Image() {
00018 }
00019
00020 public static java.lang.String __s_getDataType() { return "sensor_msgs/Image"; }
00021 public java.lang.String getDataType() { return __s_getDataType(); }
00022 public static java.lang.String __s_getMD5Sum() { return "060021388200f6f0f447d0fcd9c64743"; }
00023 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00024 public static java.lang.String __s_getMessageDefinition() { return "# This message contains an uncompressed image\n" +
00025 "# (0, 0) is at top-left corner of image\n" +
00026 "#\n" +
00027 "\n" +
00028 "Header header # Header timestamp should be acquisition time of image\n" +
00029 " # Header frame_id should be optical frame of camera\n" +
00030 " # origin of frame should be optical center of cameara\n" +
00031 " # +x should point to the right in the image\n" +
00032 " # +y should point down in the image\n" +
00033 " # +z should point into to plane of the image\n" +
00034 " # If the frame_id here and the frame_id of the CameraInfo\n" +
00035 " # message associated with the image conflict\n" +
00036 " # the behavior is undefined\n" +
00037 "\n" +
00038 "uint32 height # image height, that is, number of rows\n" +
00039 "uint32 width # image width, that is, number of columns\n" +
00040 "\n" +
00041 "# The legal values for encoding are in file src/image_encodings.cpp\n" +
00042 "# If you want to standardize a new string format, join\n" +
00043 "# ros-users@lists.sourceforge.net and send an email proposing a new encoding.\n" +
00044 "\n" +
00045 "string encoding # Encoding of pixels -- channel meaning, ordering, size\n" +
00046 " # taken from the list of strings in src/image_encodings.cpp\n" +
00047 "\n" +
00048 "uint8 is_bigendian # is this data bigendian?\n" +
00049 "uint32 step # Full row length in bytes\n" +
00050 "uint8[] data # actual matrix data, size is (step * rows)\n" +
00051 "\n" +
00052 "================================================================================\n" +
00053 "MSG: std_msgs/Header\n" +
00054 "# Standard metadata for higher-level stamped data types.\n" +
00055 "# This is generally used to communicate timestamped data \n" +
00056 "# in a particular coordinate frame.\n" +
00057 "# \n" +
00058 "# sequence ID: consecutively increasing ID \n" +
00059 "uint32 seq\n" +
00060 "#Two-integer timestamp that is expressed as:\n" +
00061 "# * stamp.secs: seconds (stamp_secs) since epoch\n" +
00062 "# * stamp.nsecs: nanoseconds since stamp_secs\n" +
00063 "# time-handling sugar is provided by the client library\n" +
00064 "time stamp\n" +
00065 "#Frame this data is associated with\n" +
00066 "# 0: no frame\n" +
00067 "# 1: global frame\n" +
00068 "string frame_id\n" +
00069 "\n" +
00070 ""; }
00071 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00072
00073 public Image clone() {
00074 Image c = new Image();
00075 c.deserialize(serialize(0));
00076 return c;
00077 }
00078
00079 public void setTo(ros.communication.Message m) {
00080 deserialize(m.serialize(0));
00081 }
00082
00083 public int serializationLength() {
00084 int __l = 0;
00085 __l += header.serializationLength();
00086 __l += 4;
00087 __l += 4;
00088 __l += 4 + encoding.length();
00089 __l += 1;
00090 __l += 4;
00091 __l += 4 + data.length * 1;
00092 return __l;
00093 }
00094
00095 public void serialize(ByteBuffer bb, int seq) {
00096 header.serialize(bb, seq);
00097 bb.putInt((int)height);
00098 bb.putInt((int)width);
00099 Serialization.writeString(bb, encoding);
00100 bb.put((byte)is_bigendian);
00101 bb.putInt((int)step);
00102 bb.putInt(data.length);
00103 for(short val : data) {
00104 bb.put((byte)val);
00105 }
00106 }
00107
00108 public void deserialize(ByteBuffer bb) {
00109 header.deserialize(bb);
00110 height = (long)(bb.getInt() & 0xffffffff);
00111 width = (long)(bb.getInt() & 0xffffffff);
00112 encoding = Serialization.readString(bb);
00113 is_bigendian = (short)(bb.get() & 0xff);
00114 step = (long)(bb.getInt() & 0xffffffff);
00115
00116 int __data_len = bb.getInt();
00117 data = new short[__data_len];
00118 for(int __i=0; __i<__data_len; __i++) {
00119 data[__i] = (short)(bb.get() & 0xff);
00120 }
00121 }
00122
00123 @SuppressWarnings("all")
00124 public boolean equals(Object o) {
00125 if(!(o instanceof Image))
00126 return false;
00127 Image other = (Image) o;
00128 return
00129 header.equals(other.header) &&
00130 height == other.height &&
00131 width == other.width &&
00132 encoding.equals(other.encoding) &&
00133 is_bigendian == other.is_bigendian &&
00134 step == other.step &&
00135 java.util.Arrays.equals(data, other.data) &&
00136 true;
00137 }
00138
00139 @SuppressWarnings("all")
00140 public int hashCode() {
00141 final int prime = 31;
00142 int result = 1;
00143 long tmp;
00144 result = prime * result + (this.header == null ? 0 : this.header.hashCode());
00145 result = prime * result + (int)(this.height ^ (this.height >>> 32));
00146 result = prime * result + (int)(this.width ^ (this.width >>> 32));
00147 result = prime * result + (this.encoding == null ? 0 : this.encoding.hashCode());
00148 result = prime * result + this.is_bigendian;
00149 result = prime * result + (int)(this.step ^ (this.step >>> 32));
00150 result = prime * result + java.util.Arrays.hashCode(this.data);
00151 return result;
00152 }
00153 }
00154