1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

LibGfx: Add an "opacity" argument to Painter::draw_scaled_bitmap()

This API is not super perfect as it merely overrides the source alpha
on all source pixels instead of blending the alpha values. There is
room for improvement here for sure.
This commit is contained in:
Andreas Kling 2020-07-23 20:32:39 +02:00
parent 0a95f8d346
commit d7be3faab5
2 changed files with 25 additions and 20 deletions

View file

@ -65,7 +65,7 @@ public:
void set_pixel(const IntPoint&, Color);
void draw_line(const IntPoint&, const IntPoint&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
void draw_quadratic_bezier_curve(const IntPoint& control_point, const IntPoint&, const IntPoint&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
void draw_scaled_bitmap(const IntRect& dst_rect, const Gfx::Bitmap&, const IntRect& src_rect);
void draw_scaled_bitmap(const IntRect& dst_rect, const Gfx::Bitmap&, const IntRect& src_rect, float opacity = 1.0f);
void blit(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect, float opacity = 1.0f);
void blit_dimmed(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect);
void blit_brightened(const IntPoint&, const Gfx::Bitmap&, const IntRect& src_rect);