1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-27 12:52:07 +00:00
serenity/Userland/Applications/PixelPaint
Timothy Slater 038a833f0c PixelPaint: Add Polygonal Select Tool
Polygonal selection tool allows for the drawing of any arbitrary
polygonal shape. It tracks clicked points in a vector, upon double
clicking we finalize the polygon and generate the selection mask. The
user can press the escape key during selection to cancel.

The mask is generated as follows:

- First we calculate the size of the bounding rect needed to hold the
  polygon
- We add 2 pixels to height/width to allow us a 1 pixel border, the
  polygon will be centered in this bitmap
- Draw the polygon into the bitmap via Gfx::Painter, making sure to
  connect final polygon point to the first to ensure an enclosed shape
- Generate a selection mask the size of the bitmap, with all pixels
  initially selected
- Perform a flood fill from (0,0) which is guaranteed to be outside the
  polygon
- For every pixel reached by the flood fill, we clear the selected pixel
  from the selection mask
- Finally we merge the selection mask like other selection tools.
2022-10-19 23:04:07 +02:00
..
Filters PixelPaint: Add Hue/Saturation filter 2022-10-10 11:02:10 +01:00
Tools PixelPaint: Add Polygonal Select Tool 2022-10-19 23:04:07 +02:00
CMakeLists.txt PixelPaint: Add Polygonal Select Tool 2022-10-19 23:04:07 +02:00
CreateNewImageDialog.cpp PixelPaint: Allow configuration of default image size through GUI 2022-08-13 09:10:29 +01:00
CreateNewImageDialog.h PixelPaint: Convert to east-const style 2021-06-11 22:51:10 +02:00
CreateNewLayerDialog.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
CreateNewLayerDialog.h PixelPaint: Convert to east-const style 2021-06-11 22:51:10 +02:00
EditGuideDialog.cpp Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
EditGuideDialog.gml Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
EditGuideDialog.h PixelPaint: Keep a RefPtr to offset_text_box in EditGuideDialog 2021-11-27 11:04:48 +01:00
FilterGallery.cpp PixelPaint: Rebuild FilterGallery tree using TreeViewModel 2022-05-13 16:31:03 +02:00
FilterGallery.gml PixelPaint: Tweak FilterGallery layout 2022-07-15 12:34:25 +02:00
FilterGallery.h PixelPaint: Add a preview in FilterGallery 2022-02-12 12:21:35 +01:00
FilterParams.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
FilterPreviewWidget.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
FilterPreviewWidget.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
FilterTreeModel.cpp PixelPaint: Add Hue/Saturation filter 2022-10-10 11:02:10 +01:00
FilterTreeModel.h PixelPaint: Reference-count filters 2022-09-27 14:23:11 +01:00
Guide.h AK: Rename create<T> => make_ref_counted<T> 2021-09-03 02:36:09 +02:00
HistogramWidget.cpp PixelPaint: Extract common scope code into a generic ScopeWidget 2022-09-03 16:57:37 +01:00
HistogramWidget.h PixelPaint: Extract common scope code into a generic ScopeWidget 2022-09-03 16:57:37 +01:00
IconBag.cpp PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
IconBag.h PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
Image.cpp PixelPaint: Remove unused Image::write_to_file() method 2022-09-20 07:48:45 -04:00
Image.h PixelPaint: Remove unused Image::write_to_file() method 2022-09-20 07:48:45 -04:00
ImageEditor.cpp PixelPaint: Pass doubleclick events to tools 2022-10-19 23:04:07 +02:00
ImageEditor.h PixelPaint: Pass doubleclick events to tools 2022-10-19 23:04:07 +02:00
ImageProcessor.cpp PixelPaint: Use the parallel ImageProcessor to apply filters 2022-09-27 14:23:11 +01:00
ImageProcessor.h PixelPaint: Add a general-purpose parallel image processing pipeline 2022-09-27 14:23:11 +01:00
Layer.cpp PixelPaint: Ensure bitmap contains selected pixel before deleting 2022-10-19 23:04:07 +02:00
Layer.h PixelPaint: Add simple "Crop Image to Content" feature 2022-08-23 22:39:27 +02:00
LayerListWidget.cpp PixelPaint: Draw layer thumbnails with bilinear filtering 2022-03-31 18:25:06 +02:00
LayerListWidget.h PixelPaint: Change EditMode of Layer when double clicking on thumbnail 2022-03-08 22:07:12 +01:00
LayerPropertiesWidget.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
LayerPropertiesWidget.h Applications: Use default constructors/destructors 2022-02-14 22:06:55 +00:00
LevelsDialog.cpp PixelPaint: Show more specific Undo/Redo action text 2022-08-21 20:33:03 +02:00
LevelsDialog.gml PixelPaint: Add level sliders for brightness, contrast and gamma 2022-06-21 18:23:01 +01:00
LevelsDialog.h PixelPaint: Add level sliders for brightness, contrast and gamma 2022-06-21 18:23:01 +01:00
main.cpp PixelPaint: Unveil clipboard using the right path 2022-10-14 15:42:07 +02:00
MainWidget.cpp PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
MainWidget.h PixelPaint: Add option to make new layer from selection 2022-09-29 10:20:17 +01:00
Mask.cpp PixelPaint: Move Mask::{get, set, to_index} to the header file 2021-10-24 17:02:44 +02:00
Mask.h PixelPaint: Move Mask::{get, set, to_index} to the header file 2021-10-24 17:02:44 +02:00
PaletteWidget.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
PaletteWidget.h Applications: Use default constructors/destructors 2022-02-14 22:06:55 +00:00
PixelPaintWindow.gml PixelPaint: Introduce a vectorscope 2022-09-03 16:57:37 +01:00
ProjectLoader.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
ProjectLoader.h PixelPaint: Use FileSystemAccessClient::try_* APIs 2022-01-20 10:39:12 +01:00
ResizeImageDialog.cpp PixelPaint: Add Smooth Pixels scaling option 2022-06-16 14:26:55 +01:00
ResizeImageDialog.gml Applications+Games+LibGUI: Fix layout problems 2022-06-30 11:51:25 +02:00
ResizeImageDialog.h PixelPaint: Add Image>Resize Image... dialog. (Front end) 2022-05-23 00:12:19 +02:00
ScopeWidget.cpp PixelPaint: Extract common scope code into a generic ScopeWidget 2022-09-03 16:57:37 +01:00
ScopeWidget.h PixelPaint: Extract common scope code into a generic ScopeWidget 2022-09-03 16:57:37 +01:00
Selection.cpp PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
Selection.h PixelPaint: Add action to invert selection 2022-10-18 18:57:12 +02:00
ToolboxWidget.cpp PixelPaint: Add Polygonal Select Tool 2022-10-19 23:04:07 +02:00
ToolboxWidget.h Applications: Use default constructors/destructors 2022-02-14 22:06:55 +00:00
ToolPropertiesWidget.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
ToolPropertiesWidget.h Applications: Use default constructors/destructors 2022-02-14 22:06:55 +00:00
VectorscopeWidget.cpp PixelPaint: Introduce a vectorscope 2022-09-03 16:57:37 +01:00
VectorscopeWidget.h PixelPaint: Introduce a vectorscope 2022-09-03 16:57:37 +01:00