-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Allow raster mask to be combined with drawn & parametric mask #19819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Allow raster mask to be combined with drawn & parametric mask #19819
Conversation
|
I've had thoughts about adding raster masks to the conditional blending, but never got around to implementing anything. My idea was to treat the raster mask as just another "shape" in drawn masks (which would also allow multiple rasters to be combined with AND/OR/XOR/ANDNOT). Internally, darktable generates a raster mask for each drawn shape and then merges those layers into the final drawn mask. Adding a raster as another layer would take very little code beyond the GUI stuff to select the raster. |
|
@ralfbrown Sounds good! What I've been thinking is to multiply the raster mask with the mask generated by drawn and/or parametric mask. Can you point me to the function that merges layers into the final drawn mask? |
|
Not an expert on that part of the codebase, but I'd start in files src/develop/masks.h and src/develop/masks/masks.c. My suggestion after a quick scan of those files: Add a new value to After that, there's a good chance that the existing machinery will just work, letting you use the mask manager module to specify combination methods (union/intersection/diff/sum). |
|
@stnKrisna : Please do not |
|
@ralfbrown It took me a while to implement this. But I got a working prototype. Also, as of now, I don't think any of the mask operations are working. The only way to invert the raster mask is to invert it in another module (or original module) before using it. As of now, to load the raster mask into the drawn mask, you'd need to configure the raster map and switching back to the drawn & parametric mask. I need suggestion how to best load the raster mask into the raster shape. Also, it's currently not possible to select the raster "shape" in the viewport, as I think this would block selection of other drawn masks. When updating shape of the raster mask, it will not update the mask value when used in the parametric "shape". |
Yeah, that might be tricky. The obvious idea is to treat raster as being "behind" all drawn shapes, i.e. selected whenever the mouse is not over or near-enough a drawn shape. You can probably achieve that by returning a fixed distance equal to the maximum distance at which a shape gets selected. Won't help when multiple raster masks are enabled, though, and I'm not sure how to indicate that the raster is currently selected (beyond the hinter message) since there's no outline to emphasize. |
|
If you're expanding mask functionality, I offer up this - |




The idea is to use external raster mask to mask out areas parametric & drawn mask that we don't want them to take effect (i.e. background exposure).
Changes to pixel pipeline is not implemented yet