/src/serenity/Userland/Libraries/LibGfx/VectorGraphic.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2023, MacDue <macdue@dueutil.tech> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/RefCounted.h> |
10 | | #include <LibGfx/Bitmap.h> |
11 | | #include <LibGfx/Forward.h> |
12 | | #include <LibGfx/Size.h> |
13 | | |
14 | | namespace Gfx { |
15 | | |
16 | | class VectorGraphic : public RefCounted<VectorGraphic> { |
17 | | public: |
18 | | virtual IntSize intrinsic_size() const = 0; |
19 | | virtual void draw_transformed(Painter&, AffineTransform) const = 0; |
20 | | |
21 | 5.29k | IntSize size() const { return intrinsic_size(); } |
22 | 0 | IntRect rect() const { return { {}, size() }; } |
23 | | |
24 | | ErrorOr<NonnullRefPtr<Gfx::Bitmap>> bitmap(IntSize size, AffineTransform = {}) const; |
25 | | void draw_into(Painter&, IntRect const& dest, AffineTransform = {}) const; |
26 | | |
27 | 2.69k | virtual ~VectorGraphic() = default; |
28 | | }; |
29 | | |
30 | | }; |