2024-07-05 15:36:55 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2024, Andreas Kling <andreas@ladybird.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Forward.h>
|
2025-01-28 18:19:30 +01:00
|
|
|
#include <LibGfx/CompositingAndBlendingOperator.h>
|
2024-12-18 12:26:37 +01:00
|
|
|
#include <LibGfx/Filter.h>
|
2024-07-05 15:36:55 +02:00
|
|
|
#include <LibGfx/Forward.h>
|
|
|
|
|
#include <LibGfx/PaintStyle.h>
|
2025-03-14 22:28:53 +05:00
|
|
|
#include <LibGfx/Path.h>
|
2024-07-05 15:36:55 +02:00
|
|
|
#include <LibGfx/ScalingMode.h>
|
|
|
|
|
#include <LibGfx/WindingRule.h>
|
|
|
|
|
|
|
|
|
|
namespace Gfx {
|
|
|
|
|
|
|
|
|
|
class Painter {
|
|
|
|
|
public:
|
|
|
|
|
static NonnullOwnPtr<Gfx::Painter> create(NonnullRefPtr<Gfx::Bitmap>);
|
|
|
|
|
|
|
|
|
|
virtual ~Painter();
|
|
|
|
|
|
|
|
|
|
virtual void clear_rect(Gfx::FloatRect const&, Gfx::Color) = 0;
|
|
|
|
|
virtual void fill_rect(Gfx::FloatRect const&, Gfx::Color) = 0;
|
|
|
|
|
|
2025-05-11 12:44:54 +02:00
|
|
|
virtual void draw_bitmap(Gfx::FloatRect const& dst_rect, Gfx::ImmutableBitmap const& src_bitmap, Gfx::IntRect const& src_rect, Gfx::ScalingMode, Optional<Gfx::Filter> filters, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator) = 0;
|
2024-07-05 15:36:55 +02:00
|
|
|
|
2024-08-08 15:12:29 +02:00
|
|
|
virtual void stroke_path(Gfx::Path const&, Gfx::Color, float thickness) = 0;
|
2025-01-28 18:19:30 +01:00
|
|
|
virtual void stroke_path(Gfx::Path const&, Gfx::Color, float thickness, float blur_radius, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator) = 0;
|
2025-05-11 12:44:54 +02:00
|
|
|
virtual void stroke_path(Gfx::Path const&, Gfx::PaintStyle const&, Optional<Gfx::Filter>, float thickness, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator) = 0;
|
|
|
|
|
virtual void stroke_path(Gfx::Path const&, Gfx::PaintStyle const&, Optional<Gfx::Filter>, float thickness, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator, Gfx::Path::CapStyle const&, Gfx::Path::JoinStyle const&, float miter_limit, Vector<float> const&, float dash_offset) = 0;
|
2024-07-05 15:36:55 +02:00
|
|
|
|
2024-08-08 15:12:29 +02:00
|
|
|
virtual void fill_path(Gfx::Path const&, Gfx::Color, Gfx::WindingRule) = 0;
|
2025-01-28 18:19:30 +01:00
|
|
|
virtual void fill_path(Gfx::Path const&, Gfx::Color, Gfx::WindingRule, float blur_radius, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator) = 0;
|
2025-05-11 12:44:54 +02:00
|
|
|
virtual void fill_path(Gfx::Path const&, Gfx::PaintStyle const&, Optional<Gfx::Filter>, float global_alpha, Gfx::CompositingAndBlendingOperator compositing_and_blending_operator, Gfx::WindingRule) = 0;
|
2024-07-05 15:36:55 +02:00
|
|
|
|
|
|
|
|
virtual void set_transform(Gfx::AffineTransform const&) = 0;
|
|
|
|
|
|
|
|
|
|
virtual void save() = 0;
|
|
|
|
|
virtual void restore() = 0;
|
2024-08-15 07:19:25 +02:00
|
|
|
|
|
|
|
|
virtual void clip(Gfx::Path const&, Gfx::WindingRule) = 0;
|
2024-07-05 15:36:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|