Commit Graph

42460 Commits

Author SHA1 Message Date
c08932cab0 plug-ins: forward the error message if file-pat-save-internal fails
(cherry picked from commit b71ebcea6d)
2019-02-16 19:02:20 +01:00
Ell
339368f562 app: in gimppaintcore-loops, in MaskComponents::finalize_step(), chain up
(cherry picked from commit e513e9e054)
2019-02-16 10:11:10 -05:00
Ell
b6546536f9 app: use MASK_COMPONENTS algorithm in gimp_paint_core_{paste,replace}()
Remove the mask_components_onto() gimppaintcore-loops function, and
the GimpPaintCore::comp_buffer member.  Instead, in
gimp_paint_core_paste() and gimp_paint_core_replace(), use the
MASK_COMPONENTS algorithm, added in the previous commit.

(cherry picked from commit c7d8d9ba2e)
2019-02-16 10:02:38 -05:00
Ell
c4430b3deb app: in gimppaintcore-loops, add MASK_COMPONENTS algorithm
In gimppaintcore-loops, add a new MASK_COMPONENTS algorithm, which
masks the output of compositing into the destination buffer,
according to a component mask.  The algorithm uses the same code as
gimp:mask-comopnents, and can be used as part of a
gimp_paint_core_loops_process() pipeline, instead of using a
separate function.

(cherry picked from commit 08fa46ea41)
2019-02-16 10:01:10 -05:00
Ell
fe69dd2207 app: in gimppaintcore-loops, add [Temp]CompBuffer algorithm helper-classes
In gimppaintcore-loops, add a CompBuffer algorithm helper-class,
which provides access to the output buffer used for compositing,
to be used by the DO_LAYER_BLEND algorithm instead of the
destination buffer.

CompVuffer itself doesn't provide the storage for the buffer; this
is rather the responsibility of the algorithms that use it.  The
TempCompBuffer algorithm helper-class provides temporary storage
for the compositing buffer, and can be used by algorithms that need
a temporary buffer.

(cherry picked from commit 858f30a609)
2019-02-16 10:01:10 -05:00
Ell
ada815673e app: in gimppaintcore-loops, mark algorithms as mandatory/suppressed
In gimppaintcore-loops, use {Mandatory,Supressed}AlgorithmDispatch,
added in the previous commit, to mark certain algorithms as always
occuring, or never occuring, in all hierarchies.

(cherry picked from commit b717ead1ab)
2019-02-16 10:01:09 -05:00
Ell
8b86296979 app: in gimppaintcore-loops, add {Mandatory,Suppressed}AlgorithmDispatch
In gimppaintcore-loops, add MandatoryAlgorithmDispatch and
SuppressedAlgorithmDispatch class templates, which implement
dispatch functions suitable for algorithms which are always part of
the hierarchy, or never part of the hierarchy, respectively.  Using
one of these classes as the dispatch function for a given algorithm
verifies that the algorithm is/isn't included in the requested-
algorithm set, but doesn't otherwise increase the number of
instanciated hierarchies, since only one of these cases has to be
handled.

(cherry picked from commit fc7ffc71a3)
2019-02-16 10:01:09 -05:00
Ell
3dd2cf27b5 app: in gimppaintcore-loops, remove individual-algorithm functions
In gimppaintcore-loops, remove the individual-algorithm convenience
functions, which are merely wrappers around
gimp_paint_core_loops_process(), and aren't used anywhere anymore.
This allows us to avoid instanciating certain algorithm-hierarchies
which aren't used in practice, as will be done by the following
commits.

(cherry picked from commit 95761db557)
2019-02-16 10:01:07 -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
07dd124e06 Update Marathi translation 2019-02-16 08:44:53 +00:00
08746b7e26 Update Marathi translation 2019-02-16 08:40:56 +00:00
Ell
83552620eb app: in gimp_gegl_apply_cached_operation(), don't dup src buffer for point ops
In gimp_gegl_apply_cached_operation(), when the source and
destination buffers are the same, avoid duplicating the source
buffer when the applied operation is a point operation, since
applying it in chunks from/to the same buffer is not a problem in
this case.

(cherry picked from commit 0d21f2469b)
2019-02-15 12:40:12 -05:00
Ell
bd67478b49 app: add gimp_gegl_node_is_point_operation()
... which takes a GeglNode, and determines if the associated
operation is a point operation.

Use in GimpFilterTool, instead of performing the same check
manually.

(cherry picked from commit 918f2e75bd)
2019-02-15 12:40:11 -05:00
ace1229823 Update Japanese translation 2019-02-15 14:10:20 +00:00
9a30591b1e Update Polish translation 2019-02-14 19:48:31 +01: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
Ell
f844965455 app: remove gimp_gegl_replace()
Remove gimp_gegl_replace(), which is not used anywhere since the
last commit.  It's redundant with the rest of our compositing code,
in particular, gimp:replace and gimp:mask-components.

(cherry picked from commit d2f8413173)
2019-02-14 11:05:20 -05:00
Ell
116e8a6d4b app: remove gimp_drawable_replace_buffer()
Remove gimp_drawable_replace_buffer(), which is no longer used
anywhere since commits ddb69b77a7 and
3451ffb62c.  This eliminates
redundancy, since all compositing is now done through the layer-
mode code.

Furthermore, gimp_drawable_replace_buffer() used the drawable's
active-component array, whose layout depends on the image mode, as
an argument to gimp_gegl_replace(), which always expects an RGBA
component array, resulting in broken component masking in non-RGB
images.

(cherry picked from commit 2074accb60)
2019-02-14 11:05:19 -05:00
0fef0a55f8 app: gimp_edgel_region_area() may return < 0 for non-closed zones.
The algorithm to compute a zone area by following its border only works
well for fully closed zones. It may return negative values otherwise.
Let's just assume the created zone is big in this case (which may or may
not be the case, but this is the safe case as it does not prevent
closure creation).

(cherry picked from commit 0636c302a3)
2019-02-14 13:54:24 +01:00
daf7754e7a Update Spanish translation 2019-02-14 12:17:52 +00:00
e24f9eec37 Issue #2961: minor coding style fix.
Missing space, and anyway let's use named parameters, which makes the
code better self-documented.

(cherry picked from commit 35eff00e2e)
2019-02-14 12:12:24 +01:00
648703b6f0 Remap Linear Invert's mnemonic to I to remove a duplicate with Levels 2019-02-14 01:21:01 +03:00
Ell
04052fe3a4 app: in GimpOperationTool, add scrollbar width to scrolled-window requisition
... so that the scrollbar doesn't cover the child in wide UIs.
2019-02-13 13:27:43 -05:00
Ell
0a82bd1109 app: in gimpbrushcore-loops, fix memory corruption in clear_edges()
s/width/height/

Fixes commit 9d19e804ed.

(cherry picked from commit 72d4977574)
2019-02-13 12:33:48 -05:00
3ff2285ba8 Setting the FileChooserbutton to a fixed width.
(cherry picked from commit 582801ccc5)
(cherry picked from commit b44c2e9352)
(cherry picked from commit cdd686f752)
(cherry picked from commit 3b818f6a9b)
(cherry picked from commit c7d5438b49)

Note from reviewer: sorry, this was not squashed on master! Gitlab
failed to squash even though the "squash commits" checkbox was checked!
So it ended as a 5-commit 1-line change!
:-/
2019-02-13 17:16:30 +01:00
18d86cccbe NEWS: update. 2019-02-13 16:30:17 +01:00
b409a781cd app: out-of-gamut for grayscale images too in GimpFgBgEditor.
I realized that the same issue as for indexed images could also apply to
grayscale. If your fg/bg colors are not gray, it should not be expected
for them to be paintable. So let's give the out-of-gamut hint.

(cherry picked from commit 9090de96f2)
2019-02-13 16:25:54 +01:00
e48c239459 app: GimpFgBgEditor displays the out-of-gamut color for indexed images.
If a color is not within the indexed image's palette, we can consider it
to be out-of-gamut too (the gamut of such image being its palette).

This is a first step towards fixing #2938. Basically currently opening
indexed images is not made obvious and you can end up thinking GIMP is
broken as when you try to paint with a given FG or BG color, you may get
a completely different color on the canvas. And it is not obvious to
realize why. Now at least, the FG/BG color will tell you when the color
you are trying to paint with is not within the accepted palette.

(cherry picked from commit 7b4c96d03d)
2019-02-13 16:24:09 +01:00
3fd78441ba app: pack color picker and hexadecimal entry on same line in Color dock.
There was no use to pack them on 2 lines. It was just making the FG/BG
widget overly huge, and the color picker button and hex entry very long.
This was just ugly. Also this dock is tall enough, so packing things
horizontally when it makes sense is better.

(cherry picked from commit 45adf9d0d7)
2019-02-13 16:13:24 +01:00
4774bd3b48 app: s/plug-In/plug-in in a GUI-visible string.
(cherry picked from commit a6aa14bca2)
2019-02-13 16:13:07 +01:00
b2fa4c6299 app: clarify function to validate line art closure.
Add some comments and string docs as it is not that obvious to
understand the whole logics, invert the return value (returning TRUE
when the closure line is accepted, instead of the opposite) and rename
it to more appropriate gimp_line_art_allow_closure().

(cherry picked from commit c4beca8c90)
2019-02-13 16:13:01 +01:00
b2181d0fb2 app: proper signedness for return value of gimp_edgel_region_area().
It is just weird to return a negative area and multiply it by -1.
Just apply the proper signs from the start.

(cherry picked from commit 14e7424403)
2019-02-13 16:12:54 +01:00
f5225f2211 app: error messages should happen on button press, not initialization.
The initialization is sometimes done when switching tools (for instance
when selecting the active tool by command), not always on button press.
So the error output behavior was inconsistent, and worse, the tool was
sometimes not forbidden to run when it should have been.
Just run all the checks (layer groups, locks and whatnot) on button
press.

(cherry picked from commit 74cfd4fd95)
2019-02-13 16:12:41 +01:00
8e5e7306ca Update Japanese translation 2019-02-13 14:11:46 +00:00
4cf6d12912 Updated Italian translation 2019-02-13 11:29:44 +01:00
64d0e29e42 plug-ins: remove stuff that is no longer needed from file-pat
(cherry picked from commit 52b1348f3d)
2019-02-12 21:39:23 +01:00
7ce90a19b4 app, plug-ins: move pattern saving to the core
but only the actual saving code, not the export magic and dialog.

Add new internal procedure file-pat-save-internal which is not
registered as a file procedure and always works non-interactively on
the passed arguments and only saves the passed drawable. Use the new
internal procedure from the file-pat-save code and remove all file
writing code from the plug-in.

This way all pattern file writing code duplication is killed, while
the whole export mechanism is completely unchanged.

(cherry picked from commit b29ecfb5da)
2019-02-12 21:34:17 +01:00
376b053129 app: don't unref a NULL GimpTempBuf in gimp_pattern_copy()
(cherry picked from commit a95c169091)
2019-02-12 21:17:04 +01:00
Ell
4c6b181371 app: link tests against libappfile-data
(cherry picked from commit 68b22d45ed)
2019-02-12 13:54:28 -05:00
cf76b7f73c app: implement brush saving in the core
and enable duplicating the clipboard brush, like for patterns.

(cherry picked from commit 1e6b26e83a)
2019-02-12 18:54:16 +01:00
3dc01393eb app: remove useless includes from gimppattern-save.c
(cherry picked from commit 831d04ec7e)
2019-02-12 18:47:06 +01:00
Ell
88787d905b m4macros: remove binreloc.m4 from EXTRA_DIST
... it was removed by commit
4d84c1d7ee.

(cherry picked from commit 74a151a124)
2019-02-12 10:10:33 -05:00
Ell
ecc456556e app: in gimppaintcore-loops, fix indentation in DispatchPaintMaskToCompMask
(cherry picked from commit 4ecbf33e18)
2019-02-12 09:37:09 -05:00
62db4174dc Update Japanese translation 2019-02-12 14:30:29 +00:00
Ell
0066a47013 app: in gimp_paint_core_replace(), improve applicator path
In the applicator path of gimp_paint_core_replace(), actually use
the paint-core's applicator, instead of using
gimp_drawable_replace_buffer().  This improves speed, consolidates
code, and fixes some cases in which the latter is broken.

Furthermore, when using CONSTANT paint application-mode, use the
paint-core's undo_buffer as the compositing source, rather than the
drawable buffer, which is the correct behavior.

(cherry picked from commit 3451ffb62c)
2019-02-12 09:27:28 -05:00
Ell
940197e2d7 app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer
In the applicator path of gimp_paint_core_paste(), use the paint
mask directly when combining it to the canvas buffer, rather than
using a copy of it, since it's not being modified.

Fix some comments.

(cherry picked from commit ba6713bbe1)
2019-02-12 09:27:28 -05:00
Ell
1c2fe3b51c app: implement gimp_paint_core_replace() using gimp_paint_core_loops_process()
Implement the no-applicator path of gimp_paint_core_replace() in
terms of gimp_paint_core_loops_process(), using the algorithms
added in the previous commit, instead of using
gimp_drawable_replace_buffer().  This improves speed, consolidates
code, and fixes some cases in which the latter is broken.

Furthermore, when using CONSTANT paint application-mode, use the
paint-core's undo_buffer as the compositing source, rather than the
drawable buffer, which is the correct behavior.

(cherry picked from commit ddb69b77a7)
2019-02-12 09:27:25 -05:00
Ell
f5222ce4d0 app: in gimppaintcore-loops, add {CANVAS_BUFFER,PAINT_MASK}_TO_COMP_MASK algorithms
In gimppaintcore-loops, add CANVAS_BUFFER_TO_COMP_MASK and
PAINT_MASK_TO_COMP_MASK paint algorithms, which copy the canvas
buffer and the paint mask, respectively, to the compositing mask.
When there is an image mask buffer, the algorithms additionally
combine the copied mask with the mask buffer.  When possible, the
algorithms use the canvas buffer/paint mask data directly as the
compositing mask data, instead of copying.

These algorithms are necessary in order to implement
gimp_paint_core_replace() in terms of
gimp_paint_core_loops_process(), which is done by the next commit.

(cherry picked from commit 183a55613e)
2019-02-12 09:26:23 -05:00