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

LibGfx: Implement Bitmap::cropped()

This cuts a region of a bitmap specified by the provided Gfx::IntRect
and returns it. Areas outside of the bounds of the original bitmap are
filled in with black.
This commit is contained in:
Valtteri Koskivuori 2021-05-09 22:19:04 +03:00 committed by Linus Groh
parent e60c0d675e
commit cb74f7992a
2 changed files with 21 additions and 0 deletions

View file

@ -117,6 +117,7 @@ public:
RefPtr<Gfx::Bitmap> flipped(Gfx::Orientation) const;
RefPtr<Gfx::Bitmap> scaled(int sx, int sy) const;
RefPtr<Gfx::Bitmap> scaled(float sx, float sy) const;
RefPtr<Gfx::Bitmap> cropped(Gfx::IntRect) const;
RefPtr<Bitmap> to_bitmap_backed_by_anon_fd() const;
ByteBuffer serialize_to_byte_buffer() const;