mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibGfx: Add Bitmap::rotated and Bitmap::flipped
This commit is contained in:
parent
c6944f8cc2
commit
8e9d031cb3
Notes:
sideshowbarker
2024-07-19 07:40:56 +09:00
Author: https://github.com/asliturk
Commit: 8e9d031cb3
Pull-request: https://github.com/SerenityOS/serenity/pull/1756
Reviewed-by: https://github.com/awesomekling
2 changed files with 49 additions and 0 deletions
|
@ -42,6 +42,11 @@ enum class BitmapFormat {
|
|||
Indexed8
|
||||
};
|
||||
|
||||
enum RotationDirection {
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
|
||||
class Bitmap : public RefCounted<Bitmap> {
|
||||
public:
|
||||
static NonnullRefPtr<Bitmap> create(BitmapFormat, const Size&);
|
||||
|
@ -50,6 +55,8 @@ public:
|
|||
static RefPtr<Bitmap> load_from_file(const StringView& path);
|
||||
static NonnullRefPtr<Bitmap> create_with_shared_buffer(BitmapFormat, NonnullRefPtr<SharedBuffer>&&, const Size&);
|
||||
|
||||
NonnullRefPtr<Gfx::Bitmap> rotated(Gfx::RotationDirection) const;
|
||||
NonnullRefPtr<Gfx::Bitmap> flipped(Gfx::Orientation) const;
|
||||
NonnullRefPtr<Bitmap> to_bitmap_backed_by_shared_buffer() const;
|
||||
|
||||
ShareableBitmap to_shareable_bitmap(pid_t peer_pid = -1) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue