Commit Graph

515 Commits

Author SHA1 Message Date
b49c062fa4 New upstream version 2.10.34 2023-03-01 18:41:57 -05:00
a86560bb57 app: fix global-buffer-overflow in "gimp:dissolve" implementation.
In case of negative y in the region to process, we were accessing invalid memory
(negative array index).

I hesitated between make so that a given ordinate always use the same index or
if we just want the start ordinate (whatever it is) to use index 0. The later
could have just been `(y - result->y) % RANDOM_TABLE_SIZE`.

I just decided to keep the existing logic (former case) though to be fair, not
sure it matters much.
2023-02-16 17:01:53 +01:00
30c23df646 New upstream version 2.10.32 2022-08-01 09:14:18 -04:00
52519f1290 New upstream version 2.10.30 2021-12-27 21:32:02 -05:00
1ff0cc1f5c New upstream version 2.10.28 2021-09-19 12:12:14 -04:00
970059b644 New upstream version 2.10.26 2021-09-09 19:33:41 -04:00
fcefb409e5 Issue #5267: Cage transform tool causes artifacts.
I somewhat bisected GEGL commits between 0.4.20 and 0.4.24 and found
that the one that introduced the env var GEGL_OPERATION_INIT_OUTPUT is
the first showing the problem.

Reviewer (Jehan) note: so it would be commit 6e9610e65c on GEGL repo.
This fix makes sense as it means that since this commit, the output
buffer could have random values. It's not a problem for any operation
where we fill every value, but I guess it's not the case for
"gimp:cage-coef-calc" which was likely relying on the old behavior of
being 0-initialized.

(cherry picked from commit 3b2a8f79f0)
2021-08-05 17:12:19 +02:00
6c74aa8490 New upstream version 2.10.24 2021-07-18 14:31:43 -04:00
c6b46b63b5 New upstream version 2.10.20 2020-08-26 11:05:56 +01:00
Ell
acd6c2b5f5 app: remove ANTI_ERASE from filter mode set
It used to be included in "Edit -> Fade", but it's too low-level.

(cherry picked from commit 59f3b07c5f)
2020-05-08 14:42:25 +03:00
Ell
1878313511 app: maintain common settings when editing Brightness-Contrast/Levels as Levels/Curves
When converting Brightness-Contrast to Levels, and Levels to
Curves, make sure to copy the common settings as well as the
operation-specific settings.

(cherry picked from commit 987447f18f)
2020-04-14 18:03:47 +03:00
Ell
78983e4b59 app: apply "linear" setting when repeating curves and levels
In gimp_operation_config_sync_node(), when the operation has a
property of the config object's type, don't skip the other
properties.  This makes sure to set the "linear" property of
GimpOperation{Curves,Levels} according to the config object.  We'd
previously done it manually in GimpFilterTool, but the setting was
not applied when repeating the filter.

(cherry picked from commit 0096e563f6)
2020-04-13 02:07:16 +03:00
Ell
ba7d2f4f87 app: rename "Fade" section of GimpFilterTool to "Blending Options"
... and GIMP_LAYER_MODE_CONTEXT_FADE to
GIMP_LAYER_MODE_CONTEXT_FILTER.

(cherry picked from commit 38059dc5fd)
2020-04-08 16:00:10 +03:00
Ell
a643fc2ad1 app: add "Fade" options to filter tools
As per commit ed7ea51fb7, reintroduce
the "Fade" functionality for filters, by incorporating it directly
into GimpFilterTool.

Add "mode" and "opacity" options to GimpOperationSettings, and add
a corresponding "Fade" expander to the GimpFilterTool dialog
allowing to control them.

Reintroduce the FADE layer-mode context, and use it to mark the
layer modes avaialable for fading.
2020-04-07 19:42:48 +03:00
Ell
9e5fabf8a0 app: add GimpOperationSettings
Add a new GimpOperationSettings class, to be used as a base class
for all operation-config types.  The class provides options common
to all operations (namely, the clipping mode, input region, and
color options), which were previously stored in GimpFilterOptions,
and were therefore bound to the filter tool, instead of being
stored as part of the operation settings; as a result, these
options would have no effect when reapplying a filter, or when
restoring a preset.

The GimpOperationSettings options do not affect the operation
node, but rather the associated GimpDrawableFilter object.  The
class provides a gimp_operation_settings_sync_drawable_filter()
function, which applies the options to the filter.

Modify all custom and auto-generated operation-config types to
derive from GimpOperationSettings, and modify the GimpConfig
functions of the former to account for the GimpOperationSettings
properties, using a set of protected functions provided by the
class.
2020-04-07 19:42:48 +03:00
8e7900cbf2 New upstream version 2.10.18 2020-03-29 00:23:03 -04:00
Ell
422452b5da app: add "chunked" parameter to gimp_tile_handler_validate_validate()
... which allows validating the area in chunks, instead of in a
single step.

(cherry picked from commit faf6acfb67)
2020-03-14 13:55:04 +02:00
Ell
2d671cf5f7 Revert "configure.ac, app: temporarily revert GEGL dependency to 0.4.22 for release"
This reverts commit 6bed57abe2.
2020-02-23 19:28:02 +02:00
Ell
6bed57abe2 configure.ac, app: temporarily revert GEGL dependency to 0.4.22 for release
... and work around the missing gegl_buffer_share_storage() API in
gimp:replace.
2020-02-22 22:28:11 +02:00
Ell
3c702fbc1c app: fix compositing of layers with masks, outside the mask bounds
In GimpOperationLayerMode, when the op has a mask connected, and
we're processing an area outside the mask bounds, set the op's
opacity to 0, so that the backdrop shows through.  The actual
process() function gets a NULL mask pointer in this case, and so
would composite the layer as if it had no mask, exposing areas that
should be masked out.

Add a GimpOperationLayerMode::parent_process() function, which
subclasses can override instead of GeglOperation::process(), and
make sure to update the GimpOperationLayerMode::opacity field
before calling this function (and, subsequently, before calling
GimpOperationLayerMode::process()).

Clean up the rest of the fields, and adjust the rest of the code.

(cherry picked from commit 646c804c04)
2020-02-21 22:57:00 +02:00
Ell
39ba4c409e app: in gimp:replace, add fast path when compositing a layer over itself
In gimp:replace, when compositing the same content over itself,
i.e., when the input and aux buffers share the same storage and
same tile alignment, pass the input buffer directly as output,
instead of doing actual processing.

In particular, this happens when processing a pass-through group
outside of its actual bounds.

(cherry picked from commit 2eaaa950a5)
2020-02-20 13:03:39 +02:00
Ell
e409f301fe app: handle GimpTileHandlerValidate::invalidated in gimp:buffer-source-validate
In gimp:buffer-source-validate, invalidate the node in response to
GimpTileHandlerValidate::invalidated, added in the previous commit,
in addition to GeglBuffer::changed.

(cherry picked from commit bb8ee0e686)
2020-01-15 21:50:21 +02:00
a3fead4bbd New upstream version 2.10.14 2019-11-09 19:05:21 -05:00
Ell
a2fe44ed8c app: streamline GimpHistogram; avoid spurious channel switch in histogram view
In GimpHistogram, get rid of the "n-channels" property and
corresponding gimp_histogram_n_channels() function.  The former
returned the actual number of channels, but this wasn't too useful,
as channel values may not be sequential; the latter returned the
number of components.  Instead, add an "n-components" property and
a corresponding gimp_histogram_n_components() function, both of
which return the number of components.  Furthermore, add a
gimp_histogram_has_channel() function, which determines if the
histogram has a given channel; this allows for simple testing for
channel availability, which was done wrong in various places.

Adjust the GimpHistogram code for the changes, and clean it up,
fixing a few bugs.

Adjust users of GimpHisotgram for the changes.  In particular,
in GimpHisotgramView, fix the channel-availability test when
setting the view's histogram (which happens whenever the active
drawable's preview is frozen), to avoid erroneously swithcing the
view's channel back to "Value" when a non-RGB channel is selected.

(cherry picked from commit fc17f0ed0c)
2019-10-22 15:50:24 +03:00
b4569d3b18 New upstream version 2.10.12 2019-10-13 20:52:44 -04:00
Ell
6a1474677d app: fix offset handling in spiral gradients
In gimp:gradient, properly scale the "offset" property in spiral
graidnets.

(cherry picked from commit 04280690b2)
2019-09-27 16:07:52 +03:00
Ell
b7f1b1fbe9 app: add offset support to shaped gradients
In gimp:gradient, handle the "offset" property in shaped gradients.

(cherry picked from commit 6bd5deea89)
2019-09-22 21:59:19 +03:00
1fc5ff4ed0 Issue 3100: cage transform tool -> always blurred without any action
Makes sure the tool doesn't offset everything by 0.5 pixels.

(cherry picked from commit 44cc7d239e)
2019-09-07 01:25:04 +02:00
Ell
114da41d61 app: in gimp:replace, implement GeglOperation::get_bounding_box()
... similarly to gimp:layer-mode, however, assume the destnation
(backdrop) is not included when the layer's opacity is 1, and
there's no mask.

(cherry picked from commit 998f89e3cb)
2019-08-02 00:40:26 +03:00
Ell
ea5b5e305a app: in gimp:layer-mode, implement GeglOperation::get_bounding_box()
... to take the layer's composite mode and opacity into account.

(cherry picked from commit 89c97bcf26)
2019-08-02 00:40:26 +03:00
Ell
05a2061776 app: in gimp:mask-components, implement GeglOperation::get_bounding_box()
... to forward the input/aux bounding box when the component mask
is fully clear/set, respectively.

(cherry picked from commit 9900fb74f2)
2019-08-02 00:40:25 +03:00
Ell
a0742047b5 app: in gimp:compose-crop, fix x/y properties lower bound
... from 0 to G_MININT.

(cherry picked from commit 332f662cda)
2019-08-02 00:40:25 +03:00
Ell
b72aad57f2 app: remove gimp_gegl_rectangle_align_to_tile_grid()
... and replace it with gegl_rectangle_align_to_buffer().

(cherry picked from commit ab94251ae9)
2019-07-30 20:32:54 +03:00
c9ded16963 Use g_ascii_dtostr() instead of g_ascii_formatd()
The latter is broken and doesn't guarantee a decimal point with the
current bug. Also, g_ascii_dtostr() doesn't need the format parameter
and produces nicer output.

(cherry picked from commit c0fb66254e)
2019-07-30 16:00:06 +02:00
Ell
91c20c783a app: fix gradient dithering
In gimp:gradient, fix dithering to correspond to how we actually
round float values to 8-bit.  In particular, this avoids
introducing noise when a component is fixed at 0 or 1 along a
segment.

(cherry picked from commit e22fcc8942)
2019-07-19 21:50:16 +03:00
d66e7dccac app: add GeglOperation *operation argument to GimpLayerModeBlendFunc
Some blend funcs depend on constants from the specifc color space we are
operating in and needs the space or operation propagated to the worker function
of the operation as discovered in issue #3451.

This commit propagates the operation, leaving the specific blend functions
needing it to call gegl_operation_get_source_space or similar without needing
that overhead for the rest.

(cherry picked from commit 8e90468308)
2019-06-09 12:48:59 +02:00
Ell
7acb6f36ab app: indentation fix in gimp:offset
(cherry picked from commit 8c1567f901)
2019-06-07 03:54:39 -04:00
Ell
618b6a62bd app: in gimp:offset, fix OFFSET_TRANSPARENT fast-path for chunked input
(cherry picked from commit 533091055e)
2019-06-07 03:49:49 -04:00
Ell
257e35dda1 app: avoid duplicate offset actions
Blacklist the "tools-offset" action in the GUI, and only keep
"filters-offset", to avoid duplication.  Update gimp:offset's
description, so that "filters-offset" gets a proper tool-tip.

(cherry picked from commit 42d4255262)
2019-06-06 04:52:32 -04:00
Ell
175e3ea7d9 app: various fixes/cleanups to last commits
(cherry picked from commit 30429e30e2)
2019-06-06 03:10:03 -04:00
Ell
f7a1aec1e9 app, libgimpbase: add gimp:offset operation
Add a new gimp:offset operation, which implements equivalent
functionality to gimp_drawable_offset(), in preparation for adding
an interactive offset tool.

To simplify things, add a GIMP_OFFSET_WRAP_AROUND value to the
GimpOffsetType enum, to avoid the need for a separate wrap-around
flag.  This makes the gimp-drawable-offset procedure parameters a
little superfluous, but whatever.

(cherry picked from commit 40fefb6076)
2019-06-05 19:10:49 -04:00
Ell
fe9c1732b9 app: add "alpha" propertry to gimp:mask-components
In gimp:mask-components, add an "alpha" property, which controls
the masked-in alpha value in case there's no aux buffer.  Set it to
0 by default, so that gimp:mask-components behaves normally in the
absence of an aux buffer (as if the aux buffer was empty).  Set it
to 1 in the image's visible-mask node, to maintain the current
alpha-component visibility behavior.

This fixes incorrect results when the output bounding box of a
drawable filter is smaller than the drawable, which can lead to a
NULL aux buffer being fed to the filter's gimp:mask-components
node.

(cherry picked from commit 6425bf820a)
2019-05-31 13:11:26 -04:00
Ell
e457ddf993 Revert "app: avoid NULL output in layer-mode ops"
On a second thought... nope :)  We'll fix it another way.

This reverts commit 60947b7a34826657395ca485d334ccb302106e07.

(cherry picked from commit 3766af9ac9)
2019-05-31 13:11:26 -04:00
Ell
818570d6cc app: avoid NULL output in layer-mode ops
In GimpOperationLayerMode and GimpOperationReplace, make sure we
don't return a NULL output buffer, or forward a NULL input buffer,
but rather create an appropriate empty buffer in this case.  This
avoids wrong results when the layer-mode op's output is connected
to the aux input of a subsequent op, as a result of the op behaving
differently with a NULL aux buffer (in particular, this can happen
when a drawable filter's output bounding box is smaller than the
drawable.)

(cherry picked from commit 8fcac3298c)
2019-05-31 12:25:47 -04:00
Ell
7a8d0c4afb app: disregard composite space in source-only trivial layer modes
Extend last commit to also disregard the composite space when the
layer mode is trivial and only the source region is included in
compositing, since, in this case, the source color is unmodified.

(cherry picked from commit c2021d3c5b)
2019-05-24 02:42:59 -04:00
Ell
7313686192 app: disregard composite space in non-union alpha-only layer modes
In gimp_layer_mode_get_format(), disregard the requested composite
space when selecting the format, if the input layer mode is alpha-
only, and the requested composite mode is not UNION, since, in this
case, the layer mode doesn't combine the layer/backdrop colors, and
rather only modifies the alpha of one of them.  This allows us to
use the preferred format, avoiding gamma conversion.

This particularly improves the performance of the Eraser tool in
perceptual images.

(cherry picked from commit a5962e4049)
2019-05-24 01:43:26 -04:00
Ell
49f3319f19 app: don't leak curve in gimp_curves_config_save_cruft()
(cherry picked from commit eda8b717d5)
2019-04-19 15:30:16 -04:00
Ell
b5da9918f1 app: streamline GimpCurve
In GimpCurve, replace the use of a fixed-length control-point array
with a dynamically-sized array.  Adapt GimpCurve's interface, and
the rest of the code.

In addition to simplifying the code, this fixes a bug where the
curve object could be broken by moving the mouse too fast (yep...),
and allows more accurate point placement, both in the GUI editor,
and through canvas interaction in the Curves tool (see issue #814).

(cherry picked from commit b6d829a1b2)
2019-04-19 10:36:25 -04:00
Ell
f141fc4064 app: fix gimp_operation_levels_map_input() for negative values
... when gamma != 1

(cherry picked from commit dc6ca2cf9a)
2019-04-19 10:34:42 -04:00
Ell
c5d34b2496 app: in gimp:fill-source, align result to tile grid
In gimp:fill-source, align the result rect to the drawable buffer's
tile grid, so that all tiles are COWed for solid-color fills.

(cherry picked from commit fa31854a66)
2019-03-30 12:06:14 -04:00