mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +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
|
@ -99,6 +99,8 @@ public:
|
|||
void crop(Gfx::IntRect const& rect);
|
||||
void resize(Gfx::IntSize const& new_size, Gfx::Painter::ScalingMode scaling_mode);
|
||||
|
||||
Optional<Gfx::IntRect> nonempty_content_bounding_rect() const;
|
||||
|
||||
Color color_at(Gfx::IntPoint const& point) const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue