00001
00002
00003 package ros.pkg.std_msgs.msg;
00004
00005 import java.nio.ByteBuffer;
00006
00007 public class MultiArrayLayout extends ros.communication.Message {
00008
00009 public java.util.ArrayList<ros.pkg.std_msgs.msg.MultiArrayDimension> dim = new java.util.ArrayList<ros.pkg.std_msgs.msg.MultiArrayDimension>();
00010 public long data_offset;
00011
00012 public MultiArrayLayout() {
00013 }
00014
00015 public static java.lang.String __s_getDataType() { return "std_msgs/MultiArrayLayout"; }
00016 public java.lang.String getDataType() { return __s_getDataType(); }
00017 public static java.lang.String __s_getMD5Sum() { return "0fed2a11c13e11c5571b4e2a995a91a3"; }
00018 public java.lang.String getMD5Sum() { return __s_getMD5Sum(); }
00019 public static java.lang.String __s_getMessageDefinition() { return "# The multiarray declares a generic multi-dimensional array of a\n" +
00020 "# particular data type. Dimensions are ordered from outer most\n" +
00021 "# to inner most.\n" +
00022 "\n" +
00023 "MultiArrayDimension[] dim # Array of dimension properties\n" +
00024 "uint32 data_offset # padding bytes at front of data\n" +
00025 "\n" +
00026 "# Accessors should ALWAYS be written in terms of dimension stride\n" +
00027 "# and specified outer-most dimension first.\n" +
00028 "# \n" +
00029 "# multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]\n" +
00030 "#\n" +
00031 "# A standard, 3-channel 640x480 image with interleaved color channels\n" +
00032 "# would be specified as:\n" +
00033 "#\n" +
00034 "# dim[0].label = \"height\"\n" +
00035 "# dim[0].size = 480\n" +
00036 "# dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image)\n" +
00037 "# dim[1].label = \"width\"\n" +
00038 "# dim[1].size = 640\n" +
00039 "# dim[1].stride = 3*640 = 1920\n" +
00040 "# dim[2].label = \"channel\"\n" +
00041 "# dim[2].size = 3\n" +
00042 "# dim[2].stride = 3\n" +
00043 "#\n" +
00044 "# multiarray(i,j,k) refers to the ith row, jth column, and kth channel.\n" +
00045 "================================================================================\n" +
00046 "MSG: std_msgs/MultiArrayDimension\n" +
00047 "string label # label of given dimension\n" +
00048 "uint32 size # size of given dimension (in type units)\n" +
00049 "uint32 stride # stride of given dimension\n" +
00050 ""; }
00051 public java.lang.String getMessageDefinition() { return __s_getMessageDefinition(); }
00052
00053 public MultiArrayLayout clone() {
00054 MultiArrayLayout c = new MultiArrayLayout();
00055 c.deserialize(serialize(0));
00056 return c;
00057 }
00058
00059 public void setTo(ros.communication.Message m) {
00060 deserialize(m.serialize(0));
00061 }
00062
00063 public int serializationLength() {
00064 int __l = 0;
00065 __l += 4;
00066 for(ros.pkg.std_msgs.msg.MultiArrayDimension val : dim) {
00067 __l += val.serializationLength();
00068 }
00069 __l += 4;
00070 return __l;
00071 }
00072
00073 public void serialize(ByteBuffer bb, int seq) {
00074 bb.putInt(dim.size());
00075 for(ros.pkg.std_msgs.msg.MultiArrayDimension val : dim) {
00076 val.serialize(bb, seq);
00077 }
00078 bb.putInt((int)data_offset);
00079 }
00080
00081 public void deserialize(ByteBuffer bb) {
00082
00083 int __dim_len = bb.getInt();
00084 dim = new java.util.ArrayList<ros.pkg.std_msgs.msg.MultiArrayDimension>(__dim_len);
00085 for(int __i=0; __i<__dim_len; __i++) {
00086 ros.pkg.std_msgs.msg.MultiArrayDimension __tmp = new ros.pkg.std_msgs.msg.MultiArrayDimension();
00087 __tmp.deserialize(bb);
00088 dim.add(__tmp);;
00089 }
00090 data_offset = (long)(bb.getInt() & 0xffffffff);
00091 }
00092
00093 @SuppressWarnings("all")
00094 public boolean equals(Object o) {
00095 if(!(o instanceof MultiArrayLayout))
00096 return false;
00097 MultiArrayLayout other = (MultiArrayLayout) o;
00098 return
00099 dim.equals(other.dim) &&
00100 data_offset == other.data_offset &&
00101 true;
00102 }
00103
00104 @SuppressWarnings("all")
00105 public int hashCode() {
00106 final int prime = 31;
00107 int result = 1;
00108 long tmp;
00109 result = prime * result + (this.dim == null ? 0 : this.dim.hashCode());
00110 result = prime * result + (int)(this.data_offset ^ (this.data_offset >>> 32));
00111 return result;
00112 }
00113 }
00114