Commit Graph

551 Commits

Author SHA1 Message Date
Ell 2cd7938f02 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.
2019-01-24 04:15:22 -05:00
Ell 889e2e26ee 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.
2019-01-06 07:37:19 -05:00
Ell ed7ea51fb7 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.
2018-12-27 11:44:25 -05:00
Ell f508ec8b89 app: mark REPLACE and PASS_THROUGH modes as trivial 2018-12-03 09:54:09 -05: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
Ell 8adec5fb3a 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).
2018-12-02 03:10:30 -05:00
Ell ce3a6c4fd6 app: use gimp_gegl_rectangle_align_to_tile_grid() in gimp:buffer-source-validate
... instead of custom code.
2018-12-02 03:10:28 -05:00
Ell dbab0b557d app: in Luminance mode, cache RGBA -> Y fish 2018-12-01 05:55:17 -05:00
Ell 70b7316ebc 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.
2018-12-01 05:55:16 -05:00
Øyvind Kolås 4dd3e2197a app: cache fishes per operation instance in layer-modes
There was a global 3x3 array of babl fishes used for converting between
blending and compositing pixel representations, these were all hard-coded to
operate within the sRGB babl-space family. This commit updates a per-instance
array during operation prepare instead, that comes preconfigured with fishes
derived from the correct space. Since the same operation instance might get
different space input during its life time we store and compare the cached
fishes with the current format (which is unique depending on space).

This should address the problem seen in issue #2592
2018-11-30 01:23:25 +01:00
Ell 83dd94ba6a 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.
2018-11-28 13:26:40 -05:00
Øyvind Kolås 34376c7abf app: propagate space in gimp_layer_mode_get_format
We were not propagating the space properly causing compositing and blending to
always happen in default/linear sRGB space.
2018-11-01 01:51:47 +01:00
Øyvind Kolås 55b3438328 app: migrate gimpoperationmaskcomponents to new iterator api 2018-09-11 01:47:31 +02:00
Øyvind Kolås c6d23add65 app: migrate gimpoperationgradient to new iterator api 2018-09-11 01:47:12 +02:00
Øyvind Kolås f03a84d607 app: migrate gimpoperationcagetransform to new iterator api 2018-09-11 01:46:53 +02:00
Øyvind Kolås 822f9f0d2b app: migrate gimpoperationcagecoefcalc to new iterator api 2018-09-11 01:46:34 +02:00
Øyvind Kolås 95358ca1fa app: migrate operationbuffersourcevalidate to new iterator api 2018-09-11 01:46:10 +02:00
Michael Natterer 6938d11716 Issue #1997 - Colors not properly converted to image's color space
Add a Babl space parameter to gimp_gegl_color_new() and all utility
functions using it. Pass NULL if the GimpRGB actually is sRGB, pass
the image's layer space if the color was already converted using
gimp_pickable_srgb_to_image_color() or similar.
2018-08-09 20:04:44 +02:00
Michael Natterer 49dfc6143d 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.
2018-08-07 20:09:35 +02:00
Michael Natterer e09e563a70 Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.

libgimp:

- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
  as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
  NON_LINEAR and PERCPTUAL for each encoding, matching the babl
  encoding variants RGB, R'G'B' and R~G~B~.

- gimp_color_transform_can_gegl_copy() now returns TRUE if both
  profiles can return a babl space, increasing the amount of fast babl
  color conversions significantly.

- TODO: no solution yet for getting libgimp drawable proxy buffers in
  the right format with space.

plug-ins:

- follow the GimpPrecision change.

- TODO: everything else unchanged and partly broken or sub-optimal,
  like setting a new image's color profile too late.

app:

- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
  replacement for all "linear" booleans.

- change gimp-babl functions to take babl spaces and GimpTRCType
  parameters and support all sorts of new perceptual ~ formats.

- a lot of places changed in the early days of goat invasion didn't
  take advantage of gimp-babl utility functions and constructed
  formats manually. They all needed revisiting and many now use much
  simpler code calling gimp-babl API.

- change gimp_babl_format_get_color_profile() to really extract a
  newly allocated color profile from the format, and add
  gimp_babl_get_builtin_color_profile() which does the same as
  gimp_babl_format_get_color_profile() did before. Visited all callers
  to decide whether they are looking for the format's actual profile,
  or for one of the builtin profiles, simplifying code that only needs
  builtin profiles.

- drawables have a new get_space_api(), get_linear() is now get_trc().

- images now have a "layer space" and an API to get it,
  gimp_image_get_layer_format() returns formats in that space.

- an image's layer space is created from the image's color profile,
  change gimpimage-color-profile to deal with that correctly

- change many babl_format() calls to babl_format_with_space() and take
  the space from passed formats or drawables

- add function gimp_layer_fix_format_space() which replaces the
  layer's buffer with one that has the image's layer format, but
  doesn't change pixel values

- use gimp_layer_fix_format_space() to make sure layers loaded from
  XCF and created by plug-ins have the right space when added to the
  image, because it's impossible to always assign the right space upon
  layer creation

- "assign color profile" and "discard color profile" now require use
  of gimp_layer_fix_format_space() too because the profile is now
  embedded in all formats via the space.  Add
  gimp_image_assign_color_profile() which does all that and call it
  instead of a simple gimp_image_set_color_profile(), also from the
  PDB set-color-profile functions, which are essentially "assign" and
  "discard" calls.

- generally, make sure a new image's color profile is set before
  adding layers to it, gimp_image_set_color_profile() is more than
  before considered know-what-you-are-doing API.

- take special precaution in all places that call
  gimp_drawable_convert_type(), we now must pass a new_profile from
  all callers that convert layers within the same image (such as
  image_convert_type, image_convert_precision), because the layer's
  new space can't be determined from the image's layer format during
  the call.

- change all "linear" properties to "trc", in all config objects like
  for levels and curves, in the histogram, in the widgets. This results
  in some GUI that now has three choices instead of two.
  TODO: we might want to reduce that back to two later.

- keep "linear" boolean properties around as compat if needed for file
  pasring, but always convert the parsed parsed boolean to
  GimpTRCType.

- TODO: the image's "enable color management" switch is currently
  broken, will fix that in another commit.
2018-07-21 16:42:57 +02:00
Michael Natterer bab75b7365 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.
2018-07-14 14:19:27 +02:00
Michael Natterer 9ef39b507b app: relax precondition checks in gimp_operation_config_get_type()
Only require the parent type if the requested type is not already
registered.
2018-07-13 13:57:02 +02:00
Michael Natterer b5b48e51c8 app: remove duplicate include in gimpcurvesconfig.c 2018-07-13 01:17:16 +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
Michael Natterer 926dc070ef 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
2018-07-08 16:15:13 +02:00
Øyvind Kolås 8f63397ef7 app: gimp:semi-flatten propagate babl space 2018-07-06 15:27:55 +02:00
Øyvind Kolås 11dd90eb89 app: gimp:threshold-alpha propagate babl space 2018-07-06 15:09:18 +02:00
Øyvind Kolås f3a757ff33 app: gimp:set-alpha propagate space 2018-07-06 15:03:37 +02:00
Øyvind Kolås 045328c889 app: gimp:grow propagate babl space 2018-07-06 14:53:16 +02:00
Øyvind Kolås 4d5a967d6a app: gimp:shrink propagate bable space 2018-07-06 14:51:45 +02:00
Øyvind Kolås df4f9e0d9b app: propagate babl space in pointfilter base class 2018-07-06 14:51:23 +02:00
Øyvind Kolås ae2c30ad0e app: gimp:flood propagate babl space 2018-07-06 14:50:08 +02:00
Øyvind Kolås 38b1502024 app: gimp:desaturate propagate babl space 2018-07-06 14:48:26 +02:00
Øyvind Kolås 0b4d41c2ee app: gimp:compose-crop propagate babl space 2018-07-06 14:48:13 +02:00
Øyvind Kolås 5e8a5cf999 app: gimp:border propagate babl space 2018-07-06 14:47:27 +02:00
Ell 993bbd354e 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.
2018-06-20 15:13:05 -04:00
Ell 367399e5c0 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.
2018-05-25 20:34:46 -04:00
Ell ef43fc395c app: in GimpOperationGradient, use sampler for reading the distance buffer
... instead of using gegl_buffer_get() directly.  This is slightly
faster.
2018-05-25 12:20:48 -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
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Ell 2c58598172 app: add gimp_layer_mode_is_alpha_only()
... which determines if a layer mode's blend function only affects
the alpha, maintaining the backdrop's color.  This is currently
true only for ERASE, SPLIT, and ANTI_ERASE modes.
2018-05-07 16:53:29 -04:00
Ell f6a56fac51 app: move exclusion and linear-burn modes to a more logical position
... in the layer-mode menu (this only affects UI.)
2018-04-26 16:08:55 -04:00
Ell 2d19848277 app: don't invalidate gradient cache upon gradient-type changes
In GimpOperationGradient, since we no longer avoid using the
gradient cache for conical gradients, the gradient type doesn't
affect the cache.
2018-04-26 05:34:58 -04:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Ell 5970046e25 app: use gradient cache for conical gradients
Add gimp_drawable_gradient_adjust_coords(), which adjusts the
gradient segment coords according to the gradient type, so that, in
cases where the gradient span is unrelated to the segment length,
the gradient cache (in GimpOperationGradient) is big enough not to
produce banding.  Use the new function in gimp_drawable_gradient()
and in the gradient tool, instead of duplicating the logic.

Move the shapreburst coordinate-adjustment logic to the new
function, and add appropriate logic for conical gradients.

Remove the code that avoids using the gradient cache for conical
gradients from GimpOperationGradient.
2018-04-25 14:05:19 -04:00
Ell 38ba45cf31 app: in GimpOperationGradient, move cache generation back to process()
Undo the part of commit fa9a4108c3
that moved cache generation from process() to prepare().  prepare()
is called after each property change, in order to calculate the
op's bounding box for invalidation.  Since we only need the cache
for actual processing, generating it in process() avoids that
overhead.
2018-04-25 14:05:19 -04:00
Ell fa9a4108c3 app: various improvements to GimpOperationGradient
Invalidate the gradient cache while setting relevant properties,
and validate it, reconstructing if necessary, during prepare(),
rather than process(), to avoid the need to use a mutex.

Make sure the cache has at least two elements, corresponding to
the initial and final colors of the gradient, since both colors
might be needed, and to avoid division by zero.

Avoid using a cache if its necessary size is too big, or if the
gradient type is conical, since the necessary cache size for
conical gradients is unrelated to the gradient line length.

Improve index rounding during cache lookup.

Lots of indentation fixes.
2018-04-25 09:48:02 -04:00
Michael Natterer e4f327eca8 Bug 795385 - Segmentation fault when using gradient tool
We don't currently use GimpOperationGradient multi-threaded, but
protect cache initialization in process() with a mutex anyway in cae
we ever do.
2018-04-20 12:31:04 +02:00
Michael Natterer c0bac871ca Bug 795385 - Segmentation fault when using gradient tool
Make sure that the gradient cache in GimpOperationBlend contains
at least one pixel (is never NULL).
2018-04-20 10:23:28 +02:00
Michael Natterer cafb18643f app: another optimization in GimpOperationGradient
Don't reallocate the cache in prepare() but only on demand in
process().
2018-04-18 12:47:40 +02:00
Michael Natterer 9dbf919d46 app: speed up gradient rendering a lot
by using a cache of colors that is calculated once, instead of
calling gimp_gradient_get_color_at() for each rendered pixel.
2018-04-18 01:18:09 +02:00
Michael Natterer b55c116755 Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename GimpOperationBlend to GimpOperationGradient.
2018-04-13 23:36:16 +02:00
Michael Natterer bf49b47620 Bug 795207 - Add color space to blend(gradient) tool options
First WIP commit, adds:

- enum GimpGradientBlendColorSpace { RGB_PERCEPTUAL, RGB_LINEAR }
- linear blending mode for gradient segments
- tool options GUI for the blend and paint tools which use gradients
2018-04-13 22:33:16 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Ell 956ca8e3a3 app: small fix to gimp_operation_buffer_source_validate_process()
Fix tile-grid realignemnt after intersecting the ROI with the dirty
region.
2018-03-26 19:15:20 -04:00
Ell caa3a98f04 Bug 790810 - Nested layer groups lead to a deadlock with multithreading
In gimp_operation_buffer_source_validate_process(), align the ROI
to the tile grid *before* intersecting it with the validate-
handler's dirty region.  This is necessary since, even though
subsequent operations will only read data within the ROI, the
entire tiles containing the ROI will be fetched, resulting in an
area potentially greater than the ROI.  We need to validate this
area in advance, or else it will be validated as part of the
subsequent operations, which can lead into the same deadlock we're
trying to prevent.
2018-03-26 19:04:34 -04:00
Ell f49e4b4263 Bug 794634 - CRITICAL when adding layers with Dissolve mode
Fix a CRITICAL when calling gimp_layer_mode_get_format() with an
AUTO composite space and a NULL preferred format, which is valid:
it means the layer mode is composite-space agnostic (as DISSOLVE
is), and that there's no preferred format.

A NULL preferred format can occur during
gimp_operation_layer_mode_prepare() if the layer's mode node is not
yet attached anything through its "input" or "aux" pads, which is
the case during the call to gimp_layer_update_mode_node() while
constructing the layer's node in gimp_layer_get_node().
2018-03-23 14:57:10 -04:00
Ell a7f3a2dd9f app, pdb, libgimp, plug-ins, menus: rename layer composite modes
Our composite modes don't correspond directly to the Porter-Duff
operators after which they're named, and these names aren't too
descriptive anyway.

Rename the composite modes as follows:

  Source Over       =>  Union
  Source Atop       =>  Clip to Backdrop
  Destination Atop  =>  Clip to Layer
  Source In         =>  Intersection

Update relevant code, including UI text, enumerator names, function
names, and action names.
2018-03-14 16:19:09 -04:00
Jehan 5751bb114e Bug 781621 - PDB shapeburst gradient is slower than the blend tool.
PDB function gimp_edit_blend() was based on "gimp:shapeburst" operation
whereas the rest of GIMP (in particular, the Blend tool) used
"gegl:distance-transform" which is much faster.
Setting the operation to "manhattan" metric ensures that it still
renders the same way as in 2.8 while being a lot faster.

There was still a problem regarding as how it renders differently from
the Blend tool, but it turns out that the Blend tool is the one
rendering differently from how it used to in 2.8. We should discuss
adding the "metric" property in the tool options.
2018-03-14 16:07:18 +01:00
Jehan 6f127f9db4 app: disable multi-threading on "gimp:shapeburst" operation.
This operation is currently broken on multi-thread. So disable
multi-threading, at least temporarily (if not forever since apparently
we can get similar output with "gegl:distance-transform", but much
faster and nicer). See bug 781621.
2018-03-13 18:24:08 +01:00
Ell 8d3b287273 app: improve gimp_layer_mode_get_format()
When the layer mode is composite-space agnostic, return a fast
format based on the preferred format's model, not the exact format.
2018-02-12 13:49:03 -05:00
Jehan ec14e1006e app: add a g_return_val_if_fail() to avoid a crash.
It seems gegl_buffer_sample() crashes with the first parameter being
NULL so let's just test its value first. This will output a huge
quantity of CRITICALs in this edge case but that's much better than a
crash. :-)
See also bug 793371 where this bug is being processed.
2018-02-12 19:42:11 +01:00
Jehan 2956cde6cf app: switch to #ifdef GEGL_BUG_645810_SOLVED code.
When checking the Cage Transform operation code, I saw some ifdef meant
to be switched to when bug 645810 is fixed. It also says in a comment:
> /* When Gegl bug #645810 will be solved,
>    this should be a good optimisation */
Checking said bug, it appears it has been fixed since 2012!
I also fixed a bit the parameters in gegl_buffer_sample() call since it
seems the function signature has changed quite a bit.
2018-02-12 19:23:08 +01:00
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 07355803a8 app: use gegl_buffer_signal_connect() in gimp:buffer-source-validate
... instead of g_signal_connect(), to connect to the buffer's
"changed" signal.
2018-02-07 09:54:08 -05:00
Michael Natterer b23f231a1a Bug 792470 - Some filters e.g. "Levels" are not added to "Repeat last" history
The four remaining "classic" color tools (Brightness-Contrast, Curves,
Levels and Threshold) are in fact just special UIs for otherwise
completely normal filter ops.

Add normal filter actions for them and invoke them like all
other filters, which makes them show up in the filter history
automatically.

The only small hack needed is to special case them in
gimp_gegl_procedure_execute_async() so the right tools are created
instead of the default GimpOperationTool. Also, blacklist the
automatically generated tools actions from action search and the
shortcut editor.
2018-01-14 15:42:29 +01:00
Ell d34800c5fc app: reintroduce clamping to vivid-light mode
... removed by commit 0f9da165e0, and
improved by this commit.

Our foo-light modes aren't really prepared to handle out-of-range
input.  Make sure that in-range input doesn't result in out-of-
range output.
2018-01-06 12:56:44 -05:00
Ell 3b52b044f9 app: small cleanup in gimpoperationlayermode-blend.c
Indentation, float literals, etc...
2018-01-06 12:31:51 -05:00
Ell 0f9da165e0 Bug 790566 - Modify the divide blend mode to not max out at 5.0
Add a safe_div() function to gimpoperationlayermode-blend.c, and
use it in the relevant blend funcs, instead of plain division.
This function clamps the quotient to some reasonable range, to
avoid infinities, and maps epsilon/... to 0, to avoid NaN.  The
latter part results in similar qualitative results to the
corresponding legacy modes, when calculating 0/0.
2018-01-06 12:31:51 -05:00
Michael Natterer 54d3beab9c Bug 757444 - Curves and Levels should operate by default on linear RGB...
...and present linear RGB Histograms

This is step one: implement the feature at all (without new defaults
or proper GUI, cough).

Add boolean "linear" properties to GimpOperationPointFilter,
GimpCurvesConfig and GimpLevelsConfig.

In the filter, simply set the input/output formats to linear in
prepare().

In the curves and levels tools, add "Linear" toggles from hell,
like in the histogram dockable, and make sure things work right
wrt changing and resetting the property, switching from levels
to curves, and picking colors.

The result currently changes when switching a non-nop curves/levels
between perceptual and linear, because adjusting the parameters
between the spaces is not implemented yet.
2018-01-05 22:37:18 +01:00
Ell da8bcdcd56 app: in legacy layer modes, clamp after blending, not compositing
In legacy layer modes that may produce out-of-range output given
in-range input, clamp the result after blending and before
compositing, instead of after compositing, to avoid producing
different results than 2.8 in certain cases.
2018-01-04 13:33:57 -05:00
Ell 6759c4e675 app: use float literals in legacy layer modes
... to make the code more consistent with the non-legacy modes.
2018-01-04 13:33:50 -05:00
Michael Natterer dce93c7d7e Bug 762443 - Levels tool Output Level sliders works incorrectly
Add "clamp-input" (which clamps the input values to [0..1])
and "clamp-output" (which clips the final result to [0..1]),
properties, parameters and GUI to:

- GimpLevelsConfig
- GimpOperationLevels
- The levels tool dialog
- The gimp_drawable_levels() PDB API

The old deprecated gimp_levels() PDB API now sets both clamping
options to TRUE which restores the 2.8 behavior.

Also reorder some stuff in GimpLevelsConfig and elsewhere so the
levels parameters are always in the same order.
2018-01-02 18:47:20 +01:00
Ell 0ff3bf93f3 app: misc performance improvements to GimpOperationComposeCrop
Override get_invalidated_by_change() with the same logic as
get_required_for_output(), to avoid unnecessary invalidation.

Avoid format conversion when input and aux have the same format.

Add pass-through fast path when the ROI is completely inside/
outside the cropped rectangle.

Use bulk memcpy(), instead of per-pixel test-and-copy, in
process().
2017-12-26 09:19:46 -05:00
Ell 74a47a8ac9 app: implement get_required_for_output() for GimpOperationComposerCrop
This avoids unnecessarily processing regions of the input and/or
aux nodes that will get cropped out.  In particular, this avoids
processing cropped-out regions when using the filter tool in split-
view mode.
2017-12-25 16:09:45 -05:00
Jehan f28cb1c511 app: add/update some comments.
Keep multi-threading disable on the cage transform operation. It is now
fixed but is a lot much slower than when single-threaded, making it
painful to use on bigger images.
So let's reenable later if we can improve this. See bug 787663.
2017-12-06 23:30:54 +01:00
Massimo Valentini f727e885cd Bug 787663 - Cage tool creates artifacts with multi-threading
Stop recursion only when all 3 vertices of the triangle are outside the
roi (left/right or above/below).
2017-12-06 23:26:08 +01:00
Jehan 87aaf576d2 Bug 787663 - Cage tool creates artifacts with multi-threading.
Temporarily disable multi-threading on the cage transform so that it
performs sanely until it is fixed.
2017-12-06 15:07:50 +01:00
Ell 4e4c1cd57e Bug 790810 - Nested layer groups lead to a deadlock with multithreading
Use gimp:buffer-source-validate, introduced in the previous commit,
for the source node of GimpDrawables.  This avoids threading issues
with layer groups, or any other drawables that may use a validating
buffer, by making sure the buffer is validated before any
succeeding operations, and hence the associated graph is processed
on the same thread as the parent composition.

Restore multithreaded processing in GimpOperationLayerMode.
2017-12-04 16:03:15 -05:00
Ell dec2375a26 app: add gimp:buffer-source-validate operation
gimp:buffer-source-validate is a drop-in replacement for
gegl:buffer-source, however, if the attached buffer has a
validating tile-handler, it makes sure the required region is
validated during process().  This avoids a situation in which
validation happens in different worker threads at the same time
during the processing of a succeeding operation; since validation
is protected by the buffer's tile-storage mutex, this can result in
either a deadlock (currently), or an effective fallback to single-
threaded processing.
2017-12-04 16:02:41 -05:00
Ell 5a28753924 app: add abbreviations for layer modes
Add abbreviated versions for long layer mode names.  In particular,
replace the "(legacy)" suffixes with "(l)" in the abbreviated
versions.
2017-11-30 04:46:46 -05:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Ell 2ff52af5a9 Bug 790810 - Nested layer groups lead to a deadlock with multithreading
Temporarily disable multithreading for GimpOperationLayerMode, to
avoid the deadlock.  The environment variable
GIMP_MULTITHREADED_COMPOSITING can be set to reenable it, for the
sake of debugging.
2017-11-26 10:54:41 -05:00
Øyvind Kolås 9c0dac9e6d app: heed deprectation warning of gegl_operation_context_get_source 2017-11-21 20:21:25 +01:00
Ell 6f7d95c21c app: remove legacy color-erase mode from the layer mode combo
It was accidentally made applicable to layers by commit
7d345071c7.  Only the non-legacy
color-erase mode shoule be applicable to layers (since 2.8 didn't
allow it as a layer mode), while the legacy mode is only available
for painting, and in the fade dialog.
2017-10-23 09:53:07 -04:00
Ell 2bf166d2ce app: use fuzzy comparison in various layer-mode blendfuncs
Use fuzzy comparison, instead of exact comparison, in various layer-mode
blendfuncs which may be sensitive to small error.
2017-10-17 08:47:23 -04:00
Ell 0e9747380b app: in GimpOperationBlend, fix left/right-most colors when offset > 0 2017-10-09 13:15:42 -04:00
Ell a789c6e5e2 app: in GimpOperationBlend, swap leftmost and rightmost colors when ...
... rendering a reversed gradient

Finishes up the last commit.
2017-10-09 13:03:50 -04:00
Ell 4e2e60caf4 app: fix leftmost and rightmost gradient colors in GimpOperationBlend
When rendering a gradient with a repeat mode of NONE, don't sample
the gradient at 0.0 and 1.0, for pixels that lie to the left and to
the right of the gradient, respectively.  Instead, use the left
color of the leftmost segment directly, and, likewise, the right
color of the rightmost segment.  This always gives us the right
color for such pixels, even when there are gradient stops, that may
use different colors, at 0.0 and 1.0,
2017-10-09 12:48:56 -04:00
Ell dfeafcb175 app: cache last-sampled gradient segment in GimpOperationBlend
Remember the gradient segment at which the most-recent sample lies,
and pass it to gimp_gradient_get_color_at() as a seed for segement
lookup on the next sample.  This improves the performance
marginally.
2017-10-09 12:48:56 -04:00
Ell 33b05cd367 Bug 786844 - Issue with grain merge layer mode
Use 128/255, rather than 0.5, as the half-intensity value for
legacy layer modes that use it explicitly, to match 2.8 results.
2017-09-28 10:31:39 -04:00
Michael Natterer 723c4d7f87 app: remove GimpColorizeConfig, merge its props into GimpOperationColorize
Colorize doesn't need a config object just because it has a generated
property for the GUI only.
2017-09-05 21:26:59 +02:00
Ell 5effdd03b4 app: add dedicated op for pass through mode, with shortcuts
Pass through mode uses the same compositing logic as REPLACE mode,
however, it's a special case of REPLACE, where the layer is already
composited against the backdrop.  This allows us to take a few
shortcuts that aren't generally applicable to REPLACE mode.

Add a dedicated op class for pass through mode, derived from the
REPLACE mode op, implementing these shortcuts.
2017-08-31 11:39:38 -04:00
Ell 58fdaae3ad enums: add intermediate generated enum files to .gitignore 2017-08-24 15:35:27 -04:00
Ell f13c177ea7 app: fix babl format names in luminance mode
More refactoring fallout :P
2017-08-20 17:15:32 -04:00
Ell 77f51dd737 app: specify blend function for GIMP_LAYER_MODE_COLOR_ERASE_LEGACY
This is what happens when you edit code with sed :P
2017-08-19 15:37:49 -04:00
Michael Natterer 0cfe550639 app, pdb: change a lot of GIMP_LAYER_MODE_NORMAL_LEGACY to just NORMAL
this commit changes just those which make no difference to
functionality: property and object member defaults that get overridden
anyway, return values of g_return_val_if_fail(), some other stuff.
2017-08-19 20:33:47 +02:00
Ell 71bbd88e00 app: layer mode code shuffling
Commit 3635cf04ab moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses.  As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes.  This is the reckoning :)

Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions.  Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.

Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.

Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.)  This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)

Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.

Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags.  This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.

Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.

Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.

Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 11:19:37 -04:00
Ell 3635cf04ab app: move bottom-layer special casing to GimpOperationLayerMode
GimpFilter's is_last_node field only reflects the item's position
within the parent stack.  When a layer is contained in a pass-
through group, it can be the last layer of the group, while not
being the last layer in the graph as a whole (paticularly, if
there are visible layers below the group).  In fact, when we have
nested pass-through groups, whether or not a layer is the last
node depends on which group we're considering as the root (since
we exclude the backdrop from the group's projection, resulting in
different graphs for different groups).

Instead of rolling our own graph traversal, just move the relevant
logic to GimpOperationLayerMode, and let GEGL do the work for us.
At processing time, we can tell if we're the last node by checking
if we have any input.

For this to work, GimpOperationLayerMode's process() function needs
to have control over what's going on.  Replace the derived op
classes, which override process(), with a call to the layer mode's
function (as per gimp_layer_mode_get_function()) in
GimpOperationLayerMode's process() function.  (Well, actually, this
commit keeps the ops around, and just hacks around them in
gimp_layer_mode_get_operation(), because laziness :P)

Keep using the layer's is_last_node property to do the invalidation.
2017-08-08 15:39:28 -04:00
Ell 440d8d6855 app: add pass-through layer mode
Only add the enum-value/mode-info for now.  Pass-through mode
appears above normal mode, in the default group, for layer groups
only.
2017-08-08 15:39:26 -04:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Ell e15a444656 Bug 784799 - select > shrink and border produce horizontal gaps in selection
The grow, shrink, and border ops are written to process the entire
input at once, so chunking breaks them.  Just make them non-threaded
for now.
2017-07-11 16:49:49 -04:00
Michael Natterer 4f7fff8cb8 app: change some gimp-operation-config.[ch] parameters to GObject
They were GimpObject for no reason, also inconsistent with other
places where we deal with config objects.
2017-07-09 19:20:55 +02:00
Michael Natterer 51cc6893ab app: add gimp_operation_config_list_properties()
which is the same as g_object_class_list_properties() but filters
out the properties for which we don't want to create a GUI.

Use it in gimp_prop_gui_new().
2017-07-09 17:59:29 +02:00
Ell be193acfe0 app: fix parent_class type of GimpOperationScalarMultiplyClass 2017-06-30 16:24:49 -04:00
Jehan 430c31b798 app, plug-ins: clean out trailing whitespaces in source code. 2017-06-17 04:47:53 +02:00
Michael Natterer 4f4d6b27cf app: register the "settings folder" (e.g. GIMPDIR/curves) with the settings type
and remove all settings_folder API and values from GimpFilterTool and
its subclasses.
2017-06-05 22:00:17 +02:00
Michael Natterer 82d23fc6ff app: don't unref the passed file in gimp_operation_config_[de]serialize() 2017-06-05 20:32:07 +02:00
Michael Natterer 109f23af39 app: replace the hue-saturation tool by a generic filter action
Move the GUI to a custom gimppropgui function.
2017-06-05 18:35:05 +02:00
Michael Natterer 85aab2a0f5 app: restore color balance's tooltip 2017-06-05 13:16:59 +02:00
Michael Natterer ecfec4103b app: remove the colorize tool and replace it by a generic filter action 2017-06-04 21:21:43 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Michael Natterer 90698524d9 app: change gimp_operation_config_new() to _get_type()
Return only the config object's GType and do the g_object_new() in the
caller (one caller only needs the type, there is no need to create a
dummy object just to get to its type).
2017-05-29 08:04:52 +02:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Ell a67135658e app: add gimp_layer_mode_get_included_region()
Takes a layer mode and a composite mode, and returns the region
included in the composition.

Use this function in GimpOperationLayerMode, instead of testing
for specific composite modes directly.  Will also be used by
the next commit.

Indentation cleanup in gimp_layer_modes.h
2017-05-11 17:44:55 -04:00
Ell c78cecd76d app: rename GimpLayerModeAffectMask to GimpLayerCompositeRegion
... so that we can use it for other functions that involve
compositing regions (which we do in the next commit).

Rename gimp_operation_layer_mode_get_affect_mask() and
friends to _get_affected_region().
2017-05-11 17:44:55 -04:00
Ell dfce143f8d app: push regenerated operations-enums.c file
Due to last commit.
2017-05-06 18:36:45 -04:00
Ell 13e2153d33 app: swap enum/ui order of dst-atop and src-in
It's a more logical order.  Hopefully, we're going to rename them
soon, so it'll all make more sense.
2017-05-06 18:23:20 -04:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Ell 2d22d0b0ff Bug 780907 - GIMP 2.9.5 layer-blending-mode Tear
Commit 9d4084c82f skips conversion and
blending of (some) transparent source and destination pixels.  When
`blend_out == blend_layer`, it banks on the fact that the alpha values
of `blend_out` would be the same as those of `blend_layer`, and hence
the same as those of `layer`; thing is, we only copy those values from
`layer` to `blend_layer` for the pixels that we *don't* skip, so this
assumption is just wrong :P  This leaves us with bogus alpha values in
`blend_out` for the skipped pixels, when the above equality holds.
For composite modes that use the alpha values of `blend_op` (aka `comp`)
even for transparent input pixels (i.e., src-atop and src-in), this may
result in artifacts.

Fix this by simply initializing the alpha values of `blend_out` for
skipped pixels unconditionally.
2017-04-04 16:48:36 -04:00
Michael Natterer 9b500c03d1 app: initialize generated properties with their default values 2017-03-30 23:21:12 +02:00
Michael Natterer 766d1aa954 app: factor out duplicated code in gimp-operation-config.c 2017-03-24 11:52:41 +01:00
Michael Natterer 70d428591f app: try to move the compat filter config to its new place
from gimpdir/tool-options/ to gimpdir/filters/, and only if moving
fails try reading from the old location as fallback. We don't normally
move files around, but this one-liner nicely avoids cluttering
gimpdir.
2017-03-24 11:44:02 +01:00
Michael Natterer ee6c7ec7b7 Bug 780015 - Filter settings are not properly restored after Gimp restart
Filters settings used to be serialized and deserialized only
when a filter tool's GUI was shown, too late for the code that
re-runs/re-shows filters with previous values.

Move the entire loading/saving code to gimp-operation-config.c, even
adding/removing the dummy separator item between timestamped automatic
history and manually saved settings. Load the settings automatically
when a settings container is requested, but still trigger saving from
the few places the container is changed in the GUI; could also
automate that later.

This commit also moves all settings of filters that have their own
tools from gimpdir/tool-options/ to gimpdir/filters/. Add compat code
to try the old filename if the new doesn't exist, so files are
migrated automatically.

WIP, but this step already fixes the bug.
2017-03-24 01:29:50 +01:00
Elle Stone 48e4044672 Bug 780065 - Change default way to desaturate to Luminance
which unlike HSL Lightness is actually physically meaningful and
also generally speaking much more useful than HSL Lightness.

Change "Lightness" to "Lightness (HSL)" to make it clear that
the "Lightness" in the Colors/Desaturate/Desaturate menu is not the
same as "Lightness" in LAB/LCH.

For completeness add the option to desaturate to "Value (HSV)".

Add links in app/operations/gimpoperationdesaturate.c
to the Wikipedia article with definitions of L/I/V in HSL/HSI/HSV.
2017-03-17 17:16:03 -04:00
Ell 8055f14e6b app: fix and streamline HSL color layer mode
Fixes an error introduced by commit 45516a0ca9.

Also, make the code more consistent across the different HS[VL] modes.
2017-03-16 15:37:35 -04:00
Ell 03756d0980 app: rename "Color (HSV) (legacy)" mode to "Color (HSL) (legacy)"
The color-space qualification is, in fact, a 2.9 thing, so there's no
historic reason to keep the wrong name for the legacy mode.
2017-03-16 06:23:30 -04:00
Ell da9c4270a6 app: fix version comments in GimpLayerMode enum 2017-03-16 04:54:23 -04:00
Ell ff5eb69254 app: improve performance of HSV hue mode
No need to do full back and forth RGB/HSV conversions.
2017-03-15 21:49:13 -04:00
Ell 661c22c06f app: rename "Color (HSV)" mode to "Color (HSL)"
... since that's the color space it actually works in.

Keep the legacy "Color (HSV)" mode's name as is, wrong as it is,
since, well, that's what it used to be called...
2017-03-15 19:30:01 -04:00
Ell 45516a0ca9 app: improve performance of HSV [sic] color mode
No need to do full back and forth RGB/HSL conversions.
2017-03-15 18:52:35 -04:00
Ell 77211f1098 app: improve performance of HSV saturation mode
No need to do full back and forth RGB/HSV conversions.

Change the behavior such that fully desaturated values remain
desaturated, instead of saturating towards red.
2017-03-15 18:50:11 -04:00
Ell bcb242df64 app: improve performance of HSV value mode
No need to do full back and forth RGB/HSV conversions.
2017-03-15 18:48:43 -04:00
Ell 3fa2c91502 app: remove mono-mix layer mode
This effectively reverts commit c6c0899655.

Removing due to lack of consensus.  We can always re-add it in the
future if we decide we want it.
2017-03-15 14:52:14 -04:00
Ell 9d4084c82f app: in gimp_composite_blend(), reduce conversion of transparent pixels
Pixels whose source or destination alpha is zero are not blended, and
therefore do not need to be converted between the composite and blend
spaces (assuming a conversion is necessary to begin with.)  When there
is a large enough segment of consecutive pixels that don't need
blending, split the conversion/blending process around it, so that
we don't convert too many unblended pixels unnecessarily.

For layers with lots of transparency, this can dramatically reduce
compositing time; for layers with no transparency, the added
overhead is rather negligible.
2017-03-13 18:30:15 -04:00
Ell ed0fda032d app: add split layer mode
Subtracts the source layer from the destination, such that
recompositing the result with the source using merge mode
reproduces the original content.
2017-03-10 18:56:32 -05:00
Ell 23e6984d46 app: add merge layer mode
Merge mode lays the source layer on top of the destination, same as
normal mode, however, it assumes the source and destination are two
parts of an original whole, and are therefore mutually exclusive.

This is useful for blending cut & pasted content without artifacts,
or for replacing erased content in general.
2017-03-10 18:56:32 -05:00
Ell c6c0899655 app: add mono-mix layer mode
Calculates the dot product of the two input colors, and uses that
as the value for all the output color's components.  Basically,
a per-pixel mono mixer.

Useful for custom desaturation, component extraction, and crazier
stuff (bump mapping!)
2017-03-10 16:33:14 -05:00
Ell 7d345071c7 app: make color-erase mode an ordinary layer mode
Include color-erase mode in the menu for layers.
2017-03-10 15:27:03 -05:00
Ell dfb3ddc4d9 app: make erase mode an ordinary layer/paint mode
Include erase mode in the menu for layers and general paint tools.
This makes the eraser tool somewhat unnecessary, but allows for
interesting use cases (e.g., airbrush eraser, etc.)
2017-03-10 15:27:03 -05:00
Ell 91ef42d1d0 app: fix subtractive src-over compositing 2017-03-10 15:26:57 -05:00
Ell 8e68ca855d app: fix NULL mask handling in previous commit 2017-03-08 15:28:26 -05:00
Ell 7704b6100e Bug 779326 - GIMP Crash on Merging/flattening image ...
... possibly due to small win32 stack

Limit the number of samples processed in one go by gimp_composite_blend()
so that we don't overflow the stack when we alloca() buffers on it.
2017-03-08 15:07:05 -05:00
Ell 44b4d0f6ab app: small fixes in gimpoperationlayermode.c
I built the thing, how the hell did this happen :P
2017-03-08 15:05:36 -05:00
Ell 7b23e0e937 app: add LEGACY flag to NORMAL_LEGACY mode
Not that we use that for anything...
2017-03-08 14:13:51 -05:00
Ell b22c09e7b7 app: implement color-erase mode as a GimpOperationLayerMode blendfun
... and get rid of the dedicated op.  This gives us support for all
the blend/composite options for this mode.

Rename COLOR_ERASE to COLOR_ERASE_LEGACY, with perceptual blending/
compositing and immutable everything, and add a new COLOR_ERASE
mode, defaulting to linear blending/compositing, with mutable
everything.  Modify affected code.
2017-03-08 14:13:51 -05:00
Ell 398a7b023c app: add subtractive compositing functions to GimpOperationLayerMode
These are more general, and more expensive, versions of the non-
subtractive compositing functions.  They are used with modes that
specify the SUBTRACTIVE flag.  This doesn't affect anything yet, but
the next commit ports color-erase mode to a blendfun.
2017-03-08 14:13:51 -05:00
Ell 40c0ea4fe1 app: add GIMP_LAYER_MODE_FLAG_SUBTRACTIVE
Most modes only modify the *color* of overlapping dest/src regions,
however, erase and color-erase may also reduce their *alpha*, i.e.,
eliminate some of the overlapping content.  Flag these modes with
the new SUBTRACTIVE flag, as they require more general compositing
code.  The next commit adds the said code.
2017-03-08 14:13:51 -05:00
Ell a2f3616a13 app: more consistent layer/comp parameter usage in the compositing functions
Also, don't depend on the layer buffer alignment for the SSE src-atop
function, since it's not used.
2017-03-08 14:13:51 -05:00