mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:47:44 +00:00
PixelPaint: Add simple "Crop Image to Content" feature
This command finds the smallest non-empty content bounding rect by looking for the outermost non-transparent pixels in the image, and then crops the image to that rect. It's implemented in a pretty naive way, but it's a start. :^)
This commit is contained in:
parent
5ded6904d8
commit
34a09bbb54
5 changed files with 83 additions and 0 deletions
|
@ -61,6 +61,8 @@ public:
|
|||
void resize(Gfx::IntRect const& new_rect, Gfx::Painter::ScalingMode scaling_mode);
|
||||
void resize(Gfx::IntSize const& new_size, Gfx::IntPoint const& new_location, Gfx::Painter::ScalingMode scaling_mode);
|
||||
|
||||
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
|
||||
|
||||
ErrorOr<void> try_set_bitmaps(NonnullRefPtr<Gfx::Bitmap> content, RefPtr<Gfx::Bitmap> mask);
|
||||
|
||||
void did_modify_bitmap(Gfx::IntRect const& = {});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue