mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:57:35 +00:00
LibGfx: Add Bitmap::solid_color()
This function returns an Optional<Color> and is given an alpha_threshold. If all pixels above that alpha threshold are the same color, it returns the color, otherwise it returns an empty optional.
This commit is contained in:
parent
48d3db3c3d
commit
8e441d402b
2 changed files with 19 additions and 0 deletions
|
@ -240,6 +240,8 @@ public:
|
|||
|
||||
[[nodiscard]] bool visually_equals(Bitmap const&) const;
|
||||
|
||||
[[nodiscard]] Optional<Color> solid_color(u8 alpha_threshold = 0) const;
|
||||
|
||||
private:
|
||||
Bitmap(BitmapFormat, IntSize const&, int, BackingStore const&);
|
||||
Bitmap(BitmapFormat, IntSize const&, int, size_t pitch, void*);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue