GNOME Bugzilla – Bug 123627
"Sample Merged" for the Clone tool
Last modified: 2005-08-29 20:50:04 UTC
Photoshop offers a checkbox marked "Use All Layers" the effect of this is that is what is seen at the point where the clone source is placed the layer this the source is drawn in is irelevant when this checkbox is selected. Having this available it is much easier to do spot work while leaving the picture being spotted unchanged in a separate layer. In the current versions of gimp doing this means a lot of layer shifting.
This is a nice idea indeed and shouldn't be hard to implement. We could clone from the projection instead of from a drawable.
If we use the expression "Use All Layers" for the clone tool, can we also use the same to replace "Sample Merged" in the color picker?
Or "Sample Merged" for the Clone tool ?!
It's not as easy to implement as it seems because we need to clone from the unmodified projection, and painting changes the projection. A prerequisite would be at add something line gimp_paint_core_get_orig_image(), just for the projection, not for the drawable. Once gimp_paint_core_get_orig_projection() (or whatever) is there, it's merely a question of changing the "GimpDrawable *src_drawable" pointer in the GimpClone struct to "GimpPickable *src_pickable" and do some minor adjustments to the clone code.
Shouldn't block the 2.2 release.
*** Bug 160416 has been marked as a duplicate of this bug. ***
FYI, i have a somewhat working version of this on my disk. Will check it in and finish is after 2.2 is out.
Excellent! I would gladly give away all filters, script-fu, etc, for this feature. =)
Fixed in CVS: 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
Fixed the fix: 2005-08-29 Michael Natterer <mitch@gimp.org> The previous commit added tons of code just to completely break clone align behavior. Reverted lots of the changes and do the sample-merged stuff at the innermost place (gimp_clone_motion). This change also enables changing sample-merged between paint strokes. * app/paint/gimpclone.[ch] (struct GimpClone): changed member "src_pickable" back to "src_drawable". (gimp_clone_paint): completely reverted. (gimp_clone_motion): do the drawable/projection -> pickable stuff and drawable offset handling here. Fixed signal handling to connect to the drawable's "removed" signal (not "disconnect", eek). Disconnect from the signal once the drawable has been removed. * app/tools/gimpclonetool.c: changed accordingly.