Commit Graph

515 Commits

Author SHA1 Message Date
Ell
75822d3d7b app: add gimp:fill-source operation
Add a new gimp:fill-source operation, which can act as a source
node for fill operations, instead of a fill buffer.  The op takes
a GimpFillOptions object, a drawable, and a pattern offset, and
uses gimp_fill_options_create_buffer() to produce its output.

This allows performing the entire fill operation in chunks as a
graph, instead of allocating a full-size fill buffer, which can
can occupy a lot of space for pattern fills.

(cherry picked from commit 6b0337e384)
2019-03-27 15:48:21 -04:00
Ell
7f6e522a35 app: in gimp:mask-components, don't forward empty aux when mask is fully set
... since the result needs to be fully opaque in this case, rather
than fully transparent.

(cherry picked from commit 371e35eeb8)
2019-03-01 14:36:25 -05:00
Ell
a3db1857fc app: small fix to last commit
(cherry picked from commit a8a29312de)
2019-03-01 14:15:25 -05:00
Ell
37797f9de4 app: fix toggling-off of alpha channel
Fix gimp:mask-components to use full-oapcity value for the alpha
component when it's masked-in and there's no "aux" input, so that
the image is rendered with full opacity when the alpha channel's
visiblity is toggled off, as per bug #143315.

(cherry picked from commit 6419ed3246)
2019-03-01 14:11:22 -05:00
Ell
1d05c286c5 app: disable spec. 8-bpp version of gimp:mask-components for non-little-endian platforms
(cherry picked from commit 6166f9ae14)
2019-03-01 14:11:21 -05:00
Ell
bf92987353 app: replace use of deprecated dont-cache/no_cache with cache-policy
Replace the use of the deprecated GeglNode::dont-cache property,
and GeglOperationClass::no_cache field, with GeglNode::cache-policy
and GeglOperationClass::cache_policy, respectively.

See commit gegl@7f24430cda0d8c3eff311868823d445edc2a4e12.

(cherry picked from commit 7489f0aece)
2019-02-21 13:09:49 -05:00
Ell
99130068bc app: in gimp:mask-components, handle half-precision float formats
(cherry picked from commit 7c1429d1ff)
2019-02-16 13:10:12 -05:00
Ell
02b8845a2f app: improve gimp:mask-components
Add specialized versions of gimp:mask-components for 8-, 16-, and
32-bpc formats, to improve efficiency, and to preserve the contents
of masked-out components exactly.

Provide public functions for format-selection and processing, which
we'll use in the painting code, instead of reimplementing component
masking.

(cherry picked from commit ee156b8fd6)
2019-02-16 10:00:29 -05:00
Ell
3925ae5fbb app: convert gimp:mask-components to C++
... in preperation for next commit.

(cherry picked from commit a7f7a485bd)
2019-02-16 09:59:33 -05:00
Ell
3847404db6 app: #include <string.h> in gimpoperationreplace.c
... for memset().

(cherry picked from commit 0cf77b0a3b)
2019-02-14 11:09:21 -05:00
Ell
d4976dfc61 app: change behavior of REPLACE mode for fully-transparent pixels
When the result of compositing has an alpha value of 0, the
corresponding color value is not mathematically defined.
Currently, all out layer modes opt to preserve the destination's
color value in this case.  However, REPLACE mode is different
enough to warrant a different behavior:

Unlike the other layer modes, when the compositing opacity
approaches 0 or 1, the output color value approaches the
destination or source color values, respectively, regardless of the
output alpha value.  When the opacity doesn't approach 0 or 1, the
output color value generally doesn't approach a limit as the output
alpha value approaches 0, however, when both the destination and
source alpha values are equal, the output color value is always a
simple linear interpolation between the destination and source
color values, according to the opacity.  In other words, this means
that it's reasonable to simply use the above linear interpolation
for the output color value, whenever the output alpha value is 0.

Since filters are commonly combined with the input using REPALCE
mode with full opacity, this has the effect that filters may now
modify the color values of fully-transparent pixels.  This is
generally desirable, IMO, especially for point filters.  Indeed,
painting with REPLACE mode (i.e., with tools that use
gimp_paint_core_replace()) behaved excatly as described above, and
had this property, before we switched gimp_paint_core_replace() to
use the common compositing code; this created a discrepancy between
painting and applying filters, which is now gone.

A side effect of this change is that we can now turn gimp:replace
into a NOP when the opacity is 100% and there's no mask, which
avoids the compositing step when applying filters.  We could
previously only apply this optimization to PASS_THROUGH mode, which
is a subclass of REPLACE mode.

Note that the discussion above concerns the UNION composite mode,
which is the only mode we currently use REPLACE in.  We modify the
rest of the composite modes to match the new behavior:
CLIP_TO_BACKDROP always preserves the color values of the
destionation, CLIP_TO_LAYER always preserves the color values of
the source, and INTERSECTION always produces fully-zeroed pixels.

(cherry picked from commit 27e8f452b3)
2019-02-14 11:05:20 -05:00
ada21f2594 Issue #2848: some sentences have no translation.
(cherry picked from commit f508e24f0c)
2019-01-24 16:20:11 +01:00
Ell
8361377b43 app: in gimp:gradient, improve adaptive supersampling
In gimp:gradient, when using adaptive supersampling, render the
gradient tile-by-tile, using an iterator, instead of row-by-row.
This significantly improves performance, while also avoiding the
assumption that gimp_adaptive_supersample_area() works row-by-row.

Additionally, when not using supersampling, use a single GRand
instance, since the separation to distinct seed and per-tile
instances, which was a threading optimization (commit
7f39e41254), is no longer needed.

(cherry picked from commit 2cd7938f02)
2019-01-24 04:15:27 -05:00
Ell
fbf73bee70 app: remove gimp-scratch; replace with gegl-scratch
The scratch allocator has been moved to GEGL (commit
gegl@b99032d799dda3436ffa8c1cc28f8b0d34fb965d).  Remove gimp-
scratch, and replace all its uses with gegl-scratch.

(cherry picked from commit 889e2e26ee)
2019-01-06 07:39:52 -05:00
Ell
23ae869f21 app: remove "Edit -> Fade..."
This commit completely removes the "Edit -> Fade..." feature,
because...

- The main reason is that "fade" requires us to keep two buffers,
  instead of one, for each fadeable undo step, doubling (or worse,
  since the extra buffer might have higher precision than the
  drawable) the space consumed by these steps.  This has notable
  impact when editing large images.  This overhead is incurred even
  when not actually using "fade", and since it seems to be very
  rarely used, this is too wasteful.

- "Fade" is broken in 2.10: when comitting a filter, we copy the
  cached parts of the result into the apply buffer.  However, the
  result cache sits after the mode node, while the apply buffer
  should contain the result of the filter *before* the mode node,
  which can lead to wrong results in the general case.

- The same behavior can be trivially achieved "manually", by
  duplicating the layer, editing the duplicate, and changing its
  opacity/mode.

- If we really want this feature, now that most filters are GEGL
  ops, it makes more sense to just add opacity/mode options to the
  filter tool, instead of having this be a separate step.

(cherry picked from commit ed7ea51fb7)
2018-12-27 11:45:11 -05:00
Ell
03a4fafe30 app: mark REPLACE and PASS_THROUGH modes as trivial
(cherry picked from commit f508ec8b89)
2018-12-03 09:54:18 -05:00
Ell
5b857dbb4b 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

(cherry picked from commit 053e5edc93)
2018-12-02 11:21:36 -05:00
Ell
2dda622a20 app: add gimp_layer_mode_is_trivial()
Add a TRIVIAL layer-mode flag, and corresponding
gimp_layer_mode_is_trivial() function, which indicates if the blend
function of a given layer mode is trivial, i.e., either never
modifies the source pixels (for non-subtractive modes), or always
clears the destination pixels (for subtractive modes).

(cherry picked from commit 8adec5fb3a)
2018-12-02 03:11:21 -05:00
Ell
6e82635d4f app: use gimp_gegl_rectangle_align_to_tile_grid() in gimp:buffer-source-validate
... instead of custom code.

(cherry picked from commit ce3a6c4fd6)
2018-12-02 03:11:18 -05:00
Ell
595218f1d4 app: in Luminance mode, cache RGBA -> Y fish
(cherry picked from commit dbab0b557d)
2018-12-01 05:55:25 -05:00
Ell
963f036a4a app: in Luminance mode, replace VLAs with gimp-scratch
In the Luminance layer-mode, use the scratch allocator for
allocating temporary buffers, instead of using VLAs.
GimpOperationLayerMode already allocates data on the stack,
calculated as not to overflow the stack on any platform, so having
any of its descendants also allocate big buffers on the stack is
risky.

(cherry picked from commit 70b7316ebc)
2018-12-01 05:55:24 -05:00
Ell
b0b541d670 app: use gimp_tile_handler_validate_validate() in gimp:buffer-source-validate
Use gimp_tile_handler_validate_validate(), added in the commit
before last, in gimp:buffer-source-validate, in order to pre-render
the necessary region of the buffer, instead of performing the
validation implicitly by iterating over the region.  This is both
simpler, and, more importantly, allows us to render the entire
region in a single chunk, instead of tile-by-tile, which can be
considerably more efficient, especially with high thread counts.

This essentially extends the dynamic sizing of rendered projection
chunks to layer groups, which are rendered through
gimp:buffer-source-validate, rather than just the main image
projection.

(cherry picked from commit 83dd94ba6a)
2018-11-28 13:27:01 -05:00
a831531d88 New upstream version 2.10.8 2018-11-08 20:11:56 -05:00
6d9022f2e6 app: migrate gimpoperationmaskcomponents to new iterator api
(cherry picked from commit 55b3438328)
2018-09-18 12:36:13 +02:00
5818585a8b app: migrate gimpoperationgradient to new iterator api
(cherry picked from commit c6d23add65)
2018-09-18 12:36:13 +02:00
925803f242 app: migrate gimpoperationcagetransform to new iterator api
(cherry picked from commit f03a84d607)
2018-09-18 12:36:13 +02:00
fc222c8392 app: migrate gimpoperationcagecoefcalc to new iterator api
(cherry picked from commit 822f9f0d2b)
2018-09-18 12:36:13 +02:00
04517b842a app: migrate operationbuffersourcevalidate to new iterator api
(cherry picked from commit 95358ca1fa)
2018-09-18 12:36:13 +02:00
9bb61b2a3c New upstream version 2.10.6 2018-08-20 09:59:39 -04:00
af2a27f1c9 Issue #1662 - GIMP crashes while using cage transform when selection is active
Fixed by implementing Massimo's two findings:

gimp_operation_cage_transform_process(): if aux_buf is NULL, bail out
after initializing out_buf with identity vectors, fixes the crash.

gimp_cage_tool_create_filter(): set the drawable filter's region to
GIMP_FILTER_REGION_DRAWABLE, fixes offset when there is a selection.

(cherry picked from commit 49dfc6143d)
2018-08-07 20:11:52 +02:00
75837694e6 app: gimp:semi-flatten propagate babl space 2018-07-16 13:37:01 +02:00
0a2ec7c292 app: gimp:threshold-alpha propagate babl space 2018-07-16 13:37:01 +02:00
9b4e8ee275 app: gimp:set-alpha propagate space 2018-07-16 13:37:01 +02:00
a8a7c99389 app: gimp:grow propagate babl space 2018-07-16 13:37:01 +02:00
739d72c562 app: gimp:shrink propagate bable space 2018-07-16 13:37:01 +02:00
6a6ef0f2e1 app: propagate babl space in pointfilter base class 2018-07-16 13:37:01 +02:00
df00af81b3 app: gimp:flood propagate babl space 2018-07-16 13:37:01 +02:00
f4cd1f7970 app: gimp:desaturate propagate babl space 2018-07-16 13:37:01 +02:00
3c49e43062 app: gimp:compose-crop propagate babl space 2018-07-16 13:37:01 +02:00
b7ca5f1997 app: gimp:border propagate babl space 2018-07-16 13:37:01 +02:00
9e71fc0983 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.

(cherry picked from commit bab75b7365)
2018-07-14 14:23:42 +02:00
c743aed29d app: relax precondition checks in gimp_operation_config_get_type()
Only require the parent type if the requested type is not already
registered.

(cherry picked from commit 9ef39b507b)
2018-07-13 13:58:51 +02:00
e7cfda7d9f app: remove duplicate include in gimpcurvesconfig.c
(cherry picked from commit b5b48e51c8)
2018-07-13 01:19:33 +02:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
cc20410e80 app, libgimp*: make user visible color model labels consistent
- "LCh" intead of "LCH"
- "CIE LCh" instead of "CIELCh"
- "HSV Hue" instead of "Hue (HSV)" for all models/components

(cherry picked from commit 926dc070ef)
2018-07-08 16:21:23 +02:00
Ell
83d74e270c Issue #1682 - Segfault when starting GIMP, due to empty data files
Use gimp_input_data_stream_read_line_always(), instead of
g_input_data_stream_read_line(), in a bunch of places that don't
expect EOF.  If we don't do that, the code assumes the GError
parameter is set by the function and returns an error indication,
causing the caller to segfault when it tries to access
error->message.  Instead, we now process an empty line when EOF is
reached, which is caught by the normal parsing logic.

Additionally:

  - Use gimp_ascii_strto[id]() when loading gradients, generated
    brushes, and palettes, to improve error checking for invalid
    numeric input.

  - Improve gradient-segment endpoint consistency check.

  - Allow loading palette files with 0 colors.  They can be created
    during the session, so we might as well successfully load them.

(cherry picked from commit 993bbd354e)
2018-06-20 15:14:21 -04:00
Ell
f9ae3ae014 Issue #1490 - Crash when flattening an XCF file
The default stack size for new threads on MacOS is 512 KiB, making
our 512 KiB limit for stack-allocated buffers in
gimp_operation_layer_mode_real_process() too high.  Lower it to
256 KiB.

(cherry picked from commit 367399e5c0)
2018-05-25 20:35:32 -04:00
Ell
1d6d054212 app: in GimpOperationGradient, use sampler for reading the distance buffer
... instead of using gegl_buffer_get() directly.  This is slightly
faster.

(cherry picked from commit ef43fc395c)
2018-05-25 12:26:24 -04:00
efdf9e63ac New upstream version 2.10.2 2018-05-20 22:48:19 -04:00
Ell
b7d95ad503 app: in GimpOperationCageTransform, use sampler object ...
... instead of gegl_buffer_sample()

GEGL commit 26f13cbfe9aaaa8c176162e54fdbb8af6876538e got rid of the
per-buffer cached samplers, making gegl_buffer_sample() much more
expensive, suitable primarily for one-off samples.

Use a sampler object instead.
2018-05-13 19:40:46 -04:00