1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +00:00

LibGfx: AntiAliasingPainter::draw_circle/fill_rect_with_rounded_corners

Follows the efficient algorithm from this paper:
https://cs.uwaterloo.ca/research/tr/1984/CS-84-38.pdf

Can be extended ellipses in future.
This commit is contained in:
MacDue 2022-03-10 02:21:02 +00:00 committed by Andreas Kling
parent 913374163c
commit 51e54ab1ba
4 changed files with 238 additions and 4 deletions

View file

@ -57,8 +57,8 @@ public:
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
void draw_triangle(IntPoint const&, IntPoint const&, IntPoint const&, Color);
void draw_ellipse_intersecting(IntRect const&, Color, int thickness = 1);
void set_pixel(IntPoint const&, Color);
void set_pixel(int x, int y, Color color) { set_pixel({ x, y }, color); }
void set_pixel(IntPoint const&, Color, bool blend = false);
void set_pixel(int x, int y, Color color, bool blend = false) { set_pixel({ x, y }, color, blend); }
void draw_line(IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid, Color alternate_color = Color::Transparent);
void draw_triangle_wave(IntPoint const&, IntPoint const&, Color color, int amplitude, int thickness = 1);
void draw_quadratic_bezier_curve(IntPoint const& control_point, IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);