Commit Graph

31 Commits

Author SHA1 Message Date
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Ell 5f58a7a260 app: pass near-plane z-coordinate to gegl:transform
... so that GEGL performs the same clipping we do.
2018-01-28 16:37:34 -05:00
Ell 3c0787e4c3 app: use gimp_transform_polygon() in gimp_transform_resize_boundary()
... so that the transformed boundary is properly clipped.

Adjust the boundary-size algorithms to operate on arbitrary
polygons.

Avoid using gimp_matrix3_will_explode() in
gimp_drawable_transform_buffer_affine() and falling back to
cropping the result, and avoid setting the "clip-to-input" property
of gegl:transform.  Neither of those in needed anymore.

This effectively reverts the app/ part of commit
768d06614f.  The next commit revets
the libgimpmath/ part.
2018-01-28 16:37:34 -05:00
Ell 73d7a81a4d app: restore operation src node in gimp_gegl_apply_[cached_]operation()
When merging a drawable filter, we call
gimp_gegl_apply_cached_operation() on a node that's part of the
drawable's filter stack graph.  The function rewires the node's
input, and doesn't restore its original input connection before
returning, leaving the graph in an inconsistent state.  Currently,
this doesn't matter, since we remove the filter right after that,
but the next commit expects the filter stack graph to remain
consistent.

Remember the original source node of "operation" in
gimp_gegl_apply_cached_operation(), and restore it upon exit, to
fix that.
2017-12-05 16:12:07 -05:00
Ell 0c305bdb0f app: use the layer's composite space when flattening it
Add a composite_space parameter to gimp_gegl_create_flatten_node()
and gimp_gegl_apply_flatten(), which controld the color space --
linear or perceptual RGB -- used for the operation (instead of
hardcoding it to linear).

When removing a layer's alpha channel, use the layer's composite
space for the flattening.  When flattening an image, use the bottom
layer's composite space.  Keep using linear space when creating a
channel or a mask from a drawable with alpha.
2017-10-21 11:44:27 -04:00
Øyvind Kolås 5627ad589f app: use gegl:dither instead of gegl:reduction 2016-12-24 19:40:12 +01:00
Michael Natterer ab5a27d74a app: CLAMP(bits, 1, 16) in gimp_gegl_apply_color_reduction()
which is the range of the GEGL op's properties.
2016-11-09 12:33:13 +01:00
Alexis Wilhelm 768d06614f Bug 316479 - The Perspective Tool creates an empy image...
...instead of transforming it

Add gimp_matrix3_will_explode() which determines if a transform
matrix will blow up something in a rectangle to infinity, and use
the function so set both the GIMP and GEGL code paths to clip the
transform to the input size.
2016-11-08 17:26:21 +01:00
Øyvind Kolås e1db36360b gegl-apply-operation: s/dither-strategy/dither-method/ 2016-09-28 12:05:41 +02:00
Ell 45efe6c405 app: Modify gimp_gegl_apply_border() to take a style parameter
instead of the feather parameter.

The BORDER_STYLE_HARD and BORDER_STYLE_FEATHERED styles are implemented
using the "gimp:border" operation, as was done previously.  The
BORDER_STYLE_SMOOTH style is implemented by performing a "gimp:grow" and
a "gimp:shrink", and subtracting the shrunk image from the grown image
using "gegl:substract".

gimp_channel_border() is modified to pass either BORDER_STYLE_HARD or
BORDER_STYLE_FEATHER, depending on its feather parameter, to maintain
the current behavior.  The next commit replaces it with a style
parameter as well.

Mass parameter alignment changes to gimp-gegl-apply-operation.h.  Sigh...
2016-05-08 19:22:24 +00:00
Ell c63bee3440 app: Add "gimp:flood" GEGL operation
This operation assigns to each pixel the minimum of the
maxima of all paths from it to the outside, as if the
input image represents a height map, and the operation
floods it with water.
2016-01-25 22:58:24 +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 2b1735f784 app: move gimp_file_compare() to gimp-utils.[ch]
It's a GCompareFunc to be used for finding GFiles in lists.
2014-08-02 15:07:26 +02:00
Michael Natterer 328e4eff18 app: add gimp_progress_set_text_literal()
and use it instead of set_text (progress, "%s", literal_message);
2014-07-20 23:32:19 +02:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Henning db4f67048d app: Always return values in non-void functions. 2014-06-29 22:35:34 -04:00
Michael Natterer 16381c9bf9 app: make gimp_gegl_apply_cached_operation() cancelable via GimpProgress
In gimp_drawable_merge_filter(), use that feature to make filter
applying cancelable. Stop projection rendering first, because we have
to run the event loop manually in order to receive input for
canceling, but we don't want the projection to be constructed from
that manual loop running.
2014-06-30 00:10:25 +02:00
Michael Natterer 88450445fc app: don't unref progress twice in gimp_gegl_apply_cached_operation() 2014-06-19 23:09:41 +02:00
Michael Natterer 14614cb349 app: add gimp_gegl_apply_cached_operation()
which does the same as gimp_gegl_apply_operation() but takes
additional arguments which are a cache buffer and a list of rectangles
that specify the already computed region in the cache buffer.
2014-06-18 18:42:17 +02:00
Michael Natterer 30ae88ef07 Bug 725556 - Feather selection extremely slow
gimp_gegl_apply_feather(): add a "dest_rect" parameter to restrict
the feather area. Pass the selection bounds plus the feather radius.

For consistency, newly add gimp_gegl_apply_border,grow,shrink() and use
them in gimpchannel.c
2014-03-04 22:11:50 +01:00
Michael Natterer b5ff4fbab4 app: support src ops in gimp_gegl_apply_operation() 2013-09-13 09:42:53 +02:00
Michael Natterer f56f6d1255 app: follow the GEGL invert -> invert-linear vs. invert-gamma change
and invert masks using invert-linear and other drawables using
invert-gamma. drawable_invert_cmd_callback() still always uses
invert-gamma even though it can be used on layer masks.
2013-06-24 00:45:04 +02:00
Michael Natterer 150a3e9c7e app: don't run graphs that read and write the same buffer
Work around artifacts at processing chunk borders by dup()ing the
source buffer. See bug #701875.
2013-06-18 08:06:24 +02:00
Michael Henning 87bcc4aa3d app: Use gegl:scale-ratio instead of the deprecated gegl:scale 2013-06-09 15:10:15 -04:00
Michael Muré c2da46d810 app: adapt to the transform ops API change in GEGL 2013-06-06 19:58:48 +02:00
Michael Natterer 260c62ed94 app: don't pass "hard-edges" to the transform ops, it's gone 2013-06-04 01:16:13 +02:00
Michael Natterer 72a32dd79f app: allow a NULL src_buffer in gimp_gegl_apply_operation()
in which case the function just does nothing on the passed operation's
input and expects it to be already conntected to something. Also allow
to pass an operation that is already part of another graph.
2013-04-22 10:55:09 +02:00
Michael Natterer 586bb73293 app: add gimp_gegl_apply_feather()
and use it in gimp_channel_real_feather() so the magic factor of 3.5
to turn feather radius into gegl:gaussian-blur's std_dev is hidden
behind an API.
2013-04-08 14:16:33 +02:00
Michael Natterer dfeb16d9ee app: don't use a GeglProcessor when we don't need a progress
Instead, use gegl_node_blit() directly which is more than ten times
faster in gimp_gegl_apply_operation(). Patch from Massimo Valentini.
2013-03-02 18:32:34 +01:00
Michael Natterer 435df29d85 app: add utility functions for applying specific operations to buffers
so gimp_gegl_apply_foo() will run "gegl:foo" with the required
properties on a buffer and write the result to another buffer.
2012-10-31 23:47:45 +01:00
Michael Natterer eb89a545d5 app: move core/gimp-apply-operation.[ch] to gegl/gimp-gegl-apply-operation.[ch] 2012-10-22 16:03:40 +02:00