def ellipse(self, row: int, col: int, radius_r: float, radius_c: float,
color: ColorType, fill: bool=False, alpha: float=1.0) -> 'Layer':
"""
Draw an ellipse centered on the specified row and column,
with the given radiuses.
:param row: Center row of ellipse
:param col: Center column of ellipse
:param radius_r: Radius of ellipse on y axis
:param radius_c: Radius of ellipse on x axis
:param color: Color to draw with
:param fill: True if the circle should be filled
:return: This frame instance
"""
if fill:
rr, cc = draw.ellipse(row, col, math.floor(radius_r), math.floor(radius_c),
shape=self.matrix.shape)
self._draw(rr, cc, color, alpha)
else:
rr, cc = draw.ellipse_perimeter(row, col, math.floor(radius_r), math.floor(radius_c),
shape=self.matrix.shape)
self._draw(rr, cc, color, alpha)
return self
评论列表
文章目录