Open J-F-Liu opened 4 years ago
I was going to raise an issue for supporting angle on ellipse - is this the same feature request or something different?
I think it's the same feature.
Thinking about this more - the same would probably apply to e.g. rectangles.
I wonder if a better solution would be to allow to wrap Canvas
into a cheap newtype combined with Projection
(https://docs.rs/imageproc/0.22.0/imageproc/geometric_transformations/struct.Projection.html) so that any drawings onto such wrapper would be automatically translated before drawn onto the inner canvas (actual image).
For an ellipse with center (u, v), semi-axis (a, b), angle θ, the circum points can be calculated from parametric equation and 2D rotation:
To draw elliptic arc, set t ∈ [start_angle, end_angle].