Commit Graph

19527 Commits

Author SHA1 Message Date
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
Ell fb3b99553c app: in gimp_composite_blend(), avoid another alloca when doing in-place output 2017-01-21 07:18:47 -05:00
Ell 4d985d11df app: in gimp_composite_blend(), avoid an alloca when doing in-place output 2017-01-21 06:36:03 -05:00
Michael Natterer a1b844897c app: make GimpPaintOptions' "use-applicator" default to FALSE again 2017-01-21 00:29:41 +01:00
Michael Natterer 485094b9da app: fix painting with the new layer mode code
by creating temp buffers matching the format needed by the
GimpLayerMode's process_pixels() function.
2017-01-21 00:27:48 +01:00
Michael Natterer 2acd2fe74c app: do_layer_blend(): pass the right blend/composite parameters
based on the used GimpLayerMode.
2017-01-21 00:02:22 +01:00
Jehan 1835b2ae61 app: improve precision of paint tools' straight line distance...
... in status bar.
Follow-up of commits f836892 and d1c3c3d. With high resolutions, the
distance displayed in the status bar when shift-clicking in a paint tool
may lack digit precision and show the same value (in non-pixel unit) for
several consecutive pixels. Compute a more accurate precision than what
gimp_unit_get_digits() can provide in such cases.
2017-01-20 00:40:41 +01:00
Jehan d1c3c3deb0 app: improve Measure Tool digit precision.
When working with high resolution, you may have cases where measured
length won't be displayed with enough digits; i.e. several pixels length
would show up as 0. For instance at 4000 PPI, up to 7 pixels show up as
0 mm, then at 0.1 mm from the 8th pixel (actually reaching over 0.05 mm,
approximating as 0.1), then 0.2 at 24 pixels (actually: 0.152), and so
on. At such a resolution, 3 digits are needed for 'mm' instead of the
1 digit returned by gimp_unit_get_digits() so that we display reliable
lengths.
Therefore we need to compute ideal digit precision. Configured digits
for a given unit will now be used as a minimum value, but actually used
digits may be higher.
2017-01-20 00:40:27 +01:00
Jehan f836892314 Bug 763734 - better decimal places for physical units.
Compute the ideal decimal precision for cursor position and length
status so that you get the best precision on physical units depending
on the current resolution, yet avoiding over-precision (which can be
misleading). The unit's "digits" value is now used as a minimum
precision only.
2017-01-20 00:40:27 +01:00
Ell 5da89f0daf app: in gimp_composite_blend(), avoid overwriting input in some cases (again)
Revert commit f6436eee96, which was wrong,
and redo it the right way.
2017-01-19 16:16:44 -05:00
Øyvind Kolås 894d4c0c01 app: finish GimpLayerColorSpace rename 2017-01-19 19:33:17 +00:00
Øyvind Kolås e9d72ef2a8 app: finish GimpLayerColorSpace rename 2017-01-19 19:22:40 +00:00
Øyvind Kolås 386e18e510 app: rename GimpLayerBlendTRC to GimpLayerColorSpace
It is used both for blending and compositing, the repeated use of the word
BLEND in code made the logic involving both blending and compositing hard to
read.
2017-01-19 19:17:24 +00:00
Ell f6436eee96 app: in gimp_composite_blend(), avoid overwriting input in some cases
Note that in some cases the alloca may be unnecessary, but this keeps
the code clean, and we have to be able to *potentially* do the alloca
anyway, so what the hell.
2017-01-19 13:51:48 -05:00
Michael Natterer a5ee5f28f9 app: cast ops using (gpointer) everywhere instead of 3 different ways 2017-01-19 19:04:49 +01:00
Michael Natterer 268e35a996 app: remove prepare() impls from erase and anti-erase
the calling code makes sure the ops have the right linear formats.
2017-01-19 18:49:22 +01:00
Michael Natterer 349cff8c16 app: remove "gboolean linear" from gimp_get_layer_mode_function()
and get rid of the two process_pixels() functions in the LCH modes,
they always take linear now.
2017-01-19 18:43:31 +01:00
Ell 417d9553b5 app: in gimpblendcomposite.h, small fix in compfun_dst_atop() 2017-01-19 12:03:39 -05:00
Ell 7df1bb4c0e app: in gimp_blend_composite(), fix dst_atop and avoid some conversions
Also s/comp_alpha/layer_alpha/ for consistency.
2017-01-19 11:55:21 -05:00
Michael Natterer d656fbab86 app: coding style cleanup in all layer modes, fiddle with includes a bit 2017-01-19 17:48:45 +01:00
Øyvind Kolås 80c947f04f app: add missing breaks in switches of gimpblendcomposite 2017-01-19 14:25:04 +00:00
Michael Natterer 4e9ce952d9 app: indentation in operations-types.h 2017-01-19 14:47:48 +01:00
Michael Natterer 4683b986f3 app: use the GimpBlendFunc typedef in gimpblendcomposite.h 2017-01-19 14:46:29 +01:00
Øyvind Kolås f645665324 app: unconditionally set alpha in hardlight/softlight/overlay 2017-01-19 14:44:39 +01:00
Michael Natterer bfdea93a9c app: indentation and formatting cleanup in gimpblendcomposite.h
Also remove all includes, they should already be there when this
header gets included.
2017-01-19 14:31:40 +01:00
Øyvind Kolås 72cbda11ae app: composite_blend, fix src_over 2017-01-19 04:57:14 +01:00
Øyvind Kolås 41fff6990e app: make layer modes more configurable
Implement a common utility function gimp_blend_composite that uses utility
functions for implementing layer modes, with separate (possibly SIMD) optimized
loops for blending and compositing, with configured linear TRC, perceptual
gamma TRC or even using CIE Lab as the space.
2017-01-19 01:04:15 +01:00
Michael Natterer 1262370544 app: remove "gboolean linear" parameters
from gimp_applicator_new() and gimp_gegl_mode_node_set_mode().
Compositing doesn't depend on the layer format any longer, only on the
layer mode. Painting with "use applicator" unchecked is still broken
in some cases and needs more fixing.
2017-01-18 00:15:55 +01:00
Michael Natterer b809613be0 app: implement gimp_layer_mode_get_blend_trc() 2017-01-17 17:41:05 +01:00
Øyvind Kolås 0bcb3068fe app: fix typo s/GIMP_LAYER_COMPOSITE_OVER/GIMP_LAYER_COMPOSITE_SRC_OVER/ 2017-01-17 15:23:36 +01:00
Michael Natterer 6e72d3eddf app: add blend-trc and composite-mode properties to GimpOperationPointLayerMode
and set them to unused default values.
2017-01-17 15:09:17 +01:00
Michael Natterer dd3eec6198 app: change linking order of the sub-libs of app/operations
so layer-modes/ can use the enums in enums-types.h without failing to
link.
2017-01-17 14:28:40 +01:00
Michael Natterer 5c4eb75361 app: register the enums in operations-enums.h as GTypes
and rename them to GimpLayerBlendTRC and GimpLayerCompositeMode.
2017-01-17 01:19:06 +01:00
Michael Natterer e267d87963 app: add operations-enums.h with two soon-needed enums 2017-01-16 23:07:50 +01:00
Michael Natterer 69c4644e15 app: rename GimpLayerModeFunction to GimpLayerModeFunc
like all other function typedefs and add GimpBlendFunc typedef which
will be needed soon. Also rename get_layer_mode_function() to
gimp_get_layer_mode_function().
2017-01-16 22:44:01 +01:00
Øyvind Kolås e1b7eb7245 app: divide blend mode, limit high values to 5.0
Possibly counteracting inaccuracies in used babl conversions, but with this the
result match legacy as expected.
2017-01-16 02:36:11 +01:00
Michael Natterer 8928bcd088 Bug 777017 - creating an empty layer group inside an existing...
...layer group cause a bug in the existing layer size

Change gimp_group_layer_get_size() to return FALSE if there are no
children (there is no content).

In gimp_group_layer_update_size(), skip children where get_size()
returns FALSE. Fixes bogus size calculation.
2017-01-15 21:01:03 +01:00
Michael Natterer 87e5d10ddb app: make tests build again 2017-01-15 18:52:43 +01:00
Michael Natterer 5eb0fa816a app, libgimp: add LINEAR variants of more layer modes
for completeness/consistency, even if they don't make much sense for
prectical use.
2017-01-15 16:02:10 +01:00
Michael Natterer a24e232522 app: move functions on enum GimpLayerMode to new files gimp-layer-modes.[ch] 2017-01-15 15:25:03 +01:00
Øyvind Kolås 60847cce73 app: remove odd ratio scaling, replace with range check for nan 2017-01-15 01:33:40 +01:00
Øyvind Kolås 315ccc7f82 app: remove clamping in multiply mode 2017-01-15 01:33:40 +01:00
Michael Natterer 50669fe6d4 app, libgimp: rename BEHIND enum values to be consistent with others
Also update gimplayermodefunctions.c which I forgot before.
2017-01-15 00:01:09 +01:00
Michael Natterer 6bf9e47ba8 app, libgimp: add linear variants of most layer modes
and reorder gimp_gegl_mode_node_set_mode() and friends.
2017-01-14 22:56:54 +01:00
Michael Natterer 5951d39938 app, libgimp: reorder enum GimpLayerMode
so LEGACY and new modes have the same order, if possible.
2017-01-14 21:52:54 +01:00
Øyvind Kolås f01374798e app: remove clamps from addition, subtract and grain blend modes 2017-01-14 21:06:06 +01:00
Øyvind Kolås 39adf3627d app: use hypotf in lhc chroma blend mode 2017-01-14 21:03:29 +01:00
Michael Natterer bd66794e2c app: avoid the second gegl_node_set() in gimp_gegl_mode_node_set_mode() 2017-01-14 18:35:56 +01:00
Øyvind Kolås f8c65367f0 app: cache fishes in lch blend modes 2017-01-13 19:21:01 +00:00
Øyvind Kolås 975a0a6943 app: reuse more code 2017-01-13 19:21:01 +00:00
Øyvind Kolås be8c2015a0 app: move factored out compositing to common header 2017-01-13 19:21:01 +00:00
Øyvind Kolås acd20fb55b app: use cached fishes in lch chroma mode 2017-01-13 19:21:00 +00:00
Øyvind Kolås 7959141eb4 app: make compositing of hsv value blend mode consistent 2017-01-13 14:26:36 +01:00
Øyvind Kolås 75173b97d9 app: make compositing of grain extract blend mode consistent 2017-01-13 14:26:05 +01:00
Øyvind Kolås 954030fab6 app: make compositing of dodge blend mode consistent with rest 2017-01-13 14:25:46 +01:00
Øyvind Kolås 13eab78ecc app: improve and simplify alpha handling of LCH blending modes 2017-01-13 14:15:35 +01:00
Øyvind Kolås feb2bb4083 app: lch color modes remove unneeded includes 2017-01-13 13:53:08 +01:00
Øyvind Kolås 0b1f684e8f app: remove unneded variable named tmp 2017-01-13 13:38:12 +01:00
Øyvind Kolås 24b04c0b40 app: use single precision hypotf and constants for performance 2017-01-13 13:17:25 +01:00
Michael Natterer 68cc8bb86f app: make using gimp_drawable_update() less verbose
Allow passing -1 for the drawable's width/height, instead of requiring
gimp_item_get_width,height() in many callers.
2017-01-13 02:14:40 +01:00
Øyvind Kolås 0bc45c8cd0 app: default to use gegl applicator in paint tools
Temporarily slower - but permits paint modes like overlay/softlight to work at
all for linear TRC pixel encodings. Should be reverted when the non-graph
approach works properly again.
2017-01-12 18:55:38 +01:00
Øyvind Kolås dc5b86f0eb app: add TRC variants to get_layer_mode_function() 2017-01-12 15:18:44 +01:00
Øyvind Kolås 4df1af2534 app: add linear variant of behind mode 2017-01-12 14:27:15 +01:00
Øyvind Kolås 377f4687b1 app: add gimp_gegl_mode_is_linear 2017-01-11 22:13:14 +01:00
Øyvind Kolås 5271027510 app: explictly code linear vs gamma for hardlight and softlight 2017-01-11 19:39:46 +01:00
Øyvind Kolås 36ebe03770 app: remove lingering old files of dead code 2017-01-11 15:18:52 +01:00
Øyvind Kolås f9aeff5670 app: fix a lingering old gimp:softlight-mode 2017-01-11 15:17:30 +01:00
Michael Natterer a187329777 app: sort includes in gimp-operations.c 2017-01-11 15:00:37 +01:00
Michael Natterer 77f9659c98 app: move gimplayermodefunctions.[ch] to layer-modes/ 2017-01-11 14:58:43 +01:00
Michael Natterer b959e0b69b app: move GimpOperationPointLayerMode to layer-modes/ 2017-01-11 14:44:10 +01:00
Ell e17f640fba app: eliminate unnecessary condition in GimpOperationReplaceMode
8-bit relic.
2017-01-11 08:21:02 -05:00
Michael Natterer ad134263d2 app: clean up Makefile.am in layer-modes/ and layer-modes-legacy/ 2017-01-11 13:00:27 +01:00
Michael Natterer 8b5553cef6 app: move the remaining 3 layer modes to layer-modes/
Not exactly sure if all are correct, but the file moving is almost
done now.
2017-01-11 12:55:13 +01:00
Michael Natterer b90fa4f0d3 app: clean up spaces in GimpOperationColorEraseMode 2017-01-11 12:42:27 +01:00
Michael Natterer 01b25baffd app: change mask handling in GimpOperationReplaceMode
to be like in the other modes, and proably speed it up a little.
2017-01-11 12:38:58 +01:00
Øyvind Kolås 7ed2857695 app: fix type s/legacyy/legacy/ 2017-01-11 05:34:55 +01:00
Øyvind Kolås f45fc97eba app: add missing op .h files 2017-01-11 04:54:36 +01:00
Øyvind Kolås ec1f7a94e3 app: split legacy out of grain extract and merge 2017-01-11 04:40:26 +01:00
Øyvind Kolås 8f3842434c app: split legacy out of soft and hard light 2017-01-11 04:10:06 +01:00
Øyvind Kolås 784a8ee224 app: split legacy out of burn and divide 2017-01-11 03:17:53 +01:00
Michael Natterer 0891028232 app: forgot to s/gimp:normal-mode/gimp:normal/g 2017-01-11 00:28:57 +01:00
Michael Natterer 9142bb1805 app: move erase and anti-erase to layer-modes/ 2017-01-11 00:23:31 +01:00
Øyvind Kolås 0fcc2cd772 app: also fix multiply enum/name mapping 2017-01-11 00:12:45 +01:00
Øyvind Kolås 2ce25045fe app: fix fix 2017-01-11 00:10:09 +01:00