Skip to content

Similar color fill

Deif Lou requested to merge deiflou/krita:deiflou/similar_color_fill into master

This MR adds the ability to fill regions of a similar color in one go (like the similar color selection):


I tried to make it multithreaded dividing the work in patched like the similar color selection does. I added some function to the KisFillPainter to allow to fill a rect directly, without multithreading, but I also added another function that returns a list of jobs. It does the same but divides the work in patches.

That was the best way I could come with to make this multithreaded, I don't know if there is a better one.

I also refactored the KisScanlineFill class and put the useful policies in a common place (the difference and selection ones). I needed the functionality for this MR and also something similar is duplicated in the enclose and fill tool. Also the multithreaded floodfill has its own copy of the policies... So I thought it would be better to have them on a single accessible place to be used in other code.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports