Commit Graph

96 Commits

Author SHA1 Message Date
Jehan 8934d43975 app: make painting possibly multi-drawable aware.
- Make the various virtual methods of GimpPaintCore use a list of
  drawables as argument instead of a single drawable.
- gimp_brush_core_eval_transform_dynamics() can work with an image as
  argument rather than a drawable as it doesn't actually depends on
  specific drawable data.
- New function gimp_paint_tool_enable_multi_paint() to be used in init()
  method of paint tools to announce that this tool can work with
  multiple layers selected.
- Use gimp_paint_tool_enable_multi_paint() in the GimpSourceTool base
  class only for now.

This is a first step for multi-layer drawing, but we don't want it to be
possible in just any random cases, which is why I add a special function
to advertize this capability. We will use it for special-casing the
clone (as well as heal and perspective tools most likely) tool to work
on several layers at once. At this step, it is still very bugged and not
really working properly. In particular, since we don't process the
drawable offset early anymore (because it makes no sense when we pass a
list of drawables with different offsets), I suspect that all the
offset-related code will be very broken.
2021-09-14 17:59:47 +02:00
Sabri Ünal 48d71bf6ab Issue #4094 - Corrects some tools descriptions
This patch corrects some inconsitent Tool Options Tab Title using tools tooltips.
Scissors > Scissors Select
Heal > Healing
Align > Aligment

(cherry picked from commit a1af934d9d)
2020-03-10 21:39:06 +03:00
Ell a701032b4e app: fix symmetry transform in Clone/Heal tools when brush is cropped
In GimpSourceCore, when applying a symmetry transform to the source
content, combine the transform op with translation to the paint-
buffer coordinates, so that subclasses (namely, GimpClone and
GimpHeal) can use the op to apply the transformation directly from
the source buffer to the paint buffer in a single step.  This is
both more efficient, and avoids incorrect symmetry transforms when
the paint buffer is cropped to the bounds of the drawable.
2019-05-29 05:26:43 -04:00
Ell 024bc4cd3f Issue #886 - Artifacts symmetry painting with big brushes
In GimpClone and GimpHeal, use gimp_gegl_apply_operation(), instead
of gegl_node_process(), to apply the symmetry transform, which both
performs chunking and avoids aliasing problems.
2019-05-27 11:09:52 -04:00
Ell b63af476bd app: use gimp_symmetry_get_transform() in paint code
Use gimp_symmetry_get_transform() instead of
gimp_symmetry_get_operation() throughout the paint code, where
possible.  This allows us to combine the symmetry transform with
the ordinary brush transform, simplifying the code, improving
performance, and avoiding multiple resamplings.  This also fixes
the paint-buffer size when using mandala symmetry with non-round
brushes, avoiding artifacts.
2019-05-26 14:45:39 -04:00
Michael Natterer e269a837cd Issue #266 - Healing Tool - Sample Merged option does not work
gimp_heal_motion(): when sample merged is active, simply initialize
the paint buffer from the projection instead of the drawable.
2019-01-19 18:29:04 +01:00
Ell 053e5edc93 libgimpcolor, app, modules, plug-ins: remove GEGL_ITERATOR2 define
... it's no longer needed, since GEGL commit
gegl@9dcd2cde63f95a080bf16a58c10e9ffbdd99aace.

Partially reverts commits:

6fca9959c7
cc10af72cc
49c53568d7
8edbc0d491
29f63616d2
3a2014984d
ee48ec6877
4165a315d5
764085278f
b7633c722e
6ab12061b7
754a3c5b18
22b4b647bd
55b3438328
c6d23add65
f03a84d607
822f9f0d2b
95358ca1fa
cdda37f4ee
41e8035635
6761da42b2
fb5d7832a8
97ed7817d8
46e9036578
ea9c5e6a49
24fbdfb591
beb4ecb238
4b77831e03
fcf113a39c
567ffe94ff
2018-12-02 11:15:37 -05:00
Øyvind Kolås 24fbdfb591 app: migrate heal to new iterator api 2018-09-11 01:33:59 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell 08ff2ac8c8 app: use gimp_gegl_buffer_copy() all over the place
Replace all uses of gegl_buffer_copy() in app/ with
gimp_gegl_buffer_copy(), added in the previous commit.
2018-05-25 08:12:27 -04:00
Michael Natterer 6f324b867a Bug 783755 - Smudge should blend the smudged colors using linear RGB
This reverts commit 94c6bb4603, because
unlike what the bug title suggests, Smudge apparently *should* use
perceptual RGB, so now everything works as before.
2018-02-12 17:27:05 +01:00
Michael Natterer 94c6bb4603 Bug 783755 - Smudge should blend the smudged colors using linear RGB
Looked a bit deeper into heal: while I didn't try to understand what
it's actually doing, this is strange: there is a comment that says
that healing should done in perceptual space, and the code uses
R'G'B'A float (at least it completely did before the last commit).

On the other hand, the code adds and subtracts temporary buffers,
which screams "gamma artifacts" unless done in linear space.

This commit changes everything to use linear float buffers,
and removes the comment. It "looks" right to me now, please test.
2017-08-18 23:54:26 +02:00
Michael Natterer b926de5ada Bug 783755 - Smudge should blend the smudged colors using linear RGB
Use GIMP_LAYER_MODE_NORMAL (not NORMAL_LEGACY) when falling back from
gimp_paint_core_replace() to gimp_paint_core_paste() for layers
without alpha. Adapt the format of the used paint buffers accordingly.
2017-08-12 21:35:47 +02:00
Ell d4bb12d8b8 app: fix painting with force == 0
Should be a nop, but instead does the same thing as force == 0.5.
2017-04-10 09:57:54 -04:00
Jehan 76f573c981 Bug 648776 - mirror symmetries.
You can now set any paint tool to mirror painting relatively
horizontal/vertical axis or a central point (any combination of these 3
symmetries).
This has been implemented as a new multi-stroke core, where every stroke
is actually handled as a multi-stroke (default of size 1).
This is also the first usage of custom guides for symmetry guiding.
Current version has to be activated in the playground.
2016-02-02 21:15:13 +01:00
Øyvind Kolås 7e6320497e follow gegl api changes from commit af5361ca8d, with an abyss policy argument
to gegl_buffer_copy.
2015-05-25 01:27:31 +02:00
Michael Natterer 7449316898 app: add gimp_dynamics_is_output_enabled()
and use it to further simplify stuff. Almost no place needs to use a
GimpDynamicsOutput directly now.
2015-04-19 21:58:36 +02:00
Michael Natterer ca07026642 app: simplify handling of the force output in paint methods 2015-04-19 21:27:48 +02:00
Michael Natterer a75a479d81 app: #include "core/gimpdynamicsoutput.c" in some files in paint/ 2015-02-15 20:05:30 +01:00
Alexia Death ace4234a98 app: make all tools capable of dynamic force respect the options slider 2015-01-19 10:55:56 +02:00
Michael Natterer b5530e9e3d Use the new GeglAccessMode enum instead of the old values 2014-07-02 02:00:35 +02:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
  finally acknowledging the fact that app/ depends on gdk-pixbuf almost
  globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
2013-10-15 01:58:39 +02:00
Loren Merritt 8602fdbecb Bug 699436 - optimize the heal tool
Adjust over-relaxation factor as a function of problem size.  Remove
the second array, and update in-place.  Factor branches and indexing
out of the inner loop, instead precompute a list of pixels inside the
brush mask and what neighbors they have.  Switch from scalar double to
simd float.

Speedup (of the laplace part, excluding gamma correction): 10x-20x,
depending on brush size.
2013-05-10 21:12:25 +02:00
Michael Natterer a0942ae104 Revert "Optimize the heal tool"
This reverts commit d7066a1e2f
because I pushed it accidentially, it still needs some cleanup.
2013-05-02 20:21:10 +02:00
Loren Merritt d7066a1e2f Optimize the heal tool
Adjust over-relaxation factor as a function of problem size.
Remove the second array, and update in-place.
Factor branches and indexing out of the inner loop, instead precompute a list
of pixels inside the brush mask and what neighbors they have.
Switch from scalar double to simd float.

Speedup (of the laplace part, excluding gamma correction): 10x-20x, depending on brush size.
2013-05-02 09:22:25 +02:00
Michael Natterer 9e1dee9ceb Bug 697862 - heal tool quality regression
Next attempt: don't reset the heal buffer' formats back to bogus.
Instead, read and write them using the right gamma-corrected format.
2013-04-25 15:27:16 +02:00
Loren Merritt c3c4287bdf Bug 697862 - heal tool quality regression
Switch heal tool back to sRGB, which produces better quality than
linear-light. It is, after all, trying to correct for differences in
perceived brightness.
2013-04-23 22:51:43 +02:00
Loren Merritt 3f51850dc4 Bug 697862 - heal tool quality regression
Fix heal tool's convergence threshold.

When we switched from [0,255] to [0,1] pixel range, the amount of numerical
error to tolerate should have been reduced proportionally.
2013-04-21 20:36:19 +02:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer 0cfdf38726 app: port heal to RGBA float 2012-12-08 22:41:33 +01:00
Michael Natterer 1a624d4df4 app: remove many includes of "gegl/gimp-gegl-utils.h" 2012-05-10 23:12:39 +02:00
Michael Henning 2d34092f48 app: Fix heal tool behavior at top and left edge (Bug 568098)
Fixes calculation of the mask buffer's rectangle.
2012-05-10 20:43:32 +03:00
Michael Natterer a3a62b4546 app: add shortcut functions gimp_dynamics_get_foo_value()
and use them for simple use cases instead of dynamics_get_output() and
output_get_foo_value().
2012-05-02 17:51:19 +02:00
Michael Natterer bdf6b48138 app: move GimpTempBuf from base/ to core/
and forget about include policy in base/, it's scheduled for removal
anyway.
2012-05-02 17:51:01 +02:00
Michael Natterer dccb909009 app: make GimpTempBuf reference counted
and remove the "take_ownership" parameter from
gimp_temp_buf_create_buffer(), simply always ref the buf.
2012-05-02 17:51:00 +02:00
Michael Natterer 42a5f01be3 app: rename TempBuf to GimpTempBuf 2012-05-02 17:51:00 +02:00
Michael Natterer 7441a1f6f7 app: turn the TempBuf's "bytes" into "format" and port everything to it 2012-05-02 17:50:59 +02:00
Michael Natterer f07f01664e app: heal the paint_buffer directly, without an intermediate copy 2012-05-02 17:50:54 +02:00
Michael Natterer 1c60024250 app: port GimpHeal to GEGL, using insane buffer casting tricks 2012-05-02 17:50:53 +02:00
Øyvind Kolås 6efd812d08 app: s/GIMP_GEGL_RECT/GEGL_RECTANGLE/
Defining GeglRectangle inline is so useful that it has been added to
GEGL.
2012-05-02 17:50:52 +02:00
Michael Natterer c5c555c834 app: add "take_ownerspip" param to gimp_temp_buf_create_buffer()
and get rid of some more intermediate buffer creation/destruction, and
some redundant temp_buf_free() plus g_object_unref().
2012-05-02 17:50:51 +02:00
Michael Natterer b4996f2605 app: port GimpSourceCore and its classes to painting to the paint_buffer 2012-05-02 17:50:51 +02:00
Michael Natterer 93009ef274 app: use gimp_temp_buf_create_buffer() all over the place
instead of creating linear buffers manually.
2012-05-02 17:50:46 +02:00
Michael Natterer 2af0681587 app: don't create copies in gimp_paint_core_get_orig_image,proj()
and instead simply return the paint_core owned buffers. Also, move
graph creation and source buffer fiddling out of perspective clone's
inner loop, and set an area to be processed manually, which makes it
responsive again.
2012-05-02 17:50:46 +02:00
Michael Natterer 95bf75d7a5 app: in GimpSourceCore's vfuncs, pass GeglBuffers around not PixelRegions
which simplifies a lot of code, just don't look at GimpHeal until
it's completely ported ;)
2012-05-02 17:50:44 +02:00
Michael Natterer 39cca4aabd app: more GimpImageType -> Babl 2012-05-02 17:50:40 +02:00
Enrico Schröder 8cd272bb80 Heal: Make HealTool work when brush is partially outside of layer
Fix for bug 568098 https://bugzilla.gnome.org/show_bug.cgi?id=568098
Removes condition for not applying heal when (destination)brush is partially outside of layer.
Instead heal is not applied when brush is completely outside.
2012-04-24 22:21:25 +03:00
Michael Henning 2920344524 app: Prevent uninitialized values in the heal tool.
Previously, the black checkers of the left hand edge of the solution
matrix were not being assigned a value.
2012-04-24 22:08:44 +03:00
Michael Natterer f92df81a47 Bug 630028 - Improvement of the healing tool
Apply patch from Jean-Yves Couleaud that replaces the heal algorithm
with one that actually works. After trying some images, I don't just
consider this an "improvement" any longer, the old code was obviously
broken, or an early prototype, or whatever.
2011-10-17 21:47:01 +02:00
Michael Natterer 21b8007b29 app: add GimpBrushCache which stores brush stuff based on transform parameters
such as masks and outlines. The cache is currently very stupid and
only cacheds the last transformed object. Add caches to GimpBrush for
its mask, its pixmap and its boundary, and remove the same caches and
a ton of members from GimpBrushCore. This involves adding lots of
const qualifiers because GimpBrush returns const pointers now for
trasnformed stuff.
2011-04-05 22:15:30 +02:00