bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | [[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | 28,100 |
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | [[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | 28,101 |
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | [[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | 28,102 |
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | [[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | 28,103 |
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v... | [[def output_file.write('\n') output_file.close() switch(layer, output_file.write('\n') output_file.close() args)]] output_file.write('\n') output_file.close() switch(get_image_combination([[images[layer].name]], output_file.write('\n') output_file.close() cc_type)) output_file.write('\n') output_file.close() { output_... | 28,104 |
def restore_import(): global std_import __builtins__['__import__'] = std_import | def restore_import(): global std_import __builtins__['__import__'] = std_import | 28,105 |
#ifndef _MSC_VER void init[[module_name]](void); | #ifndef _MSC_VER void init[[module_name]](void); | 28,106 |
def subimage(self, *args, **kwargs): """Creates a new view that is part of an existing image. | def subimage(self, *args, **kwargs): """Creates a new view that is part of an existing image. | 28,107 |
def table_of_contents(self, classes): s = open(os.path.join(self.docgen.src_path, "classes.txt"), "w") s.write("=======\nClasses\n=======\n\n") s.write("Alphabetical\n-------------\n") self.class_names.sort(lambda x, y: cmp(x.lower(), y.lower())) letter = '~' first = True links = [] for name, combined_name in self.clas... | def table_of_contents(self, classes): s = open(os.path.join(self.docgen.src_path, "classes.txt"), "w") s.write("=======\nClasses\n=======\n\n") s.write("Alphabetical\n-------------\n") self.class_names.sort(lambda x, y: cmp(x[0].lower(), y[0].lower())) letter = '~' first = True links = [] for name, combined_name in sel... | 28,108 |
def has_id_name(self, name): for confidence, id_name in self.id_name: if name == id_name: return 1 return 0 | def has_id_name(self, name): for confidence, id_name in self.id_name: if name == id_name: return 1 return 0 | 28,109 |
def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") self._flags = False if multiple: self._flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file",... | def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") self._flags = False if multiple: self._flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file",... | 28,110 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 28,111 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 28,112 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 28,113 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 28,114 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | deftmp_dc = wxMemoryDC() Draw(self,tmp_dc = wxMemoryDC() grid,tmp_dc = wxMemoryDC() attr,tmp_dc = wxMemoryDC() dc,tmp_dc = wxMemoryDC() rect,tmp_dc = wxMemoryDC() row,tmp_dc = wxMemoryDC() col,tmp_dc = wxMemoryDC() isSelected):tmp_dc = wxMemoryDC() view_starttmp_dc = wxMemoryDC() =tmp_dc = wxMemoryDC() grid.GetViewStar... | 28,115 |
def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | def Draw(self, grid, attr, dc, rect, row, col, isSelected): view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], view_size[1])): return | 28,116 |
def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") self._flags = False if multiple: self._flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file",... | def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") if multiple: self._flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file", cls.last_directory,... | 28,117 |
def PaintArea(self, x, y, w, h, check=1, dc=None): if not self.image: return if dc == None: dc = wxClientDC(self) self.draw_rubber(dc) redraw_rubber = 1 else: redraw_rubber = 0 # This needs to be created every time we call Paint, since its # address can (but in practice usually doesn't) change. tmpdc = wxMemoryDC() | def PaintArea(self, x, y, w, h, check=1, dc=None): if not self.image: return if dc == None: dc = wxClientDC(self) self.draw_rubber(dc) redraw_rubber = 1 else: redraw_rubber = 0 # This needs to be created every time we call Paint, since its # address can (but in practice usually doesn't) change. tmpdc = wxMemoryDC() | 28,118 |
def do_docstring(obj, name): doc_string = inspect.getdoc(obj) if doc_string is None: text = "[Not documented]\n\n" else: text = doc_string + "\n\n" content = docutils.statemachine.string2lines(text, convert_whitespace=1) if not options.has_key('no_title'): title_text = "``%s``" % name textnodes, messages = state.inline... | def do_docstring(obj, name): doc_string = inspect.getdoc(obj) if doc_string is None: text = "[Not documented]\n\n" else: text = doc_string + "\n\n" content = docutils.statemachine.string2lines(text, convert_whitespace=1) if not options.has_key('no_title'): title_text = "``%s``" % name textnodes, messages = state.inline... | 28,119 |
def do_docstring(obj, name): doc_string = inspect.getdoc(obj) if doc_string is None: text = "[Not documented]\n\n" else: text = doc_string + "\n\n" content = docutils.statemachine.string2lines(text, convert_whitespace=1) if not options.has_key('no_title'): title_text = "``%s``" % name textnodes, messages = state.inline... | def do_docstring(obj, name): doc_string = inspect.getdoc(obj) if doc_string is None: text = "[Not documented]\n\n" else: text = doc_string + "\n\n" content = docutils.statemachine.string2lines(text, convert_whitespace=1) if not options.has_key('no_title'): title_text = "``%s``" % name textnodes, messages = state.inline... | 28,120 |
def __call__(self, *args): if len(args) == 3: return _draw.draw_filled_rect(self, *args) elif len(args) == 2: try: a, value = args return _draw.draw_filled_rect(self, a.ul, a.lr, value) except KeyError, AttributeError: pass elif len(args) == 5: try: y1, x1, y2, x1, value = args result = _draw.draw_filled_rect(self, (x1... | def __call__(self, *args): if len(args) == 3: return _draw.draw_filled_rect(self, *args) elif len(args) == 2: try: a, value = args return _draw.draw_filled_rect(self, a.ul, a.lr, value) except KeyError, AttributeError: pass elif len(args) == 5: try: y1, x1, y2, x2, value = args result = _draw.draw_filled_rect(self, (x1... | 28,121 |
def focus(self, subimages): scroll_amount = self.scroll_amount if not util.is_sequence(subimages): subimages = (subimages,) x1 = y1 = maxint x2 = y2 = 0 # Get a combined rectangle of all images in the list for image in subimages: x1 = min(image.page_offset_x(), x1) y1 = min(image.page_offset_y(), y1) x2 = max(image.pag... | def focus(self, subimages): scroll_amount = self.scroll_amount if not util.is_sequence(subimages): subimages = (subimages,) x1 = y1 = maxint x2 = y2 = 0 # Get a combined rectangle of all images in the list for image in subimages: x1 = min(image.page_offset_x(), x1) y1 = min(image.page_offset_y(), y1) x2 = max(image.pag... | 28,122 |
def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - se... | def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - self.Ge... | 28,123 |
def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - se... | def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 origin = [x * self.scroll_amount for x in self.GetViewStart()] x = max(min(origin[0] * scale / scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetView... | 28,124 |
def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - se... | def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(origin[1] * scale / scaling + 1, h - self.GetSize().y) - ... | 28,125 |
def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - se... | def scale(self, scale=None): scroll_amount = self.scroll_amount if scale == None: scale = self.scaling w = self.width * scale - 1 h = self.height * scale - 1 x = max(min(self.GetViewStart()[0] * scale / self.scaling + 1, w - self.GetSize().x) - 2, 0) y = max(min(self.GetViewStart()[1] * scale / self.scaling + 1, h - se... | 28,126 |
def OnResize(self, event): size = self.GetSize() self.tmpDC.SelectObject(wxEmptyBitmap( size.GetWidth(), size.GetHeight())) self.tmpDC.SetPen(wxTRANSPARENT_PEN) event.Skip() self.scale() | def OnResize(self, event): size = self.GetSize() self.tmpDC.SelectObject(wxEmptyBitmap( size.GetWidth(), size.GetHeight())) self.tmpDC.SetPen(wxTRANSPARENT_PEN) event.Skip() self.scale() | 28,127 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h < origin_... | 28,128 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | 28,129 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | 28,130 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | 28,131 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / self.scaling for a in origin] size_scaled = [a / self.scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0]) and (y + h... | 28,132 |
def OnLeftDown(self, event): self.rubber_on = 1 self.draw_rubber() origin = self.GetViewStart() x = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) y = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) if (x > self.rubber_origin_x and x < self.rubber_origin_x + self.block_w): sel... | def OnLeftDown(self, event): self.rubber_on = 1 self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] x = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) y = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) if (x > self.rubber_origin_x and x < self.ru... | 28,133 |
def OnLeftDown(self, event): self.rubber_on = 1 self.draw_rubber() origin = self.GetViewStart() x = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) y = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) if (x > self.rubber_origin_x and x < self.rubber_origin_x + self.block_w): sel... | def OnLeftDown(self, event): self.rubber_on = 1 self.draw_rubber() origin = self.GetViewStart() x = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) y = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) if (x > self.rubber_origin_x and x < self.rubber_origin_x + self.block_w): sel... | 28,134 |
def OnLeftUp(self, event): if self.rubber_on: self.draw_rubber() origin = self.GetViewStart() self.rubber_x2 = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) self.rubber_y2 = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) self.draw_rubber() for i in self.click_callbacks: try:... | def OnLeftUp(self, event): if self.rubber_on: self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1)) self.rubber_y2 = int(min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1)) self.draw_... | 28,135 |
def draw_rubber(self): dc = wxPaintDC(self) origin = self.GetViewStart() x = min(self.rubber_origin_x, self.rubber_x2) y = min(self.rubber_origin_y, self.rubber_y2) x2 = max(self.rubber_origin_x, self.rubber_x2) y2 = max(self.rubber_origin_y, self.rubber_y2) x = x * self.scaling - origin[0] y = y * self.scaling - origi... | def draw_rubber(self): dc = wxPaintDC(self) scaling = self.scaling origin = [x * self.scroll_amount for x in self.GetViewStart()] x = min(self.rubber_origin_x, self.rubber_x2) y = min(self.rubber_origin_y, self.rubber_y2) x2 = max(self.rubber_origin_x, self.rubber_x2) y2 = max(self.rubber_origin_y, self.rubber_y2) x = ... | 28,136 |
def draw_rubber(self): dc = wxPaintDC(self) origin = self.GetViewStart() x = min(self.rubber_origin_x, self.rubber_x2) y = min(self.rubber_origin_y, self.rubber_y2) x2 = max(self.rubber_origin_x, self.rubber_x2) y2 = max(self.rubber_origin_y, self.rubber_y2) x = x * self.scaling - origin[0] y = y * self.scaling - origi... | def draw_rubber(self): dc = wxPaintDC(self) origin = self.GetViewStart() x = min(self.rubber_origin_x, self.rubber_x2) y = min(self.rubber_origin_y, self.rubber_y2) x2 = max(self.rubber_origin_x, self.rubber_x2) y2 = max(self.rubber_origin_y, self.rubber_y2) x = x * scaling - origin[0] y = y * scaling - origin[1] x2 = ... | 28,137 |
def OnMotion(self, event): if self.rubber_on: self.draw_rubber() origin = self.GetViewStart() self.rubber_x2 = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) self.rubber_y2 = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) self.draw_rubber() if self.dragging: self.Scroll( (sel... | def OnMotion(self, event): if self.rubber_on: self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1)) self.rubber_y2 = int(min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1)) self.draw_... | 28,138 |
def OnMotion(self, event): if self.rubber_on: self.draw_rubber() origin = self.GetViewStart() self.rubber_x2 = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) self.rubber_y2 = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) self.draw_rubber() if self.dragging: self.Scroll( (sel... | def OnMotion(self, event): if self.rubber_on: self.draw_rubber() origin = self.GetViewStart() self.rubber_x2 = min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1) self.rubber_y2 = min((event.GetY() + origin[1]) / self.scaling, self.image.nrows - 1) self.draw_rubber() if self.dragging: self.Scroll( (sel... | 28,139 |
def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``) | def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``) | 28,140 |
def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``) | def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``) | 28,141 |
def strip_features(input_filename, output_filename): """**strip_features** (FileOpen *input_filename*, FileSave *output_filename*) | def strip_features(input_filename, output_filename): """**strip_features** (FileOpen *input_filename*, FileSave *output_filename*) | 28,142 |
def __init__(self, main_win, parent, id, message): | def__init__(self,main_win,parent,id,message): | 28,143 |
def __init__(self, main_win, parent, id, message): | def __init__(self, main_win, parent, id, message): | 28,144 |
def __init__(self, database=[], features='all', perform_splits=True): """ | def __init__(self, database=[], features='all', perform_splits=True): """ | 28,145 |
def _classify_list_automatic(self, glyphs, max_recursion=10, recursion_level=0, progress=None): | def _classify_list_automatic(self, glyphs, max_recursion=10, recursion_level=0, progress=None): | 28,146 |
def _SavePageCollection(self, filename, glyphs=None, with_features=True): if glyphs is None: glyphs = self.multi_iw.id.GetAllItems() self._classifier.generate_features(glyphs) try: gamera_xml.WriteXMLFile( glyphs=glyphs, symbol_table=self._symbol_table, with_features=with_features).write_filename(filename) except gamer... | def _SavePageCollection(self, filename, glyphs=None, with_features=True): if glyphs is None: glyphs = self.multi_iw.id.GetAllItems() for glyph in glyphs: self._classifier.generate_features(glyph) try: gamera_xml.WriteXMLFile( glyphs=glyphs, symbol_table=self._symbol_table, with_features=with_features).write_filename(fi... | 28,147 |
def _OnSaveSelectedGlyphs(self, event): glyphs = self.get_all_selected()[0] if len(glyphs) == 0: gui_util.message("There are no selected glyphs.") return if gui_util.are_you_sure_dialog( ("There are %d selected glyphs.\n" + "Are you sure you want to save?") % len(glyphs)): filename = gui_util.save_file_dialog(self._fra... | def _OnSaveSelectedGlyphs(self, event): glyphs = self.get_all_selected()[0] if len(glyphs) == 0: gui_util.message("There are no selected glyphs.") return if gui_util.are_you_sure_dialog( ("There are %d selected glyphs.\n" + "Are you sure you want to save?") % len(glyphs)): filename = gui_util.save_file_dialog(self._fra... | 28,148 |
def _OnOpenAndSegmentImage(self, event): if self.multi_iw.id.is_dirty: if not gui_util.are_you_sure_dialog("Editing glyphs have not been saved. Are you sure you wish to proceed?"): return segmenters = [x[0] for x in ImageBase.methods_flat_category("Segmentation", ONEBIT)] if self.default_segmenter == -1: self.default_... | def _OnOpenAndSegmentImage(self, event): if self.multi_iw.id.is_dirty: if not gui_util.are_you_sure_dialog("Page glyphs have not been saved. Are you sure you wish to proceed?"): return segmenters = [x[0] for x in ImageBase.methods_flat_category("Segmentation", ONEBIT)] if self.default_segmenter == -1: self.default_seg... | 28,149 |
def _OnSelectAndSegmentImage(self, event): if self.multi_iw.id.is_dirty: if not gui_util.are_you_sure_dialog("Editing glyphs have not been saved. Are you sure you wish to proceed?"): return segmenters = [x[0] for x in ImageBase.methods_flat_category("Segmentation", ONEBIT)] if self.default_segmenter == -1: self.defaul... | def _OnSelectAndSegmentImage(self, event): if self.multi_iw.id.is_dirty: if not gui_util.are_you_sure_dialog("Page glyphs have not been saved. Are you sure you wish to proceed?"): return segmenters = [x[0] for x in ImageBase.methods_flat_category("Segmentation", ONEBIT)] if self.default_segmenter == -1: self.default_s... | 28,150 |
def update(self, num, den): if not self.done: self.progress_box.Update(min(100, int((float(num) / float(den)) * 100.0))) if num >= den: self.done = 1 wxEndBusyCursor() self.progress_box.Destroy() | def update(self, num, den): if not self.done: if num >= den: self.done = 1 wxEndBusyCursor() self.progress_box.Destroy() | 28,151 |
def update(self, num, den): if not self.done: self.progress_box.Update(min(100, int((float(num) / float(den)) * 100.0))) if num >= den: self.done = 1 wxEndBusyCursor() self.progress_box.Destroy() | def update(self, num, den): if not self.done: self.progress_box.Update(min(100, int((float(num) / float(den)) * 100.0))) if num >= den: self.done = True wxEndBusyCursor() self.progress_box.Destroy() | 28,152 |
def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return | def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return | 28,153 |
def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return | def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return | 28,154 |
def add_file(self, file): | defadd_file(self,file): | 28,155 |
def add_file(self, file): | def add_file(self, file): | 28,156 |
def get_config_files(self): | defget_config_files(self): | 28,157 |
def get_config_files(self): | defget_config_files(self): | 28,158 |
def get_config_files(self): | defget_config_files(self): | 28,159 |
def get_config_files(self): | def get_config_files(self): | 28,160 |
def get_config_files(self): | def get_config_files(self): | 28,161 |
def __doc_example1__(): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_filled_rect(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image | def __doc_example1__(): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_filled_rect(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image | 28,162 |
def __call__(self, *args): if len(args) == 9: return _draw.draw_bezier(self, *args) elif len(args) == 5: try: a = args[0] b = args[1] c = args[2] d = args[3] value = args[4] return _draw.draw_bezier(self, a.y, a.x, b.y, b.x, c.y, c.x, d.y, d.x, value) except KeyError, AttributeError: pass raise ValueError("Arguments ar... | def __call__(self, *args): if len(args) == 9: return _draw.draw_bezier(self, *args) elif len(args) in (5, 6): try: a = args[0] b = args[1] c = args[2] d = args[3] value = args[4] return _draw.draw_bezier(self, a.y, a.x, b.y, b.x, c.y, c.x, d.y, d.x, value) except KeyError, AttributeError: pass raise ValueError("Argumen... | 28,163 |
def __call__(self, *args): if len(args) == 9: return _draw.draw_bezier(self, *args) elif len(args) == 5: try: a = args[0] b = args[1] c = args[2] d = args[3] value = args[4] return _draw.draw_bezier(self, a.y, a.x, b.y, b.x, c.y, c.x, d.y, d.x, value) except KeyError, AttributeError: pass raise ValueError("Arguments ar... | def __call__(self, *args): if len(args) == 9: return _draw.draw_bezier(self, *args) elif len(args) == 5: try: a = args[0] b = args[1] c = args[2] d = args[3] value = args[4] return _draw.draw_bezier(self, a.y, a.x, b.y, b.x, c.y, c.x, d.y, d.x, value, accuracy) except KeyError, AttributeError: pass raise ValueError("Ar... | 28,164 |
def __call__(self, *args): if len(args) == 3: return _draw.flood_fill(self, *args) elif len(args) == 2: try: a = args[0] value = args[1] return _draw.flood_fill(self, a.y, a.x, value) except KeyError, AttributeError: pass raise ValueError("Arguments are incorrect.") | def __call__(self, *args): if len(args) == 3: return _draw.flood_fill(self, *args) elif len(args) == 2: try: a = args[0] value = args[1] return _draw.flood_fill(self, a.y, a.x, value) except KeyError, AttributeError: pass raise ValueError("Arguments are incorrect.") | 28,165 |
def highlight_cc(self, ccs, function, color=-1): if not util.is_sequence(ccs): ccs = (ccs,) for cc in ccs: if color == -1: color = self.color self.color = self.color + 1 image = wxEmptyImage(cc.ncols, cc.nrows) image.SetData(apply(function, (cc,))) bmp = wxBitmapFromImage(image, 1) rect = (cc.page_offset_x(), cc.page_o... | def highlight_cc(self, ccs, function, color=-1): if not util.is_sequence(ccs): ccs = (ccs,) for cc in ccs: if color == -1: color = self.color self.color = self.color + 1 image = wxEmptyImage(cc.ncols, cc.nrows) image.SetData(apply(function, (cc,))) bmp = wxBitmapFromImage(image, 1) rect = (cc.page_offset_x(), cc.page_o... | 28,166 |
def clear_highlight_cc(self, ccs): if not util.is_sequence(ccs): ccs = (ccs,) for cc in ccs: for i in range(len(self.highlighted)): if (self.highlighted[i][0][0] == cc.page_offset_x() and self.highlighted[i][0][1] == cc.page_offset_y()): del self.highlighted[i] self.PaintArea(cc.page_offset_x(), cc.page_offset_y(), cc.... | def clear_highlight_cc(self, ccs): if not util.is_sequence(ccs): ccs = (ccs,) for cc in ccs: for i in range(last_one, len(self.highlighted)): if (self.highlighted[i][0][0] == cc.page_offset_x() and self.highlighted[i][0][1] == cc.page_offset_y()): del self.highlighted[i] self.PaintArea(cc.page_offset_x(), cc.page_offse... | 28,167 |
def clear_all_highlights(self): old_highlighted = self.highlighted[:] self.highlighted = [] if self.scaling <= 1: for highlight in old_highlighted: self.PaintArea(*highlight[0]) if self.scaling > 1: self.Refresh(0, rect=wxRect(0,0,self.GetSize().x,self.GetSize().y)) | def clear_all_highlights(self): old_highlighted = self.highlighted[:] self.highlighted = [] if self.scaling <= 1: for highlight in old_highlighted: self.PaintArea(*highlight[0]) if self.scaling > 1: self.Refresh(0, rect=wxRect(0,0,self.GetSize().x,self.GetSize().y)) | 28,168 |
def scale(self, scale=None): scroll_amount = self.scroll_amount scaling = self.scaling if scale == None: scale = scaling w = self.width * scale - 1 h = self.height * scale - 1 origin = [x * self.scroll_amount for x in self.GetViewStart()] x = max(min(origin[0] * scale / scaling + 1, w - self.GetSize().x) - 2, 0) y = ma... | def scale(self, scale=None): scroll_amount = self.scroll_amount scaling = self.scaling if scale == None: scale = scaling w = self.image.width * scale h = self.image.height * scale origin = [x * self.scroll_amount for x in self.GetViewStart()] x = max(min(origin[0] * scale / scaling + 1, w - self.GetSize().x) - 2, 0) y ... | 28,169 |
def OnPaint(self, event): if not self.image: return scaling = self.scaling origin = [x * self.scroll_amount for x in self.GetViewStart()] origin_scaled = [x / scaling for x in origin] update_regions = self.GetUpdateRegion() rects = wxRegionIterator(update_regions) # Paint only where wxWindows tells us to, this is faste... | def OnPaint(self, event): if not self.image: return scaling = self.scaling origin = [x * self.scroll_amount for x in self.GetViewStart()] origin_scaled = [x / scaling for x in origin] update_regions = self.GetUpdateRegion() rects = wxRegionIterator(update_regions) # Paint only where wxWindows tells us to, this is faste... | 28,170 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | 28,171 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | 28,172 |
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) scaling = self.scaling origin = [a * self.scroll_amount for a in self.GetViewStart()] origin_scaled = [a / scaling for a in origin] size_scaled = [a / scaling for a in self.GetSizeTuple()] if check: if ((x + w < origin_scaled[0... | 28,173 |
def double_click(self): return "%s.display()" % self.name | def double_click(self): return "%s.display()" % self.name | 28,174 |
def determine_choices(self, locals): from gamera import core self.klass = core.Region return _guiClass.determine_choices(self, locals) | def determine_choices(self, locals): from gamera import core self.klass = core.Region return _guiClass.determine_choices(self, locals) | 28,175 |
def determine_choices(self, locals): from gamera import core self.klass = core.RegionMap return _guiClass.determine_choices(self, locals) | def determine_choices(self, locals): from gamera import core self.klass = core.RegionMap return _guiClass.determine_choices(self, locals) | 28,176 |
def determine_choices(self, locals): from gamera import core self.klass = core.ImageInfo return _guiClass.determine_choices(self, locals) | def determine_choices(self, locals): from gamera import core self.klass = core.ImageInfo return _guiClass.determine_choices(self, locals) | 28,177 |
def determine_choices(self, locals): from gamera import core self.klass = core.ImageBase return _guiClass.determine_choices(self, locals) | def determine_choices(self, locals): from gamera import core self.klass = core.ImageBase return _guiClass.determine_choices(self, locals) | 28,178 |
def determine_choices(self, locals): from gamera import core self.klass = core.Point return _guiClass.determine_choices(self, locals) | def determine_choices(self, locals): from gamera import core self.klass = core.Point return _guiClass.determine_choices(self, locals) | 28,179 |
def classify_and_update_list_automatic(self, glyphs, *args, **kwargs): """**classify_and_update_list_automatic** (ImageList *glyphs*, Int | def classify_and_update_list_automatic(self, glyphs, *args, **kwargs): """**classify_and_update_list_automatic** (ImageList *glyphs*, Int | 28,180 |
def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") if multiple: flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file", cls.last_directory, "", e... | def __init__(self, parent, extensions="*.*", multiple=0): cls = self.__class__ if cls.last_directory is None: cls.last_directory = config.get("default_dir") if multiple: self._flags |= wxMULTIPLE self._multiple = True else: self._multiple = False wxFileDialog.__init__( self, parent, "Choose a file", cls.last_directory,... | 28,181 |
def plot(*args): figure = Figure() axis = figure.add_subplot(111) axis.plot(*args) show_plot(figure) return figure | def plot(*args): figure = Figure() axis = figure.add_subplot(111) axis.plot(*args) show_figure(figure) return figure | 28,182 |
def __doc_example1__(images): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_line(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image | def __doc_example1__(images): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_line(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image | 28,183 |
def import_command_line_modules(self): for file in config.get_free_args(): try: name = os.path.basename(file)[:-3] module = imp.load_source(name, file) self.shell.locals[name] = module self.shell.push(name) imported = True except Exception, e: exc_type, exc_value, exc_traceback = sys.exc_info() gui_util.message("Error ... | def import_command_line_modules(self): for file in config.get_free_args(): try: name = os.path.basename(file)[:-3] module = imp.load_source(name, file) self.shell.locals[name] = module self.shell.push(name) imported = True except Exception, e: exc_type, exc_value, exc_traceback = sys.exc_info() gui_util.message("Error ... | 28,184 |
def _do_splits_impl(self, glyph): id = glyph.get_main_id() if (id.startswith('_split.')): parts = id.split('.') if (len(parts) != 2 or not hasattr(glyph, parts[1])): raise ClassifierError("'%s' is not a known or valid split function." % parts[1]) try: splits = getattr(glyph, parts[1]).__call__(glyph) except core.Segmen... | def _do_splits_impl(self, glyph): id = glyph.get_main_id() if (id.startswith('_split.')): parts = id.split('.') if (len(parts) != 2 or not hasattr(glyph, parts[1])): raise ClassifierError("'%s' is not a known or valid split function." % parts[1]) try: if sys.version_info[:2] < (2, 4): splits = getattr(glyph, parts[1]).... | 28,185 |
def generate_features(self, glyphs): """Generates features for all the given glyphs.""" progress = gamera.util.ProgressFactory("Generating features...", len(list)) try: for glyph in list: glyph.generate_features(self.feature_functions) progress.step() finally: progress.kill() | def generate_features(self, glyphs): """Generates features for all the given glyphs.""" progress = util.ProgressFactory("Generating features...", len(list)) try: for glyph in list: glyph.generate_features(self.feature_functions) progress.step() finally: progress.kill() | 28,186 |
def ___(*args): pass | def ___(*args): pass | 28,187 |
def update(self, num, den): if self._starting: sys.stdout.write(self._message) sys.stdout.write("\n") self._starting = 0 if not self._done: progress = int((float(num) / float(den)) * self.width) if progress != self._last_amount: self._last_amount = progress left = self.width - progress sys.stdout.write("|") sys.stdout.... | def update(self, num, den): if self._starting: sys.stdout.write(self._message) sys.stdout.write("\n") self._starting = 0 if not self._done: progress = int((float(num) / float(den)) * self.width) if progress != self._last_amount: self._last_amount = progress left = self.width - progress sys.stdout.write("|") sys.stdout.... | 28,188 |
def ProgressFactory(message, length=1): if has_gui.gui != None: return has_gui.gui.ProgressBox(message, length) elif config.config.get("progress_bars"): return ProgressText(message, length) else: return ProgressNothing(message, length) | def ProgressFactory(message, length=1): if has_gui.gui != None: return has_gui.gui.ProgressBox(message, length) elif config.get("progress_bar"): return ProgressText(message, length) else: return ProgressNothing(message, length) | 28,189 |
def __del__(self): if self._display: self._display.close() | def __del__(self): if self._display: self._display.close() | 28,190 |
def __del__(self): if self._display: self._display.close() | def __del__(self): if self._display: self._display.close() | 28,191 |
def __init__(self, *args, **kwargs): ImageBase.__init__(self) gameracore.Cc.__init__(self, *args, **kwargs) | def __init__(self, *args, **kwargs): ImageBase.__init__(self) gameracore.Cc.__init__(self, *args, **kwargs) | 28,192 |
def run(startup=_show_shell): global app has_gui.has_gui = has_gui.WX_GUI has_gui.gui = GameraGui from gamera.gui import args_gui init_gamera() class MyApp(wxApp): def __init__(self, startup, parent): self._startup = startup wxApp.__init__(self, parent) self.SetExitOnFrameDelete(1) # wxWindows calls this method to in... | def run(startup=_show_shell): global app has_gui.has_gui = has_gui.WX_GUI has_gui.gui = GameraGui from gamera.gui import args_gui class MyApp(wxApp): def __init__(self, startup, parent): self._startup = startup wxApp.__init__(self, parent) self.SetExitOnFrameDelete(1) # wxWindows calls this method to initialize the ... | 28,193 |
def _OnLeftUp(self, event): if self.rubber_on: if self.HasCapture(): self.ReleaseMouse() self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(max(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1), 0)) self.rubber_y2 = int(max(min((event.GetY() + origi... | def _OnLeftUp(self, event): if self.rubber_on: if self.HasCapture(): self.ReleaseMouse() self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(max(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1), 0)) self.rubber_y2 = int(max(min((event.GetY() + origi... | 28,194 |
def _OnLeftUp(self, event): if self.rubber_on: if self.HasCapture(): self.ReleaseMouse() self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(max(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1), 0)) self.rubber_y2 = int(max(min((event.GetY() + origi... | def _OnLeftUp(self, event): if self.rubber_on: if self.HasCapture(): self.ReleaseMouse() self.draw_rubber() origin = [x * self.scroll_amount for x in self.GetViewStart()] self.rubber_x2 = int(max(min((event.GetX() + origin[0]) / self.scaling, self.image.ncols - 1), 0)) self.rubber_y2 = int(max(min((event.GetY() + origi... | 28,195 |
def _OnMotion(self, event): image = self.image if image is None: return scaling = self.scaling origin = [x * self.scroll_amount for x in self.GetViewStart()] x2 = int(max(min((event.GetX() + origin[0]) / scaling, image.ncols - 1), 0)) y2 = int(max(min((event.GetY() + origin[1]) / scaling, image.nrows - 1), 0)) if self.... | def _OnMotion(self, event): image = self.image if image is None: return scaling = self.scaling origin = [x * self.scroll_amount for x in self.GetViewStart()] x2 = int(max(min((event.GetX() + origin[0]) / scaling, image.ncols - 1), 0)) y2 = int(max(min((event.GetY() + origin[1]) / scaling, image.nrows - 1), 0)) if self.... | 28,196 |
def _OnMove(self, y, x): image = self._iw.id.original_image self._status_bar.SetStatusText( "(%d, %d): %s" % (x + image.ul_x, y + image.ul_y, self._iw.id.original_image.get(y, x)), 0) | def _OnMove(self, y, x): image = self._iw.id.original_image self._status_bar.SetStatusText( "(%d, %d): %s" % (x + image.ul_x, y + image.ul_y, self._iw.id.original_image.get(y, x)), 0) | 28,197 |
def _OnRubber(self, y1, x1, y2, x2, shift, ctrl): image = self._iw.id.original_image if y1 == y2 and x1 == x2: self._status_bar.SetStatusText( "(%d, %d): %s" % (x1 + image.ul_x, y1 + image.ul_y, self._iw.id.original_image.get(y2, x2)), 1) else: self._status_bar.SetStatusText( "(%d, %d) to (%d, %d) / (%d w, %d h) %s" % ... | def _OnRubber(self, y1, x1, y2, x2, shift, ctrl): image = self._iw.id.original_image if y1 == y2 and x1 == x2: self._status_bar.SetStatusText( "(%d, %d): %s" % (x1, y1, image.get(y2 - image.ul_y, x2 - image.ul_x)), 1) else: self._status_bar.SetStatusText( "(%d, %d) to (%d, %d) / (%d w, %d h) %s" % (x1 + image.ul_x, y1 ... | 28,198 |
def _OnRubber(self, y1, x1, y2, x2, shift, ctrl): image = self._iw.id.original_image if y1 == y2 and x1 == x2: self._status_bar.SetStatusText( "(%d, %d): %s" % (x1 + image.ul_x, y1 + image.ul_y, self._iw.id.original_image.get(y2, x2)), 1) else: self._status_bar.SetStatusText( "(%d, %d) to (%d, %d) / (%d w, %d h) %s" % ... | def _OnRubber(self, y1, x1, y2, x2, shift, ctrl): image = self._iw.id.original_image if y1 == y2 and x1 == x2: self._status_bar.SetStatusText( "(%d, %d): %s" % (x1 + image.ul_x, y1 + image.ul_y, self._iw.id.original_image.get(y2, x2)), 1) else: self._status_bar.SetStatusText( "(%d, %d) to (%d, %d) / (%d w, %d h) %s" % ... | 28,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.