(self, img, x, y, r=1, color=None)
| 30 | img[ys[msk], xs[msk]] = color |
| 31 | |
| 32 | def draw_point(self, img, x, y, r=1, color=None): |
| 33 | shape = img.shape |
| 34 | x, y = np.round((x,y)).astype(np.int) |
| 35 | if x<0 or y<0 or x>=shape[1] or y>=shape[0]: return |
| 36 | if color == None:color = ColorManager.get_front() |
| 37 | color = match_color(img, color) |
| 38 | if r==1: img[y,x] = color |
| 39 | n = int(r) |
| 40 | xs,ys = np.mgrid[-n:n+1,-n:n+1] |
| 41 | msk = np.sqrt(xs**2+ys**2)<r |
| 42 | self.draw_pixs(img, xs[msk]+x, ys[msk]+y, color) |
| 43 | |
| 44 | def draw_line(self, img, x1, y1, x2, y2, w=None, color=None): |
| 45 | x1, y1, x2, y2 = [int(round(i)) for i in (x1, y1, x2, y2)] |
no test coverage detected