Commit Graph

19510 Commits

Author SHA1 Message Date
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
Ell d1a0c253c2 app: implement the different composite modes for normal mode 2017-02-17 18:19:32 -05:00
Ell 7402127505 app: remove GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA and friends
Instead, add a gimp_layer_mode_get_format() function, which takes
the layer mode, composite space, and blend space, and returns the
I/O format.

Currently, we always use the composite space format as the I/O
format.  This simplifies gimp_composite_blend(), and gives us
composite-space support for the "special" layer mode ops for free.
2017-02-17 18:19:32 -05:00
Ell 50d8455890 app: avoid some GCC warnings due to unhandled switch cases 2017-02-17 18:19:32 -05:00
Michael Natterer b3f802a0b7 Bug 778523 - Optionally add alpha to layers of imported images
Add "Add alpha to all layers of imported images" to prefs -> import
and honor the setting in file_import_image().
2017-02-17 22:07:43 +01:00
Michael Natterer 5af2ecc8b1 app: move post-loading image import logic to new files file-import.[ch]
Profile import is no longer done for opened XCF files, only for
actual imports, otherwise this is only cleanup.
2017-02-17 20:59:17 +01:00
Ell 8aa3d5ed6f app: improve layer-mode menu separator logic 2017-02-17 06:53:30 -05:00
Ell e30d235ede app: derive the layer-mode menu layout entirely from the info arrays
Replace the 'with-behind' and 'with-replace' properties with a
single 'context' property, and use it to select the included
layer modes, according to their context mask.

Add a dummy GIMP_LAYER_MODE_SEPARATOR value to the GimpLayerMode
enum, and use it to explicitly mark the menu separators in the
layer-mode group arrays; add separators to the layer-mode menu
accordingly.

Update the rest of the code to use 'context' instead of 'with-behind'
and 'with-replace'.  In particular, in the layers and layer options
dialogs, select the right context based on whether or not the
selected layer is a group.
2017-02-17 06:26:32 -05:00
Ell c3d2f57e28 app: add GimpLayerModeContext enum
A bitmask, specifying in which contexts a layer mode is applicable.
Can be a combination of:

  - LAYER: usable as a layer mode for actual layers.
  - GROUP: usable as a layer mode for layer groups.  Currently, all
    modes that specify LAYER also specify GROUP, and vice versa,
    but the planned pass-through mode will be GROUP only.
  - PAINT: can be used as a paint mode.
  - FADE: can be used for fading.

Add a 'context' field to _GimpLayerModeInfo, and provide context
masks to all the modes.

Use the context mask for validation when setting a layer's mode.
The next commit will use the mask when populating the layer mode
menus.
2017-02-17 05:57:13 -05:00
Ell 33f470fb0f app: more layer mode info
Make the layer mode arrays more readable, and fill in more fields,
even for modes that don't use them yet.  Fix a few existing entries.
2017-02-17 05:36:58 -05:00
Michael Natterer a2462907ca app: clean up gimpoperationlayermode.c a bit 2017-02-16 19:00:44 +01:00
Michael Natterer ebd939cb6d app: merge the GimpLayerModeFunc into gimp-layer-modes.c's array
and remove gimplayermodefunctions.[ch].

Make gimp_operation_normal_process() a normal function and redirect to
SSE internally.
2017-02-15 02:25:44 +01:00
Michael Natterer 57360a0ddc Bug 778597 - Eraser paints transparent areas with BG color
Add a "paint_composite_mode" field to GimpLayerModeInfo and set the
mode of the eraser to SRC_ATOP. Defaulting to SRC_OVER for all
painting didn't quite do it for all modes.
2017-02-14 23:04:28 +01:00
Ell df45936743 app: add more IMMUTABLE flags to the layer modes 2017-02-14 16:51:51 -05:00
Michael Natterer 92f102478f configure.ac: require GEGL >= 0.3.12 2017-02-13 23:50:22 +01:00
Michael Natterer cb733efe34 app: add layer mode flags to mark blend and compositing modes immutable
set all legacy modes to completely immutable and the LAB modes'
blend mode to immutable. Change GimpLayer setters and the UI
accordingly. Remove the LAB color spaces from the GUI, they can
only be used with the LAB blend modes anyway and not changed.
2017-02-13 22:12:39 +01:00
Michael Natterer 8634b5cbc3 app: make layer blend color space and compositing color space configurable
...they say it's going to get worse before it gets better...
2017-02-12 23:49:26 +01:00
Michael Natterer 7da7bab09c app: get rid of icons in dialog buttons (use labels not stock IDs)
Nobody has them anymore, and they are deprecated in GTK+ 3.x. This
also fixes all conflicting mnemonics except those I missed, but we can
fix them now.
2017-02-12 16:18:54 +01:00
Michael Natterer 65485ae139 Bug 777096 - Curves line for Alpha channel invisible with default theme
Use style->text_aa instead of hardcoding gray, so the alpha curve
renders in the color between the curve widget's foreground and
background colors.
2017-02-09 22:41:05 +01:00
Michael Natterer 2bca4b25e0 Bug 777911 - Cage Transform edits locked, invisible and group layers
Fix cage transform to refuse to work on locked, invisible and group
layers. Add GimpTool::initialize() implementation so the generic
"drawable has changed" mechanism triggers the right response.
2017-02-08 19:28:14 +01:00
Michael Natterer 80f528a798 app: reorder and clean up stuff in the cage tool before starting fixes 2017-02-07 22:18:01 +01:00
Ell c0444e30bd app: update the layer mode combo model after construction
... otherwise with-behind and with-replace don't take effect until
switching groups.
2017-02-06 20:05:27 -05:00
Ell b3dea58cfd app: fix SRC_ATOP and DST_ATOP too
They can be affected by the same problem described in
commit 4c3a772cd8, although in the
case of SRC_ATOP, the affected pixels are always fully transparent.
2017-02-05 22:32:08 -05:00
Ell 6853c91264 app: don't expand the convolution matrix table widget
Accidently introduced by the previous commits.
2017-02-05 22:18:32 -05:00
Ell 4c3a772cd8 app: fix SRC_OVER composite mode
When the source alpha is zero, we don't calculate the blended color,
so `comp[b]` can be infinite or NaN, in which case the expression
`in[ALPHA] * (comp[b] - layer[b])` is NaN, rather than the expected
value of zero.
2017-02-05 21:39:40 -05:00
Ell bed63c6bd9 app: consolidate button creation code for the convolution matrix 2017-02-05 21:30:40 -05:00
Ell e40091c8ab app: add rotate/flip buttons to the convolution matrix gui
... to rotate/flip the matrix
2017-02-05 18:00:07 -05:00
Michael Natterer e1e41b86d0 app: allow painting on transparent layers with modes != normal
by using GIMP_LAYER_COMPOSITE_SRC_OVER. Please test.
2017-02-05 23:08:16 +01:00
Michael Natterer 8bba14ea84 app: indentation fix in gimpgeglprocedure.c 2017-02-05 20:22:40 +01:00
Michael Natterer 891f85e805 app: move gimp-gegl-config.[ch] to operations/
and rename it to gimp-operation-config.[ch].
2017-02-05 20:17:31 +01:00
Michael Natterer a3b8d0ceed app: some cleanup and adding const in gimp-layer-modes.c 2017-02-05 16:30:54 +01:00
Michael Natterer daf206c745 app: make struct GimpLayerModeInfo private 2017-02-05 16:06:53 +01:00
Michael Natterer 2950fecf07 app: move layer mode enums and gimp-layer-modes.[ch] to operations/
and to operations/layer-modes/, respectively.

Add gimp_layer_modes_init() which asserts on the correct order of the
GimpLayerModeInfo array, and switch to accessing the array directly in
gimp_layer_mode_info().
2017-02-05 15:59:29 +01:00
Ell 1284715f11 app: fix composite mode of erase mode 2017-02-04 22:29:41 -05:00
Ell 8f4700b839 app: add "hard mix" blend mode
Similar to the Photoshop mode of the same name.  Assigns
either 0 or 1 to each of the channels, depending on whether the
sum of source and destination channel values is less than, or
greater than (or equals to), one, respectively.

This is equivalent to inverting the source, and using it to perform
per-pixel, per-channel threshold against the destination, which is
useful for various effects.
2017-02-04 21:30:56 -05:00
Alexandre Prokoudine 5c873bd93f Reintroduce a cleaner version of the linear light fix 2017-02-05 03:25:14 +03:00
Alexandre Prokoudine 005b16ee06 Revert "Resurrect previous version of the linear light formula and fix it"
This reverts commit 1366592f9f.
2017-02-05 03:22:07 +03:00
Alexandre Prokoudine 1366592f9f Resurrect previous version of the linear light formula and fix it 2017-02-05 01:32:56 +03:00
Alexandre Prokoudine e69924b4eb Fix the linear light layer mode formula
This simpler version provides the rendering that matches
Photoshop's one.
2017-02-05 01:19:53 +03:00
Øyvind Kolås 7a000a0991 app: include composite mode in legacy layer mode info
Otherwise normal mode doesn't work due to optimizations.
2017-02-04 23:19:35 +01:00
Alexandre Prokoudine 0159d0b734 Fix the vivid light formula 2017-02-04 22:59:48 +03:00
Øyvind Kolås 3f91ad7f3c app: replace some layer mode logic with data driven functions 2017-02-04 20:04:17 +01:00
Ell 1a2ef41492 app: fix handling of fully desaturated colors in lch chroma mode 2017-02-03 13:55:30 -05:00
Øyvind Kolås eb93475deb app: improve data in layer mode info array 2017-02-03 16:05:21 +01:00
Øyvind Kolås d97be7edd0 app: add repository of layer mode information 2017-02-03 01:53:10 +01:00
Ell 1214d4acf1 app: move all special-case mode processing optimizations to GimpOperationLayerMode
Stuff like passing "input" directly if "aux"'s opacity is 0, etc.
Used to be partly handled by normal mode, even though it applies
to other modes too.

Adjust the logic for the new compositing modes.

Add a GimpLayerModeAffectMask enum, and a corresponding
get_affect_mask() function to GimpOperationLayerMode, which
specifies which of the op's inputs, if any, are affected by the
mode, apart from the overlapping regions.  Most modes affect only
the overlapping regions, but dissolve and replace also affect the
rest of the input.  This information is used for determining if
the optimizations are applicable.
2017-02-02 17:40:05 -05:00
Jehan e957347dd6 app: build layer mode operations with SSE2 flags.
Some of the generic files still contain SSE2 code, in particular
gimpoperationlayermode.c. The reason why it often works without is that
native gcc will usually pre-define SSE macros by default.
To check this: gcc -dM -E - < /dev/null | grep SSE
Yet I had a case on a small netbook where the SSE macros were not
pre-defined even though supported. Consequently the build failed.
2017-02-02 21:41:15 +01:00
Jehan 7447b505f9 app: tab and space cleaning. 2017-02-02 21:41:15 +01:00
Michael Natterer c6f00eb87f app, menus, plug-ins: add new menu Color -> Tone Mapping
Move all related GEGL filters and the retinex plug-in there..
2017-02-02 20:42:58 +01:00
Michael Natterer 7c9a740b74 app, menus: add gegl:image-gradient and gegl:snn-mean to the menus 2017-02-02 19:54:23 +01:00
Michael Natterer d434c60161 app, menus: add some more GEGL filters to the menus
and blacklist some others in the GEGL tool.
2017-02-02 17:43:27 +01:00
Michael Natterer 2a96d598c3 app: add internal and PDB API and UI to control a layer's composite mode
Largely based on a patch by Ell, with the enum type renamed and
various small changes. Adds another axis of configurability to the
existing layer mode madness, and is WIP too.
2017-02-02 00:38:25 +01:00
Michael Natterer a18dcb94eb configure.ac: require babl >= 0.1.24 2017-02-01 23:41:54 +01:00
Jehan 08e8c0e4f8 app, plug-ins: move the locale processing code in the core.
The colon-separated list used in the plugin originally comes from
gimp_help_get_locales() anyway. My previous code was using different
lists of locales in different places, which was inconsistent.
2017-02-01 03:10:13 +01:00
Ell d2f50e608d app: change composite mode of erase to SRC_ATOP 2017-01-31 18:22:46 -05:00
Ell c6a2a64604 app: add composite mode support to erase mode 2017-01-31 18:16:44 -05:00
Michael Natterer 1924212dcf app: remove "default:" from the switch in gimp_layer_mode_get_operation()
and list all modes explicitly; preparation for moving all of this info
to some table of structs.
2017-01-31 22:48:03 +01:00
Michael Natterer 10b67c5b3f app: remove GIMP_HELP_CONFIG_USE_GEGL help ID, no longer needed 2017-01-31 21:16:31 +01:00
Michael Natterer 45d1e0b4ea app: change the help IDs of posterize and desaturate
they are simple filter now, not tools.
2017-01-31 21:08:36 +01:00
Alexandre Prokoudine efb1c5e022 Fix indents to amend the previous commit 2017-01-31 22:45:09 +03:00
Alexandre Prokoudine d61a62af67 Enabled a whole bunch of help IDs for GEGL-based filters
Also, fixed a few copy/paste errors.
2017-01-31 22:35:50 +03:00
Michael Natterer 2dbf1b46b2 app: rename gimp_layer_mode_is_linear() to gimp_layer_mode_wants_linear_data() 2017-01-31 01:43:48 +01:00
Michael Natterer 8771361cb9 app: move arrays of magic GimpLayerMode knowledge to gimp-layer-modes.c
and provide API to access them.
2017-01-31 01:33:11 +01:00
Michael Natterer 8a95a512e5 app: move the vivid-, pin- and linear-light modes around in the UI 2017-01-30 22:07:51 +01:00
Michael Natterer d348220997 app: remove the HSV modes from the default layer mode group 2017-01-30 22:07:51 +01:00
Michael Natterer 9397aff96f app: add GIMP_LAYER_MODE_LUMA_DARKEN_ONLY and _LUMA_DARKEN_ONLY
which are perceptual versions of the new LUMINANCE_DARKEN_ONLY and
LUMINANCE_LIGHTEN_ONLY modes. Add the new modes to the UI.
2017-01-30 22:07:51 +01:00
Michael Natterer 5170980309 app: add a tooltip to the layer mode group combo 2017-01-30 14:02:35 +01:00
Michael Natterer c58d471af7 app: remove gimp_paint_mode_menu_new() and use GimpLayerModeBox
I know this looks absolutely horrible, please spare me comments about
that. This commit has the purpose to let everybody experiment with the
new modes, and suggest improvements of the GimpLayerModeBox widget; we
need *some* way of controlling the new layer mode madness.
2017-01-30 13:24:35 +01:00
Michael Natterer 6e522d735f app: add gimp_layer_mode_box_set_label() and set_ellipsize()
so it can be configured like the old paint mode menu.
2017-01-30 13:21:41 +01:00
Michael Natterer 3d79f382ba app: properly notify on group changes in GimpLayerModeComboBox 2017-01-30 13:20:57 +01:00
Michael Natterer 3fa931eb68 app: add icons to the group selector in GimpLayerModeBox
still completely horrible.
2017-01-30 12:20:29 +01:00
Øyvind Kolås e9a6d93197 app: add darken only, lighten only that uses luminance
These variations on darken only and lighten only have the advantage over the
componentvise versions that they always use the full triplet of either original
or new layer - meaning no new colors/hues will be introduced. This is similar
to how these modes operated/operates in picture publisher and photo-paint.
2017-01-29 22:27:28 +01:00
Michael Natterer a622f98ebf app: add new widget GimpLayerModeBox
which is a hbox with a GimpLayerModeComboBox and another combo box to
control the mode combo's group. Absolutely horrible WIP and not used
yet.
2017-01-29 21:54:52 +01:00
Thomas Manni 0d4dd11e2a Bug 777880 - better handling of sensitivity functions for channel combobox on threshold, levels and curves tools
- set the filter_tool->drawable before showing the tool gui.
- set the sensitivity functions for channel combobox of threshold,
  levels and curves tools dialogs only once during dialog creations.
- use the filter_tool->drawable inside the sensitivity functions
2017-01-29 14:07:06 +01:00
Michael Natterer 8d744bc6c6 app, libgimp: found two more hidden GIMP_LAYER_MODE_NORMAL_NON_LINEAR 2017-01-28 22:48:36 +01:00
Michael Natterer 5389e8e417 app, libgimp: rename GIMP_LAYER_MODE_NORMAL to NORMAL_LINEAR
and NORMAL_NON_LINEAR to NORMAL, so it's consistent with all other
modes.
2017-01-28 21:38:52 +01:00
Michael Natterer cdfbc74297 app: add new widget GimpLayerModeComboBox, still unused 2017-01-28 18:25:45 +01:00
Michael Natterer 312e3ba4d2 app: add gimp_layer_mode_get_for_group()
which allows to find the "same" layer mode in another group.
2017-01-28 18:24:40 +01:00
Michael Natterer db98dc5eaa app: never propagate indexed images to floating point 2017-01-26 17:16:16 +01:00
Michael Natterer a6545cc363 app: add enum value GIMP_LAYER_MODE_GROUP_DEFAULT
and change the labels of the NORMAL and NORMAL_NON_LINEAR modes.
2017-01-26 17:15:27 +01:00
Alexandre Prokoudine 0aa7f8f430 Fix a user-visible typo 2017-01-26 02:22:37 +03:00
Michael Natterer 3e3cdbae41 app: blacklist gegl:matting-levin in the GEGL tool 2017-01-25 22:32:11 +01:00
Michael Natterer 31241a984e app, libgimp: remove GIMP_LAYER_MODE_DARKEN,LIGHTEN_ONLY_LINEAR
There is no _LINEAR variant, the modes always do the same.
2017-01-25 22:08:06 +01:00
Øyvind Kolås 09af8dbca5 app: slight optimization of sse2 for src_atop 2017-01-25 21:14:14 +01:00
Øyvind Kolås e1c1a5a9a8 app: implement SSE2 acceleration of src_atop 2017-01-25 12:54:20 +01:00
Michael Natterer 0fcf4ca59d app: remove gimpblendcomposite.h from Makefile.am, it's gone 2017-01-24 23:54:56 +01:00
Michael Natterer ebd3ab1b26 A more hackish way to use GimpLayerMode instead of GimpLayerModeEffects
C++ won't allow us to use GimpLayerMode in the API where we used to
have GimpLayerModeEffects.

Move GimpLayerModeEffects to libgimpbase/gimpcompatenums.h so it's
not in the API any longer, and instead typedef and define stuff in
libgimp/gimptypes.h, and adapt the compat enum registering code
accordingly.
2017-01-24 23:28:34 +01:00
Alexandre Prokoudine 17a805bd32 Add missing mnemonics for Keep/Convert buttons 2017-01-24 22:11:46 +03:00
Øyvind Kolås 579676cfe4 app: fix grain_extract behavior
The blending function of grain merge was being used instead of grain extract.
2017-01-24 19:19:19 +01:00
Øyvind Kolås 6a1d49bc6d app: fix legacy divide blend mode
The porting from 8bit per component scaled some 8bit fractions up to huge
floating point numbers, this works for most values but causes trouble for near
transparent pixel values. This commit copies the inner blend loop from the new
divide layer mode, but keeps the old compositing logic.
2017-01-24 18:36:08 +01:00
Ell 9128f3fc87 app: skip color calculation in the blend funcs if either dest or src ...
... is fully transparent, instead of just src.

The blend func results only affect the intersection of dest and src.
Run time is currently dominated by the compositing step for most modes,
so the difference in performance is pretty negligible, but it does make
a difference for the more expensive modes, like the HSV ones.
2017-01-24 11:27:40 -05:00
Michael Natterer 5dbf9cd4f4 app: add new enum GimpLayerModeGroup { LINEAR, PERCEPTUAL, LEGACY }
and a new function gimp_layer_mode_get_group() which will be used for
the soon-to-appear GimpLayerModeComboBox.
2017-01-24 17:12:52 +01:00
Øyvind Kolås 59471adfee app: remove default from gimp_layer_mode_get_blend_fun switch
This makes gcc warn when new cases have been added to the layer mode enum,
better than silently failing at runtime.
2017-01-24 02:53:39 +01:00
Øyvind Kolås b88d74da24 app: make darken only and lighten only work in linear
Gamma doesn't change sort order of floats.
2017-01-24 02:52:25 +01:00
Øyvind Kolås 019d7cbf74 app: update autogenerated core-enums.c 2017-01-24 00:56:21 +01:00
Øyvind Kolås 09af91763c app: fix label of LINEAR_BURN blend mode 2017-01-24 00:44:13 +01:00
Jehan f44fb1ece4 app: more gimp_unit_get_scaled_digits() usage.
The print size displayed in image property and title format should use
gimp_unit_get_scaled_digits() instead of gimp_unit_get_digits() and
adding 1, which is quite random or magic number-y.
2017-01-24 00:28:33 +01:00
Øyvind Kolås d836d94114 app: implement non-legacy blend modes in GimpOperationLayerMode
For operations needing to override default behavior sub-classes should still be
used.

This commit also enables pinligh, vividlight and linearlight blend mode modes
2017-01-23 23:47:56 +01:00
Øyvind Kolås 5978def585 app: improve vivid-light formula 2017-01-23 22:40:10 +01:00
Jehan 2762662ca9 app: use gimp_unit_get_accurate_digits() in a few places. 2017-01-23 20:59:28 +01:00
Øyvind Kolås 774687dcfe app: improve formulas of softlight and linear light blending modes 2017-01-23 19:03:44 +01:00
Øyvind Kolås 4a3fbb8f35 app: fix OVERLAY mode so it gets fed linear data 2017-01-23 18:09:20 +01:00
Michael Natterer 40395b83a4 app: require gegl:wavelet-blur and blackist it in the GEGL tool 2017-01-23 02:33:59 +01:00
Michael Natterer dba909a9fa Bug 776370 - Changing active layer breaks the GEGL operation dialog
We can't just switch to a GimpOperationTool by using the normal
gimp_context_set_tool() or gimp_context_tool_changed() because it
needs additional initialization like setting an operation at all.

In gimp_gegl_procedure_execute_async(), g_object_set_data() the used
procedure on the newly created tool.

In gimp_display_shell_initialize_tool(), when we re-create the active
tool because of a drawable change, check for the procedure and invoke
it again, instead of simply creating an empty operation tool by
calling gimp_context_tool_changed().
2017-01-23 00:05:18 +01:00
Michael Natterer 58e7aff1a4 app: order property code consistently in gimpcoreconfig.c 2017-01-22 22:47:51 +01:00
Michael Natterer 27519fc798 Bug 734657 - Import as 32-bit floating-point linear by default
Optionally convert all imported (not XCFs) images to 32 bit linear
floating point, and optionally add a little noise in order to
distribute the colors minimally. The new options are on a new "Image
Import & Export" prefs page that needs a new icon. Original dithering
patch by pippin.
2017-01-22 22:06:30 +01:00
Øyvind Kolås 83374f490a app: make replace mode request linear data 2017-01-22 18:47:34 +01:00
Michael Natterer d3b8a0d007 app: s/trc/space/ in the property names too 2017-01-22 17:14:44 +01:00
Øyvind Kolås 2537d3d0e9 app: refer to (color) space instead of trc for blend/composite
Since CIE Lab is one of the supported color spaces for doing the blending -
this enum is not only about transfer functions/curves or gamma. This finishes
already started cleanups.
2017-01-22 16:04:50 +01:00
Michael Natterer b10fc58802 app: add a "layer-mode" property to GimpOperationLayerMode 2017-01-22 14:41:21 +01:00
Michael Natterer d293a00995 app, menus: add gegl:edge-neon to Filters -> Edge Detect 2017-01-22 14:35:35 +01:00
Øyvind Kolås c9ad09df61 app: add a handful more blending innerloops
Adding linear burn, vivid light, linear light, pinlight and exclusion formulas
as described on
http://www.deepskycolors.com/archivo/2010/04/21/formulas-for-Photoshop-blending-modes.html
2017-01-22 13:41:49 +01:00
Michael Natterer 7079d5f730 app: add a huge switch() to gimp_layer_mode_get_composite_mode()
It's going to be used to the UI too and should return something
to display, even if immutable.
2017-01-21 22:31:09 +01:00
Øyvind Kolås da10525073 app: change default composite mode for new modes to src-atop 2017-01-21 22:12:23 +01:00
Michael Natterer c152fa8651 app: fix the blend space of the legacy modes to be perceptual 2017-01-21 22:03:40 +01:00
Michael Natterer 05f3d38acb app: rename GimpOperationPointLayerMode to GimpOperationLayerMode
and formatting cleanup.
2017-01-21 21:35:52 +01:00
Ell 0c35baecca app: in gimp_composite_blend(), more alloca avoiding 2017-01-21 09:06:08 -05:00
Øyvind Kolås c993adf91e app: remove a trampoline in layer/paint mode dispatch
Fully removes one trampoline level and passing fewer args through the remaining
trampoline.
2017-01-21 14:10:03 +01:00