$search
00001 """autogenerated by genmsg_py from RegionOfInterest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class RegionOfInterest(roslib.message.Message): 00007 _md5sum = "bdb633039d588fcccb441a4d43ccfe09" 00008 _type = "sensor_msgs/RegionOfInterest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# This message is used to specify a region of interest within an image. 00011 # 00012 # When used to specify the ROI setting of the camera when the image was 00013 # taken, the height and width fields should either match the height and 00014 # width fields for the associated image; or height = width = 0 00015 # indicates that the full resolution image was captured. 00016 00017 uint32 x_offset # Leftmost pixel of the ROI 00018 # (0 if the ROI includes the left edge of the image) 00019 uint32 y_offset # Topmost pixel of the ROI 00020 # (0 if the ROI includes the top edge of the image) 00021 uint32 height # Height of ROI 00022 uint32 width # Width of ROI 00023 00024 # True if a distinct rectified ROI should be calculated from the "raw" 00025 # ROI in this message. Typically this should be False if the full image 00026 # is captured (ROI not used), and True if a subwindow is captured (ROI 00027 # used). 00028 bool do_rectify 00029 00030 """ 00031 __slots__ = ['x_offset','y_offset','height','width','do_rectify'] 00032 _slot_types = ['uint32','uint32','uint32','uint32','bool'] 00033 00034 def __init__(self, *args, **kwds): 00035 """ 00036 Constructor. Any message fields that are implicitly/explicitly 00037 set to None will be assigned a default value. The recommend 00038 use is keyword arguments as this is more robust to future message 00039 changes. You cannot mix in-order arguments and keyword arguments. 00040 00041 The available fields are: 00042 x_offset,y_offset,height,width,do_rectify 00043 00044 @param args: complete set of field values, in .msg order 00045 @param kwds: use keyword arguments corresponding to message field names 00046 to set specific fields. 00047 """ 00048 if args or kwds: 00049 super(RegionOfInterest, self).__init__(*args, **kwds) 00050 #message fields cannot be None, assign default values for those that are 00051 if self.x_offset is None: 00052 self.x_offset = 0 00053 if self.y_offset is None: 00054 self.y_offset = 0 00055 if self.height is None: 00056 self.height = 0 00057 if self.width is None: 00058 self.width = 0 00059 if self.do_rectify is None: 00060 self.do_rectify = False 00061 else: 00062 self.x_offset = 0 00063 self.y_offset = 0 00064 self.height = 0 00065 self.width = 0 00066 self.do_rectify = False 00067 00068 def _get_types(self): 00069 """ 00070 internal API method 00071 """ 00072 return self._slot_types 00073 00074 def serialize(self, buff): 00075 """ 00076 serialize message into buffer 00077 @param buff: buffer 00078 @type buff: StringIO 00079 """ 00080 try: 00081 _x = self 00082 buff.write(_struct_4IB.pack(_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify)) 00083 except struct.error as se: self._check_types(se) 00084 except TypeError as te: self._check_types(te) 00085 00086 def deserialize(self, str): 00087 """ 00088 unpack serialized message in str into this message instance 00089 @param str: byte array of serialized message 00090 @type str: str 00091 """ 00092 try: 00093 end = 0 00094 _x = self 00095 start = end 00096 end += 17 00097 (_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify,) = _struct_4IB.unpack(str[start:end]) 00098 self.do_rectify = bool(self.do_rectify) 00099 return self 00100 except struct.error as e: 00101 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00102 00103 00104 def serialize_numpy(self, buff, numpy): 00105 """ 00106 serialize message with numpy array types into buffer 00107 @param buff: buffer 00108 @type buff: StringIO 00109 @param numpy: numpy python module 00110 @type numpy module 00111 """ 00112 try: 00113 _x = self 00114 buff.write(_struct_4IB.pack(_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify)) 00115 except struct.error as se: self._check_types(se) 00116 except TypeError as te: self._check_types(te) 00117 00118 def deserialize_numpy(self, str, numpy): 00119 """ 00120 unpack serialized message in str into this message instance using numpy for array types 00121 @param str: byte array of serialized message 00122 @type str: str 00123 @param numpy: numpy python module 00124 @type numpy: module 00125 """ 00126 try: 00127 end = 0 00128 _x = self 00129 start = end 00130 end += 17 00131 (_x.x_offset, _x.y_offset, _x.height, _x.width, _x.do_rectify,) = _struct_4IB.unpack(str[start:end]) 00132 self.do_rectify = bool(self.do_rectify) 00133 return self 00134 except struct.error as e: 00135 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00136 00137 _struct_I = roslib.message.struct_I 00138 _struct_4IB = struct.Struct("<4IB")