MCPcopy Create free account
hub / github.com/Image-Py/imagepy / draw_ellipse

Function draw_ellipse

imagepy/core/mark/mark.py:166–201  ·  view source on GitHub ↗
(pts, dc, f, **key)

Source from the content-addressed store, hash-verified

164 return np.dot(m, xys).T
165
166def draw_ellipse(pts, dc, f, **key):
167 pen, brush = dc.GetPen(), dc.GetBrush()
168 width, color = pen.GetWidth(), pen.GetColour()
169 fcolor, style = brush.GetColour(), brush.GetStyle()
170
171 if 'color' in pts:
172 pen.SetColour(pts['color'])
173 if 'fcolor' in pts:
174 brush.SetColour(pts['fcolor'])
175 if 'lw' in pts:
176 pen.SetWidth(pts['lw'])
177 if 'fill' in pts:
178 brush.SetStyle((106,100)[pts['fill']])
179
180 dc.SetPen(pen)
181 dc.SetBrush(brush)
182
183 if pts['type'] == 'ellipse':
184 x, y ,l1, l2, a = pts['body']
185 elp = make_ellipse(l1,l2,a)
186 elp = elp*key['k']+f(x,y)
187 dc.DrawPolygon(elp)
188 if pts['type'] == 'ellipses':
189 lst = []
190 for x, y, l1, l2, a in pts['body']:
191 elp = make_ellipse(l1,l2,a)
192 lst.append(elp*key['k']+f(x,y))
193 dc.DrawPolygonList(lst)
194
195
196 pen.SetWidth(width)
197 pen.SetColour(color)
198 brush.SetColour(fcolor)
199 brush.SetStyle(style)
200 dc.SetPen(pen)
201 dc.SetBrush(brush)
202
203def draw_rectangle(pts, dc, f, **key):
204 pen, brush = dc.GetPen(), dc.GetBrush()

Callers

nothing calls this directly

Calls 3

make_ellipseFunction · 0.85
appendMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected