Commit Graph

19527 Commits

Author SHA1 Message Date
Jehan b0d2d4fb49 app: indentation fix. 2017-04-22 20:53:08 -03:00
Michael Natterer 61d9197dd4 app: add some blank lines to gimp_help_get_locales() and fix comment syntax 2017-04-21 19:59:35 -03:00
Joao S. O. Bueno c2b643d043 app: For clone tool, pattern source, use the pattern center
Spotted by José Americo Gobbo: when using a pattern source
for the clone tool, the top left corner was picked
as starting control point, which made the "fixed" aligment
rather useless. Using the pattern center allows the
better control of a pattern source.
2017-04-20 00:35:20 -03:00
Michael Natterer bcc3437f5f Bug 344684 - Greyscale (no alpha) clipboard brushes are of the wrong type
Add a "mask-only" property to GimpBrushClipboard. When TRUE, only
create a brush mask (not a pixmap brush with mask and image).

Keep two clipboard brushes around: one classic "Clipboard Image" one
to be used as "stamp", and one new "Clipboard Mask" one that turns the
clipboard into a brush mask.
2017-04-19 17:33:44 -03:00
Michael Natterer cb795e8adc app: add a FIXME about clipboard images in GimpBufferView 2017-04-19 16:53:04 -03:00
Michael Natterer 6eeb5c2ee2 app: support clipboard images in the clipboard brush and pattern 2017-04-19 16:52:10 -03:00
Michael Natterer c2f0226f66 Bug 781408 - script fails due to error in edit-copy / edit-paste
Fix the edit-paste and edit-paste-as-new-image PDB wrappers to use
gimp_get_clipboard_object(), not just clipboard_buffer(), and deal
correctly with entire images in the clipboard.
2017-04-19 16:44:08 -03:00
Ell 8c35cc9872 app: add GIMP_TESTING_NO_GEGL_BLACKLIST flag
When this environment variable is set, all GEGL ops are included
in the GEGL tool.
2017-04-17 15:45:19 -04:00
Ell 0a42c6b4bd pdb: fix input range of context-set-brush-size 2017-04-10 09:57:54 -04:00
Ell d4bb12d8b8 app: fix painting with force == 0
Should be a nop, but instead does the same thing as force == 0.5.
2017-04-10 09:57:54 -04:00
Ell 5255d91032 app: fix total weight calc. of hardness convolution kernel 2017-04-08 07:37:28 -04:00
Ell 670be1f880 app: fix brush offset when shrinking to compensate for blur 2017-04-08 06:50:43 -04:00
Ell 810f1fc722 app: disable brush blur caching
Blurring is much faster now, and the cache mostly gets in the way.
This is a quick hack to disable blur caching for now.
2017-04-08 05:15:55 -04:00
Ell 3bed373bff app: various brush hardness improvements
Fix brush shrinking used to compensate for the blur: avoid over-
shrinking the brush and changing its aspect ratio.

Change the way hardness maps to blur radius: hardness == 0 maps to
the largest radius such that, when the kernel is applied to the
middle pixel of the brush, the kernel is completely within the brush
bounds, taking brush shrinking into account, *assuming the brush is
a circle*.

Use the dimensions of the unrotated brush when calculating the blur
radius, so that rotation doesn't affect the blur amount (the blur
itself is not isotropic, though, and is applied after rotation, so
while the blur amount remains uniform, its effect does depend on the
brush angle.)

Get rid of the blur-radius upper limit -- it's fast enough to handle
large radii now.
2017-04-08 05:15:29 -04:00
Ell 257504cbc2 Bug 780859 - Brush hardness blur is slow
A few additional minor speedups.

Also, make sure we don't overflow for large blur radii.  Not a
problem yet, since the blur radius is capped, but soon...
2017-04-08 04:30:35 -04:00
Ell da30b86ffc Bug 780859 - Brush hardness blur is slow
Add a specialized convolution algorithm for the hardness blur.  It
uses the same kernel as before, but performs the convolution in
(amortized) O(1)-per-pixel time, instead of O(n^2), where n is the
size of the kernel (or the blur radius).

Note that the new code performs the convolution in the input color
space, instead of always using a linear space.  Since our brush
pixmaps (but the not masks) are currently perceptual, the result is
a bit different.
2017-04-07 10:25:21 -04:00
Ell 16bebedc44 pdb: add debug group; add debug-timer-{start,end} procs
Add a debug procedure group, living in 'debug.pdb', which would host
useful debug helper functions.  Functions in this group are not part
of the stable API, and may be changed at any point.

All procedures added to 'debug.pdb' should have a 'debug_' prefix,
and use the new std_pdb_debug() macro, which adds the proper "here be
dragons" warning to their description.

Add two debug procedures: gimp-debug-timer-start() and
gimp-debug-timer-end(), which measure elapsed time, a la
GIMP_TIMER_{START,END}, and can be used to profile script-fu
commands.
2017-04-06 11:48:05 -04:00
Michael Natterer 32239a2588 Bug 315051 - Image preview in transforms keeps original version visible
Argh, didn't commit everything...
2017-04-06 00:29:30 +02:00
Michael Natterer f030511438 Bug 315051 - Image preview in transforms keeps original version visible
If the transformed item is a layer, and we are transforming the entire
layer (if there is now selection), hide the original layer during the
interactive transform. Based on a 2.8 patch from saulgoode.
2017-04-06 00:15:42 +02: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
Ell 6c8ba75021 Bug 779632 - Clone tool jittering
The expression `src_offset_x - coords->x + origin->x` is parsed as
`(src_offset_x - coords->x) + origin->x`; since floating point
arithmetic is not generally associative, even when
`coords->x == origin->x` (in particular, when there is no active
symmetry), it may still yield a different result than plain
`src_offset_x` if there's not enough precision for the intermediary
result (which is usually the case when `{origin,coords}->x` is
noninteger.)  Since `src_offset_x` is an integer, and since the result
of this expression is rounded to an integer, if the error happens to
be in the direction of the rounding, it's magnified to a whole pixel,
which causes visible "jitter".  (Ditto for `src_offset_y` and co.)

Regardless of this issue, we want to individually round `origin->[xy]`
and `coord->[xy]` down before taking their difference, since the
original offset is calculated according to rounded-down coordinates.
This solves the original issue along the way.
2017-04-03 15:38:27 -04:00
Ell d8e8a276aa app: in tools, show source location indicator at pixel center
... instead of at the top-left corner of the pixel
2017-04-03 15:33:23 -04:00
Ell 7c7a1b6383 app: integer-ify position/offset members of GimpSourceCore
We don't support subpixel source sampling, so there's no use in
pretending that we do.  Demoting everything to int as soon as
possible helps guarantee that these values are at least rounded
properly and in fewer places.

Make sure we always round coordinates down, and not toward zero.

Keep using floats only in the signatures of the relevant PDB
functions.
2017-04-03 15:32:27 -04:00
Michael Natterer a9c6bc0283 app: some cleanup in GimpTransformTool
Copy TransInfo arrays around using memcpy(), use memcmp() to
compare them, add a function to allocate one. Clean up some
logic in gimp_transform_tool_check_active_item().
2017-04-03 12:39:33 +02:00
Michael Natterer b6ffccad7a app: default to "no grid" for transform tools
the preview is visible by default, having both is needed only rarely.
2017-04-02 23:41:32 +02:00
Michael Natterer 3c0cffe53d app: add GimpFilterTool::set_config()
and use it to set saved settings on the tool. In GimpOperationTool's
implementation, re-sync the config's output-extent properties with the
drawable.
2017-03-30 23:21:46 +02:00
Michael Natterer 9b500c03d1 app: initialize generated properties with their default values 2017-03-30 23:21:12 +02:00
Jehan 8fee058c1f app: fixing 2 argument type build warnings.
Introduced in commit 5e7d9d8 and completely overlooked by myself!
2017-03-29 15:30:36 +02:00
Michael Natterer da70cc7446 app: make GimpFilterTool always have a container of recent settings
and a GimpSettingsBox. This brings savable settings to all ops, also
the automatic ones in the GEGL tool. It also makes the code cleaner
and more general.
2017-03-28 23:58:52 +02:00
Michael Natterer 7e702ad7b2 app: turn all members of GimpSettingsBox into properties
and make them settable after construction.
2017-03-28 23:58:07 +02:00
Jehan 79a0ca5927 app: "shift" property in tiling was to be soft-limited by image width. 2017-03-27 23:46:11 +02:00
Jehan 5e7d9d8b00 Bug 772785 - Quit dialog should exit when all the images in the list...
... have been saved.
No need to keep a list of 0 images when the creator requested a quit or
close-all actions and manually went through the list to save all
remaining images. Yet one can still cancel the quit/close-all action by
hitting Esc (or Cancel button) during the last save, since it is an
idle source action.
2017-03-27 22:54:53 +02:00
Michael Natterer 8352f356ee app: remove some overengineering from GimpFilterTool
GimpFilterTool::get_settings_ui() is no longer needed, replace
it by a simple utility function in gimpfiltertool-settings.c.

Also, use the GimpFilterOptions functions added earlier, and some
random cleanup.
2017-03-25 14:57:15 +01:00
Michael Natterer f56df8d7dc app: add functions to switch preview side and orientation to GimpFilterOptions 2017-03-25 14:50:19 +01:00
Michael Natterer 3aeebfa178 app: remove all class variables from GimpFilterToolClass
and add them as return values to GimpFilterToool::get_operation(), so
the tools is configured entirely per-instance now.

This makes get_operations()'s signature more evil, but helps making
GimpOperationTool less conplicated and convoluted.
2017-03-25 11:32:17 +01:00
HJ Imbens c3dc3ea59f Fix rle encoding, first byte of run was added to previous non-run. 2017-03-25 03:52:44 +01:00
Michael Natterer 10360c9e13 app: add new XCF property PROP_FLOAT_COLOR
We were still saving channel colors in 8 bit, this additionally
saves/loads the color as float values. Still save the old PROP_COLOR
for compatibility.
2017-03-24 22:35:57 +01: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
Michael Natterer a0521a520f app: change the "XCF compat" stuff to "XCF compression"
Both in the GimpImage API and in the GUI. The toggle in the save
dialog now controls ZLIB compression directly. Changed the various
info labels accordingly. Ditch the XCF parasite that saved the XCF
compat mode.
2017-03-23 18:03:27 +01:00
Michael Natterer 8689f14d68 app: commit the generated config-enums.c 2017-03-23 16:50:11 +01:00
Michael Natterer b3354ba870 app: move monitor xres, yres back to their local scope in prefs 2017-03-23 16:04:14 +01:00
Jehan 758836e49b app: base the stroke width defaults on the y resolution defaults.
Commit 4beff2f was basing it on the screen y PPI but that is not really
consistent or logical actually. Since the actual stroke dialog uses the
y resolution of the current image, it makes sense that the generic
stroke defaults in the preferences should use the y resolution of the
default image.
2017-03-23 15:53:12 +01:00
Michael Natterer dd47e7bc3d Bug 731390 - XCF files have a max size of 4G
Enable 64 bit file offsets in XCF files, starting with newly added XCF
version 11.

We use at least version 11 if:

- we would use the previous version 10 (essentially skipping 10)
- the in-memory size of the image is larger than 4 Gig
2017-03-23 14:17:56 +01:00
Michael Natterer 829bad4063 Bug 731390 - XCF files have a max size of 4G
Add support for 64 bit offsets to xcf_read_offset() and
xcf_write_offset(), but don't use the feature yet.
2017-03-23 13:16:13 +01:00
Michael Natterer 061c2e7388 app: clean up xcf_save_prop() to do things more consistently 2017-03-23 13:02:36 +01:00
Michael Natterer 0c58dcd5cd Bug 731390 - XCF files have a max size of 4G
Change the xcf_write_foo() functions to take the XcfInfo* instead of
a GOutputStream*, and make them advance the info->cp offset by
themselves.
2017-03-23 12:42:38 +01:00
Michael Natterer 01be120349 Bug 731390 - XCF files have a max size of 4G
Change the xcf_read_foo() functions to take the XcfInfo* instead of
a GInputStream*, and make them advance the info->cp offset by
themselves. Makes xcf-load.c a lot more readable.
2017-03-23 12:26:09 +01:00
Michael Natterer a0a5f714bb Bug 731390 - XCF files have a max size of 4G
Step one, without changing anything in the saved XCFs yet:

Abstract reading and writing of file offsets away into their own
xcf_read_offset() and xcf_write_offset() functions, which take
"goffset" instead of "guint32". Also change xcf_seek_pos() to take a
goffset argument.

Change all file offset variables in xcf-load.c, xcf-write.c and struct
XcfInfo to goffset, and add new member "bytes_per_offset" to XcfInfo,
which is currently always 4.
2017-03-23 11:44:41 +01:00
Jehan 4beff2fa60 app: base the line width defaults for strokes on the screen resolution.
This value could be based on either the x or y resolution, or maybe some
kind of mean values. It could also be based off the print resolution of
any image (if the user sets a physical dimension, the actual pixel width
will vary depending on the print resolution). There is no actual "good"
answer here. But any of these values will be better than a default 96.0.
2017-03-23 01:56:59 +01:00
Ell c97209ba4a app: fix abbreviated commit hashes
The abbreviated commit hash we show in the shell and the about
dialog is currently just the last 7 characters of 'git describe',
based on the assumption that abbreviated hashes are always 7-digits
long.  When the hash is longer than that, we're just showing a
nonsense commit.

This was never a good idea, since users can override this, and
since disambiguation can result in longer hashes, but since git
2.11, the default abbreviated hash length is determined based on
the size of the repository, which currently results in 10 digits
for us.

Let's just do it right.
2017-03-21 23:05:42 -04:00
Jehan 78077dcfa5 app: fix inconsistent capitalization.
Thanks to piotrdrag for raising the issue on IRC.
2017-03-21 18:58:36 +01:00
Jehan f6cb74c0b5 app: core/gimpmarshal.h is generated after building in app/config/.
It is a little fuzzy whether expected or not, architecturally-wise. On
one hand, I can see some core/ header includes under config/. Though on
the other hand, app/Makefile.am explicitly sorts config/ below core/.
Anyway let's just use g_cclosure_marshal_VOID__VOID which is the same as
gimp_marshal_VOID__VOID and get rid of the include.
This fixes builds from scratch.
2017-03-21 18:56:31 +01:00
Jehan bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01:00
Jehan d339aef75c app: add icon size auto-guess from monitor resolution.
Current code only guess resolution for a single monitor. Ideally
the widget sizes could be different depending on the window where a
given widget is on. But that's a start.
2017-03-21 17:52:22 +01:00
Jehan 3790e22c35 app: make tooltips on drawable actions more obvious.
Differentiating them from similarly named view and image actions.
2017-03-21 17:52:22 +01:00
Jehan 74a8077792 app: make tooltips on view actions more obvious.
In particular all rotate/flip actions can apply to an image or drawable.
Let's make it clear, especially when it is run out of the menu context,
for instance in the action search.
2017-03-21 17:52:22 +01:00
Thomas Manni da84c612a7 Bug 777749 - Paths Tool: better drawing of edited path after a visibility change
force a redraw without adding the aliased gray path
2017-03-21 16:17:20 +01:00
Michael Natterer e666eb61b3 app: remove unused PROP_FILENAME enum value from GimpSettingsEditor 2017-03-21 13:31:17 +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 5ea5458938 app: fix child offsets of a pasted layer group
Use gimp_item_translate() instead of gimp_item_set_offset() to set
a pasted item's position, so that the offsets of pasted layer group
children are updated correctly.  Otherwise, only the group itself
moves, while its children remain positioned relative to the top-left
corner of the image.
2017-03-17 05:25:24 -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 1b0966d964 app: fix double node insertion to a graphless filter stack
When adding an item to a filter stack that doesn't have a graph yet,
calling gimp_filter_stack_update_last_node() may ultimately lead to
the invocation of gimp_filter_stack_get_graph(), which would create
a new graph, and add the item's node to it; gimp_filter_stack_add()
would then erroneously attempt to re-add the node to the graph.

Fix this by calling gimp_filter_stack_update_last_node() after
(potentially) adding the node to the graph in
gimp_filter_stack_add().
2017-03-12 20:26:13 -04:00
Michael Natterer 9921d4c06c app: derive GimpIconSizeScale from GimpFrame not GtkFrame 2017-03-12 22:33:35 +01:00
Michael Natterer d603b70a69 app: pack the icon size scale into the right vbox in the prefs dialog 2017-03-12 22:32:28 +01:00
Jehan e29e950ca8 app: make sure signal connections are disconnected later. 2017-03-12 18:36:16 +01:00
Jehan 324e1a28b0 app: completely minor typo in function parameter. 2017-03-12 17:14:46 +01:00
Jehan 0753296b6c app: remove unused gimp_tool_palette_initialize_tools().
The function has been unused since commit b5cc2a9.
Its work is now divided into gimp_tool_palette_set_toolbox() and
gimp_tool_palette_hierarchy_changed().
2017-03-12 17:14:38 +01:00
Jehan 33196a6579 app: minor tab cleaning. 2017-03-12 16:40:15 +01:00
Michael Natterer 59488ffa68 app: order config-enums.h alphabetically 2017-03-11 16:47:24 +01:00
Jehan a88afe485a app: fix dockbook tab border values.
Argh! Always triple-check commits before pushing!
Commit e30c92c had completely wrong big values, which I was using
to make tab border update really visible while testing.
2017-03-11 03:38:49 +01:00
Jehan e30c92ce91 app: also update dockbook tab borders with icon sizes. 2017-03-11 02:51:59 +01:00
Jehan 26f054e029 app: GimpEditor styling depending on config's icon settings.
Do not update only the icon, but also content and button spacing.
2017-03-11 02:51:59 +01:00
Jehan 86cd53e9e6 app: dockbook tab icon size depends on the icon settings. 2017-03-11 02:51:59 +01:00
Jehan cfae83623c Bug 745835 - Small icons as Option, not theme
Allow overriding icon sizes set in themes from the preferences.
This initial commit updates only toolbox icons. More to come.
4 options are available: small, medium, large and huge (the later would
likely be useful for HiDPI screens).
Uses a new widget GimpIconSizeScale.
2017-03-11 02:51:59 +01: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
Michael Natterer 157d70e396 Bug 768066 - Color picker tool should indicate pick position
Add optional coordinate display to GimpColorFrame, and enable it for
the color picker tool and the sample point dockable.
2017-03-11 00:01:01 +01: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
Jehan 22247339ce Bug 779827 - Brushes in Symmetry Tiling mode are off by one pixel.
Computation for tiled brush position has to be done in integer, not
double, to avoid funky type conversion rounding.
2017-03-10 03:56:57 +01: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
Øyvind Kolås 361ca1bfb4 app: show overlay mode also in legacy mode menu
The mode group switching combo box is hard to discover, until we use the
default group instead of legacy group as default - it is better to make legacy
resemble the full old set to.
2017-03-08 18:14:40 +01:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Ell d545b460d9 app: defer image menu updates to an idle function
In DEs which use a global menu, such as Unity, updating the menu
can be expensive.  This particularly affects canvas scaling and
rotation, for which updating the menu synchronously causes notable
lag.
2017-03-01 03:53:18 -05:00
Øyvind Kolås e0aab13da7 configure.ac: require GEGL >= 0.3.14 2017-02-28 23:07:47 +01:00
Michael Natterer 91e861adcc libgimpwidgets, *: deprecating stock IDs for good, part one...
Remove all stock items added since 2.8, restore accidentially removed
ones, and rename the newly added GIMP_STOCK_* defines to GIMP_ICON_*.

(will move to having GIMP_ICON_* defines instead of magic hardcoded
strings for all icons).
2017-02-28 19:31:27 +01:00
Ell 2ee8a2ed57 app: avoid an alloca in gimp_composite_blend()
Reuse one of the blend-func input buffers for output, when doing
in-place processing and requiring a blend-space conversion.
2017-02-27 14:23:44 -05:00
Ell a57c7fb129 app: fix bottom-of-stack dissolve layers using src-atop/in 2017-02-26 22:02:41 -05:00
Michael Natterer fb3d1e4508 app, pdb, libgimp: rename values of enum GimpConvertPaletteType 2017-02-26 20:55:00 +01:00
Michael Natterer ed1ab140fb app, pdb, libgimp: rename values of enum GimpConvertDitherType
being exported to libgimp, and having a non-exported value, this is a
horrible mess like with GimpLayerMode, but at least the cruft value
names are deprecated now.
2017-02-26 20:13:09 +01:00
Michael Natterer f8d55b75bb app: put BLEND_SPACE_IMMUTABLE back for NORMAL 2017-02-26 16:43:59 +01:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Ell 78836afffe app: fix initial values of blend/composite space/mode combos ...
... in the layer options dialog
2017-02-26 09:48:49 -05:00
Michael Natterer 0c9d76d93a app: fix profile transforms in GimpDrawableFilter
Now that gimp:profile-transform is fixed, we simply need to give
it the right pixel format and things seem to work right.
2017-02-24 21:31:53 +01:00
Michael Natterer f63906e5e3 app: add src-format and dest-format properties to gimp:profile-transform
Need to provide the pixels in a format that matches the profile,
simply using "RGBA float" here was a brain bug of mine. Two profiles
and two formats are parameters the used GimpProfileTransform needs to
work correctly.
2017-02-24 12:55:15 +01:00
Ell c11c955ef5 app: fix comment typo in previous commit 2017-02-23 05:39:46 -05:00
Ell 4c5f6a8e5b Bug 778966 - severe input lag with ruler and one window mode ...
.. due to gdk_pixbuf_scale() with themes using the pixbuf engine

Make GimpDisplayShell a subclass of GtkEventBox, so that it gets its
own window, isolating its events from those of its ancestors.

In particular, the "expose" event handler of GtkNotebook, which the
shell is a child of in SWM, is particularly slow with themes that
use the pixbuf engine.  If the notebook and the shell use the same
window, this can cause notable, and somtimes severe, lag when the
rulers or scrollbars are updated frequently, such as when rapidly
moving the cursor.
2017-02-22 18:46:10 -05:00
Michael Natterer 93787cd049 app: completely set up the filter in gimp_filter_tool_create_filter()
which got renamed from create_map() in this commit too. "Completely"
means including insane options like color_managed and gamma_hack, they
are confusing enough so they should at least work correctly.
2017-02-22 23:59:10 +01:00
Michael Natterer 8e2ad168af app: make GimpDrawableFilter's color management more correct
Need to convert both from the drawable's profile to the filter's input
format and from the filter's output format back to the drawable's
profile. This change fixes things for the case where the filter's
input and output formats are different.
2017-02-22 22:31:13 +01:00
Michael Natterer 3cd717120c app: set the complete layer mode in gimp_text_layer_from_layer() 2017-02-22 00:59:23 +01:00
Massimo Valentini 3d58a23342 Bug 764619: Color paint dynamic parameter and square artifacts when one or two channel are disabled 2017-02-21 23:47:01 +01:00
Ell bb95793eff app: nicer formatting for GIMP_COMPONENT_MASK_ALL 2017-02-20 20:25:59 -05:00
Michael Natterer 0874703e3b Bug 778988 - XCF error: unsupported XCF file version 10 encountered
Oops, should support version 10 when loading XCF...
2017-02-21 02:11:18 +01:00
Michael Natterer 89b27867e1 app: add gimp_layer_mode_get_context_array()
which returns an array of modes in the order they would appear in a
GimpLayerModeContext's UI (like tool options or the layers dialog),
without the separators.

Use it in context-commands.c and layers-commands.c instead of static
(and outdated) arrays for the actions that cycle through modes.
2017-02-20 23:51:32 +01:00
Michael Natterer 125727fa15 app: nicer formatting for GIMP_LAYER_MODE_CONTEXT_ALL 2017-02-20 20:35:04 +01:00
Ell 74ec82c3c2 app: whitespace such and such in gimp-layer-modes.c 2017-02-20 14:20:39 -05:00
Øyvind Kolås acc58c421d app: layer-modes: add comments to lighten/darken only
The lack of a blend space is there for a reason, document it.
2017-02-20 20:12:53 +01:00
Øyvind Kolås 4c252a6b55 app: layer-modes, by default use linear blend_space for add/sub/mul/div 2017-02-20 20:02:00 +01:00
Øyvind Kolås 49ccd8dadf app: gimp-layer-modes specify blend space for lighten and darken only 2017-02-20 19:52:03 +01:00
Ell 968397849a app: add luminance mode to the groups array 2017-02-20 13:36:30 -05:00
Michael Natterer fa18c25e94 app: introduce XCF version 10 for the new layer modes
Also, list all modes explitly in gimp_image_get_xcf_version() (no
default:) so we get a compiler warning if we forget to to add new
modes here.
2017-02-20 18:31:21 +01:00
Michael Natterer 314ad956f8 app, libgimp: commit regenerated files after enum GimpLayerMode change
and reorder the GimpLayerModeInfo array correctly.
2017-02-20 18:21:12 +01:00
Øyvind Kolås c40ac6f252 app: append rather than insert blend mode in layer mode enum 2017-02-20 16:01:47 +01:00
Øyvind Kolås ae03b15522 app: make blendfunction of RGB luminance work again 2017-02-20 13:54:37 +01:00
Elle Stone aaed8a6eb9 app: Bug 753163 - Add blend mode "RGB Luminance"
This adds a blend mode similar to CIE Luminance - but that does not alter
saturation.
2017-02-20 13:54:37 +01:00
Michael Natterer 1dd2c52ed3 app, pdb, libgimp: add PDB API for layer blend space and compositing space 2017-02-20 01:17:07 +01:00
Michael Natterer ac36497c2a app: correctly set the initial sensitivity in the layer options dialog 2017-02-20 01:02:21 +01:00
Ell f34ef2ab35 app: annhilate <math.h> from the face of last commit 2017-02-19 18:48:18 -05:00
Ell 1572bccc9f app: add support for subpixel image grids
In particular, this enables grids whose points of intersection
are at the middle of the image's pixels, which is useful for
undistorted painting with odd-sized brushes using tools other than
the pencil.

This commit also changes the grid visibility behavior, so that the
the visibiltiy of horizontal and vertical grid lines (depending on
the zoom level) is independent.
2017-02-19 18:13:41 -05:00
Michael Natterer 63f1ec4101 app, libgimp, plug-ins: remove the _LINEAR layer mode variants
Missing: PDB API to set the various sub-modes we now have for layer modes.
2017-02-19 23:15:59 +01:00
Alexandre Prokoudine 9e324d05f3 Dim color tag colors a little for less noise 2017-02-19 14:31:46 +03:00
Ell d42f5c4253 app: don't depend on mask alignment for SSE compositing 2017-02-18 20:56:21 -05:00
Ell f2ea995316 app: fix infinite recursion when compositing unaligned buffers 2017-02-18 20:24:51 -05:00
Michael Natterer 608070fde3 pdb, libgimp: mode gimp_temp_name() from fileops.pdb to gimp.pdb
It has nothing to do with loading/saving images.
2017-02-18 15:08:25 +01:00
Michael Natterer f538eb2912 app: add the profile import policy to prefs -> import
and indent the "dither" setting because it's a sub-setting of
"promote to float".
2017-02-18 01:57:28 +01:00
Ell eff87d4fcb app: make blend/composite attributes of color-erase immutable 2017-02-17 18:19:32 -05:00
Ell 60466dce3e app: implement the different composite modes for anti-erase mode 2017-02-17 18:19:32 -05:00
Ell 15f5d5780e app: implement the different composite modes for replace mode 2017-02-17 18:19:32 -05:00
Ell b6d7be4a0f app: implement the different composite modes for behind mode 2017-02-17 18:19:32 -05:00
Ell 7a755d5b52 app: implement the different composite modes for dissolve mode 2017-02-17 18:19:32 -05:00