After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 123627 - "Sample Merged" for the Clone tool
"Sample Merged" for the Clone tool
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
1.x
Other All
: Normal enhancement
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 160416 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-10-01 12:43 UTC by Knut-Håvard Aksnes
Modified: 2005-08-29 20:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Knut-Håvard Aksnes 2003-10-01 12:43:05 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.
Comment 1 Sven Neumann 2003-10-01 12:58:07 UTC
This is a nice idea indeed and shouldn't be hard to implement. We
could clone from the projection instead of from a drawable.
Comment 2 Raphaël Quinet 2003-10-01 14:10:33 UTC
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?
Comment 3 Sven Neumann 2003-10-01 14:31:16 UTC
Or "Sample Merged" for the Clone tool ?!
Comment 4 Michael Natterer 2004-09-24 23:12:47 UTC
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.
Comment 5 Sven Neumann 2004-10-22 15:36:16 UTC
Shouldn't block the 2.2 release.
Comment 6 antihcl 2004-12-04 10:38:55 UTC
*** Bug 160416 has been marked as a duplicate of this bug. ***
Comment 7 Michael Natterer 2004-12-04 17:49:08 UTC
FYI, i have a somewhat working version of this on my disk.
Will check it in and finish is after 2.2 is out.
Comment 8 antihcl 2004-12-05 11:17:22 UTC
Excellent! I would gladly give away all filters, script-fu, etc, for this
feature. =)
Comment 9 Michael Natterer 2005-08-28 19:18:11 UTC
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.
Comment 10 Michael Natterer 2005-08-29 20:50:04 UTC
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.