1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 05:57:41 +00:00
serenity/Userland/Libraries/LibGfx
Timothy Slater eec881ea34 LibGfx: Implement flood fill algorithm in Bitmap class
This change implements a flood fill algorithm for the Bitmap class. This
will be leveraged by various Tools in PixelPaint. Moving the code into
Bitmap reduces the duplication of the algorithm throughout the
PixelPaint Tools (currently Bucket Tool and Wand Select).

The flood fill function requires you to pass in a threshold value (0 -
100) as well as a lambda for what to do when a pixel gets reached. The
lambda is provided an IntPoint representing the coordinates of the pixel
that was just reached.

The genericized lambda approach allows for a variety of things to be
done as the flood algorithm progresses. For example, the Bucket Tool
will paint each pixel that gets reached with the fill_color. The Wand
Select tool wont actually alter the bitmap itself, instead it uses the
reached pixels to alter a selection mask.
2022-10-14 13:39:33 +02:00
..
Filters LibGfx: Add TintFilter 2022-10-10 11:02:10 +01:00
Font LibGfx: Fix affine transformations in TrueType composite glyphs 2022-09-24 17:06:29 +02:00
AffineTransform.cpp LibGfx: Use some AK/Math helpers in AffineTransform 2022-05-07 20:25:39 +02:00
AffineTransform.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
AntiAliasingPainter.cpp AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most places 2022-10-04 23:35:07 +01:00
AntiAliasingPainter.h LibGfx: Add AntiAliasingPainter::fill_rect 2022-09-03 16:57:37 +01:00
Bitmap.cpp LibGfx: Implement flood fill algorithm in Bitmap class 2022-10-14 13:39:33 +02:00
Bitmap.h LibGfx: Implement flood fill algorithm in Bitmap class 2022-10-14 13:39:33 +02:00
BitmapMixer.cpp LibGfx: Add BitmapMixer 2022-01-04 21:41:14 +02:00
BitmapMixer.h LibGfx: Add BitmapMixer 2022-01-04 21:41:14 +02:00
BMPLoader.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
BMPLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
BMPWriter.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
BMPWriter.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CharacterBitmap.h Libraries: Make CharacterBitmap instances at compile-time 2022-03-04 17:41:08 +01:00
ClassicStylePainter.cpp LibGUI+LibGfx: Let Desktop::the() set widget effects 2022-08-09 12:08:21 +02:00
ClassicStylePainter.h LibGUI+LibGfx: Let Desktop::the() set widget effects 2022-08-09 12:08:21 +02:00
ClassicWindowTheme.cpp LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows 2022-08-25 13:28:50 +02:00
ClassicWindowTheme.h LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows 2022-08-25 13:28:50 +02:00
CMakeLists.txt LibC: Remove the LibM interface target 2022-09-16 16:09:19 +00:00
Color.cpp LibWeb+LibGfx: Move premultiplied alpha mixing to color.mixed_with() 2022-09-16 10:50:48 +01:00
Color.h LibGfx: Implement flood fill algorithm in Bitmap class 2022-10-14 13:39:33 +02:00
CursorParams.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
CursorParams.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
DDSLoader.cpp Userland: Remove unecessary uses of __serenity__ macro 2022-10-10 12:23:12 +02:00
DDSLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
DisjointRectSet.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
DisjointRectSet.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
FillPathImplementation.h LibWeb: Use Gfx::AntiAliasingPainter to draw SVG paths 2021-09-18 02:12:38 +04:30
Forward.h LibGfx: Add Gfx::Quad<T> to represent arbitrary quadrilaterals 2022-04-07 17:06:02 +02:00
Gamma.h LibGfx: Remove a workaround for clang before 11 2022-10-04 23:35:07 +01:00
GIFLoader.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
GIFLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
ICOLoader.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
ICOLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
ImageDecoder.cpp Libraries: Use default constructors/destructors in LibGfx 2022-03-17 17:23:49 +00:00
ImageDecoder.h Libraries: Use default constructors/destructors in LibGfx 2022-03-17 17:23:49 +00:00
JPGLoader.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
JPGLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Line.h Libraries: Use default constructors/destructors in LibGfx 2022-03-17 17:23:49 +00:00
Matrix.h LibGfx: Add [[nodiscard]] to Matrix operators 2022-10-02 21:17:41 +02:00
Matrix3x3.h LibGfx: Add Matrix3x3 2021-12-30 14:24:29 +01:00
Matrix4x4.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Orientation.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Painter.cpp AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most places 2022-10-04 23:35:07 +01:00
Painter.h LibGfx: Add a way to get the Painter's current 2D translation 2022-10-02 21:14:02 +02:00
Palette.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Palette.h LibGfx+WindowServer: Add theme flag TitleButtonsIconOnly 2022-04-25 23:45:24 +02:00
Path.cpp LibGfx: Add method for copying a Path with a transform applied 2022-08-14 11:30:40 +02:00
Path.h LibGfx: Add method for copying a Path with a transform applied 2022-08-14 11:30:40 +02:00
PBMLoader.cpp LibGfx: Use common class template for PBM/PGM/PPM image loaders 2022-03-13 22:35:20 +01:00
PBMLoader.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
PGMLoader.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
PGMLoader.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
PNGLoader.cpp Userland: Remove unecessary uses of __serenity__ macro 2022-10-10 12:23:12 +02:00
PNGLoader.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
PNGShared.h Libraries: Add missing includes, add namespace qualifiers 2022-09-18 13:27:24 -04:00
PNGWriter.cpp LibGfx: Compress PNGs with a better compression level 2022-07-30 23:21:42 +02:00
PNGWriter.h LibGfx: Use enum instead of magic numbers for PNG Color and Filter types 2022-07-10 15:01:07 +02:00
Point.cpp LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void> 2021-11-28 23:14:19 +01:00
Point.h LibGfx: Add Point::to_ceiled method for getting a ceiled Point 2022-08-31 12:20:55 +02:00
PortableImageLoaderCommon.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
PortableImageMapLoader.h Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
PPMLoader.cpp LibGfx: Use common class template for PBM/PGM/PPM image loaders 2022-03-13 22:35:20 +01:00
PPMLoader.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
QOILoader.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
QOILoader.h LibGfx: Add support for "The Quite OK Image Format" (QOI) 2021-12-21 13:27:27 +01:00
QOIWriter.cpp LibGfx: Add a QOI image format encoder 2022-04-13 15:21:27 +01:00
QOIWriter.h LibGfx: Add a QOI image format encoder 2022-04-13 15:21:27 +01:00
Quad.h LibGfx: Add Gfx::Quad<T> to represent arbitrary quadrilaterals 2022-04-07 17:06:02 +02:00
Rect.cpp LibGfx+WindowServer: Remove set_size_around() from Rect and Window 2022-08-25 13:28:50 +02:00
Rect.h LibGfx+WindowServer: Remove set_size_around() from Rect and Window 2022-08-25 13:28:50 +02:00
ShareableBitmap.cpp Everywhere: Split Error::from_string_literal and Error::from_string_view 2022-07-12 23:11:35 +02:00
ShareableBitmap.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Size.cpp LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void> 2021-11-28 23:14:19 +01:00
Size.h LibGfx: Add Size<T>::to_rounded<I>() 2022-08-08 22:39:06 +02:00
StandardCursor.h Base+WindowServer+LibGfx: Add new DragCopy Cursor 2022-08-31 17:29:44 +01:00
Streamer.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
StylePainter.cpp LibGUI+LibGfx: Let Desktop::the() set widget effects 2022-08-09 12:08:21 +02:00
StylePainter.h LibGUI+LibGfx: Let Desktop::the() set widget effects 2022-08-09 12:08:21 +02:00
SystemTheme.cpp LibGfx: Rename DO_PATH macro to ENCODE_PATH to match ThemeEditor 2022-06-17 19:46:30 +01:00
SystemTheme.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
TextAlignment.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
TextAttributes.h LibGfx: Expand TextAttributes with more information about underlining 2022-01-23 15:48:27 +03:30
TextDirection.cpp Everywhere: Fix a bunch of typos 2021-05-17 17:48:55 +01:00
TextDirection.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
TextElision.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
TextLayout.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
TextLayout.h Everywhere: Fix badly-formatted includes 2022-09-17 04:00:54 +00:00
TextWrapping.h Userland: Move text wrapping/elision into the new TextLayout :^) 2021-07-26 21:14:39 +04:30
Triangle.cpp LibGfx: Templatize Gfx::Triangle 2022-04-07 17:06:02 +02:00
Triangle.h LibGfx: Templatize Gfx::Triangle 2022-04-07 17:06:02 +02:00
Vector2.h LibGfx: Add IntVector2/3/4 types 2022-05-05 20:50:46 +02:00
Vector3.h LibGfx: Add IntVector2/3/4 types 2022-05-05 20:50:46 +02:00
Vector4.h LibGfx: Add IntVector2/3/4 types 2022-05-05 20:50:46 +02:00
VectorN.h AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most places 2022-10-04 23:35:07 +01:00
WindowTheme.cpp Libraries: Use default constructors/destructors in LibGfx 2022-03-17 17:23:49 +00:00
WindowTheme.h LibGfx+LibGUI+WindowServer+Apps+Demos: Replace ToolWindows 2022-08-25 13:28:50 +02:00