Commit Graph

651 Commits

Author SHA1 Message Date
Michael Natterer b001626b31 app: move overlay to operations/layer-modes/ and call it GimpOperationOverlay 2017-01-09 23:54:51 +01:00
Øyvind Kolås b6be1b768e app: duplicate difference mode, new and legacy 2017-01-09 23:49:08 +01:00
Øyvind Kolås 3a50cdcd4f app: split screen op in legacy and new 2017-01-09 23:19:29 +01:00
Øyvind Kolås 076621dd75 app: split dodge op in legacy and new 2017-01-09 20:10:17 +01:00
Øyvind Kolås c2583faa5a app: add new multiply op 2017-01-09 20:10:04 +01:00
Øyvind Kolås 735887286a app: do not let pixel encoding determine layer modes
See bug #757485 - woth noting that this also enables linear and thus correct
compositing when using 8bpc perceptual gamma as the layer storage format.
2017-01-09 20:09:50 +01:00
Michael Natterer 152adbb1bd Rename GIMP_LAYER_MODE_FOO_BROKEN to GIMP_LAYER_MODE_FOO_LEGACY
"Broken" sounds like it needs fixing, but it's legacy compat stuff
that will have to stay for all eternity.
2017-01-09 01:27:20 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Øyvind Kolås 5627ad589f app: use gegl:dither instead of gegl:reduction 2016-12-24 19:40:12 +01:00
Michael Natterer 54dc424b31 app: better progress indication in gimp_babl_init_fishes() 2016-11-14 19:58:20 +01:00
Øyvind Kolås 3bc2d25ccd app: preinit more fishes commonly used for filters on u8 images 2016-11-11 13:55:05 +01:00
Michael Natterer 17ac37ef8e app: pass a status_callback to gimp_babl_init_fishes()
and make it report progress. Also call it at the end of initialization.
2016-11-11 13:09:12 +01:00
Michael Natterer 0788db4702 app: split babl fish creating to a separate function gimp_babl_init_fishes()
and call that function later in gimp_real_initialize() so the splash
is always fully drawn when it's called.
2016-11-11 01:06:14 +01:00
Øyvind Kolås 99b9a60e8b app: pre-initialize some babl fishes 2016-11-11 00:54:04 +01:00
Michael Natterer ab5a27d74a app: CLAMP(bits, 1, 16) in gimp_gegl_apply_color_reduction()
which is the range of the GEGL op's properties.
2016-11-09 12:33:13 +01:00
Michael Natterer c1ae0864de app: add gimp_babl_linear()
which completes gimp_babl_component_type() and gimp_babl_precision().
2016-11-09 12:02:12 +01:00
Alexis Wilhelm 768d06614f Bug 316479 - The Perspective Tool creates an empy image...
...instead of transforming it

Add gimp_matrix3_will_explode() which determines if a transform
matrix will blow up something in a rectangle to infinity, and use
the function so set both the GIMP and GEGL code paths to clip the
transform to the input size.
2016-11-08 17:26:21 +01:00
Øyvind Kolås e1db36360b gegl-apply-operation: s/dither-strategy/dither-method/ 2016-09-28 12:05:41 +02:00
Michael Natterer 23c3cf7249 app: add gimp_gegl_node_get_format()
which is a wrapper around gegl_operation_get_format().
2016-06-08 00:04:50 +02:00
Michael Natterer 56596da23a app: support premultiplied formats in some gimp_babl functions 2016-06-08 00:03:48 +02:00
Michael Natterer b4f34375b7 Bug 767062 - Lags when zooming or dragging zoomed image (cmsFLAGS_NOOPTIMIZE)
Use cmsFLAGS_NOOPTIMIZE only for actual image buffer or single color
transforms, but not for previews or the image display. Makes things a
lot more responsive again.
2016-06-05 16:50:02 +02:00
Michael Natterer ca349f88cd libgimpcolor: add gimp_color_transform_can_gegl_copy()
Which takes two profiles and returns TRUE if converting between
them works correctly without a GimpColorTransform. Use it in
gimp_color_transform_new() to return a NULL transform if none
is needed. Took the code from gimp-gegl-loops.c.
2016-05-26 23:14:57 +02:00
Michael Natterer 0bfa402c1a Argh, this was meant to be squashed into the previous commit... 2016-05-26 22:18:50 +02:00
Michael Natterer cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00
Massimo Valentini 9e96996138 Bug 764608: Smudge tool clips out of gamut channel values...
on layers with alpha channels
2016-05-23 18:45:49 +02:00
Michael Natterer 265dfec525 app: split GimpApplicator's opacity and mode API into two functions
Added gimp_applicator_set_opacity() and remove the opacity argument
from set_mode().
2016-05-18 01:51:09 +02:00
Massimo Valentini 2dd4d3a2fa Bug 766369: Split view shows transparency filtering...
... layers with alpha channel

add an operation that selectively outputs aux
or source if out/inside the rectangle (x,y,width,height),
independently of the alpha channel and use it
in filters split preview.

mostly copied from gimp:mask-components
2016-05-16 18:08:48 +02:00
Michael Natterer cea4ea6cff app: require a text in gimp_gegl_progress_connect()
and simplify and fix the progress callback.
2016-05-11 22:50:33 +02:00
Massimo Valentini 85cb525c7e Bug 766128: Use gegl_operation_progress
instead of reimplementing it in two operations
2016-05-11 19:09:56 +02:00
Ell 45efe6c405 app: Modify gimp_gegl_apply_border() to take a style parameter
instead of the feather parameter.

The BORDER_STYLE_HARD and BORDER_STYLE_FEATHERED styles are implemented
using the "gimp:border" operation, as was done previously.  The
BORDER_STYLE_SMOOTH style is implemented by performing a "gimp:grow" and
a "gimp:shrink", and subtracting the shrunk image from the grown image
using "gegl:substract".

gimp_channel_border() is modified to pass either BORDER_STYLE_HARD or
BORDER_STYLE_FEATHER, depending on its feather parameter, to maintain
the current behavior.  The next commit replaces it with a style
parameter as well.

Mass parameter alignment changes to gimp-gegl-apply-operation.h.  Sigh...
2016-05-08 19:22:24 +00:00
Michael Natterer b5f5a1cd28 app: add gimp_gegl_config_connect_node()
which connects the properties of a config GObject and a GeglNode, much
like g_object_bind_property() which we can't be used because GeglNode
properties can't be registered with the GObjectClass.
2016-04-16 03:02:05 +01:00
Michael Natterer 3fd6435198 app: add gimp_babl_format_get_color_profile()
and remove the code duplication added a few commits before.
2016-04-15 23:02:19 +01:00
Michael Natterer 5f8b6ce8da app: s/gimp_babl_get_description/gimp_babl_format_get_description/ 2016-04-15 19:19:09 +01:00
Michael Natterer f34aa5fa6b Bug 756389 - Color-managing grayscale images
Rename profile constructors to say "d65_gray" instead of just "gray",
"srgb_trc" instead of "srgb_gamma", and drop the "srgb" from
"srgb_linear" because we now say "d65". This should be a naming scheme
that doesn't conflict with whatever future functions we might add.
2016-04-09 18:47:51 +02:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Michael Natterer 1b71731cb8 app: clean up the GEGL progress code a bit
Includes code from Massimo from bug #763135.
2016-03-23 22:53:09 +01:00
Michael Natterer 1051082189 app: use gimp_gegl_config_register() in gimp_gegl_config_new()
instead of manually interting the new type into the table.
2016-03-19 21:08:29 +01:00
Michael Natterer a0b18c7929 app: make GimpApplicator's preview feature optional
Don't add the preview nodes if use_preview_cache is FALSE in
gimp_applicator_new().
2016-02-16 21:36:35 +01:00
Michael Natterer e3144ecc4c app: add support for a "preview rectangle" to GimpApplicator
When set, it crops the effect to that rectangle, using a cache for
quickly changing the previewed area. When disabling the preview rect,
make sure we don't lose the cached result by processing it into the
output cache through the mode and affect nodes which is cheap-ish.
2016-02-16 21:36:21 +01:00
Massimo Valentini b9ba90589a Bug 678085 - Cage tool freezes GIMP
Use a proper "progress" signal instead of a property "notify" one
to update the on-canvas progress widget.

This way the graph is not invalidated while processing it
2016-02-02 12:21:15 +01:00
Ell c63bee3440 app: Add "gimp:flood" GEGL operation
This operation assigns to each pixel the minimum of the
maxima of all paths from it to the outside, as if the
input image represents a height map, and the operation
floods it with water.
2016-01-25 22:58:24 +01:00
Michael Natterer b72d73377a app: change the include guards of gegl/gimp-gegl-config.h
They can't be the same as in config/gimpgeglconfig.h.
2016-01-22 21:28:33 +01:00
Michael Natterer 1ef06fdbb2 app: add gimp_gegl_config_register()
which registers config classes for operations that don't want their
config objects to be auto-generated. Register all color tools' config
objects. Change gimp_gegl_config_sync_node() to correctly handle ops
that have an object property of the right config object type.
2016-01-22 21:28:33 +01:00
Michael Natterer 39cc3eccd5 app: rename gimp-gegl-config-proxy.[ch] to gimp-gegl-config.[ch]
and rename its functions to make more sense.
2016-01-20 12:18:35 +01:00
Michael Natterer d21ab943c1 app: make gimp_gegl_get_config_proxy() work without a passed icon_name
Keeps the GEGL tool from crashing.
2016-01-17 16:10:19 +01:00
Michael Natterer 6541c6b80b app: add icons to the generated gimp-gegl-config-proxy classes 2016-01-16 22:01:07 +01:00
Thomas Manni ca189b7a90 Bug 758769 - Smudge tool not working correctly...
...with alpha layers creates black edges

Fix the missing division in the pixels blending formula
2015-12-27 20:34:50 +01:00
Michael Natterer a33daf99fe libgimpcolor: rename RGB and GRAY gimp_color_profile_new_*() functions
to be more consistent, as discussed in bug #756389.
2015-12-15 20:42:21 +01:00
Michael Natterer 5098338470 Bug 756389 - Color-managing grayscale images
Allow to set profiles on grayscale images. Change profile validation
to check for image type and profile type. Actually the patch simply
makes some pieces of code less restrictive. Change user-visible
strings in the profile dialogs accordingly. Change PDB docs
accordingly.
2015-12-14 23:25:02 +01:00
Michael Natterer 69abd4d972 app: add progress handling to gimp_gegl_convert_color_profile,transform() 2015-10-19 01:29:22 +02:00
Michael Natterer 4479cedf13 app: rename mask enum values GIMP_COMPONENT_RED,GREEN,BLUE etc.
to GIMP_COMPONENT_MASK_RED,GREEN,BLUE etc.
2015-09-07 00:35:02 +02:00
Michael Natterer fa584ef1c1 app: add gimp_gegl_convert_color_transform() to gimp-gegl-loops.[ch]
It's split out of gimp_gegl_convert_color_profile(), used from there,
and will also be used to color manage image and layer previews.
2015-09-02 20:46:02 +02:00
Michael Natterer 37a3d423e9 Bug 679387 - Add "select pixels with this color" from colormap
Add gimp_gegl_index_to_mask() and gimp_channel_select_by_index() and
around it actions, callbacks and GUI in the colormap dialog.
2015-08-26 01:06:34 +02:00
Michael Natterer b03f0fc6e2 app: add gimp_gegl_convert_color_profile()
which converts a buffer with a profile into another one with another
profile. The function tries to avoid the lcms transform by checking if
a simple gegl_buffer_copy() has the same result.
2015-08-14 22:39:18 +02:00
Thomas Manni a7b84ded8e Bug 325564 - Use CIE LCH instead of HSL for layer mode Color
Add Hue, Chroma, Color and Lightness layer modes in LCH color space.
2015-06-02 01:37:26 +02:00
Øyvind Kolås 7e6320497e follow gegl api changes from commit af5361ca8d, with an abyss policy argument
to gegl_buffer_copy.
2015-05-25 01:27:31 +02:00
Michael Natterer bc4cf9918f Bug 673501 - Issue with Overlay
GIMP's OVERLAY mode was identical to SOFTLIGHT. This commit fixes the
issue and introduces a NEW_OVERLAY mode and enum value.

- change gimp:overlay-mode to be a real (svg-ish) overlay mode
- when compositing, map OVERLAY to gimp:softlight-mode
- when compisiting, map NEW_OVERLAY to gimp:overlay-mode
- bump the XCF version when NEW_OVERLAY is used
- map OVERLAY to SOFTLIGHT when loading and saving XCF
- map OVERLAY to softlight in all PDB setters
- map OVERLAY to softlight when deserializing a GimpContext
- change all paint mode menus to show an entry for NEW_OVERLAY
  instead of OVERLAY
- change PSP, PSD and OpenRaster to use NEW_OVERLAY

These changes should (redundantly) make sure that no OVERLAY enum
value is used in the core any longer because it gets mapped to
SOFTLIGHT at all entry points, with the downside of introducing a
setter/getter asymmetry when OVERLAY was set in a PDB api.
2015-04-29 13:32:58 -04:00
Michael Henning ef08e6934b app: Fix gimp_gegl_convolve to not abuse gegl_buffer_iterator
Iterators might only give us a small chunk of the source buffer,
but until now convolve assumed it gave us the entire buffer at once.
This simply switches to gegl_buffer_get so we always have the
entire buffer.

This fixes iscissors.
2015-03-18 02:59:26 -04:00
Michael Natterer 8c6e890835 app: rename GimpTileHandlerProjection to GimpTileHandlerValidate
Add virtual function validate() so subclasses can construct arbitrary
buffers on-the-fly. The default implementation blits from the
projection graph like before. Add boolean property "whole-tile" which
allows for switching between always validating entire tiles, and
validating the parts of the tile that are actually dirty.
2015-03-15 22:09:04 +01:00
Michael Natterer bbde1c48bd app: don't use g_free() as key_destroy_func in a GType-keyed hash table
This would have crashed if we ever replaced or removed something in
that hash table. Instead, use g_object_unref() as value_destroy_func
because the table keeps GimpContainers which we would leak if we ever
removed anything from the table.
2014-12-23 01:18:23 +01:00
Alexia Death 8cfabf7e60 app: fix gegl convolve to actually write back the result when not in alpha weighted mode 2014-11-12 15:27:11 +02:00
Michael Natterer 2b1735f784 app: move gimp_file_compare() to gimp-utils.[ch]
It's a GCompareFunc to be used for finding GFiles in lists.
2014-08-02 15:07:26 +02:00
Michael Natterer 328e4eff18 app: add gimp_progress_set_text_literal()
and use it instead of set_text (progress, "%s", literal_message);
2014-07-20 23:32:19 +02:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer 3f52828896 app: change GimpImageFile and GimpDocumentList to speak GFile 2014-07-07 23:58:11 +02:00
Michael Natterer b5530e9e3d Use the new GeglAccessMode enum instead of the old values 2014-07-02 02:00:35 +02:00
Michael Henning db4f67048d app: Always return values in non-void functions. 2014-06-29 22:35:34 -04:00
Michael Natterer 16381c9bf9 app: make gimp_gegl_apply_cached_operation() cancelable via GimpProgress
In gimp_drawable_merge_filter(), use that feature to make filter
applying cancelable. Stop projection rendering first, because we have
to run the event loop manually in order to receive input for
canceling, but we don't want the projection to be constructed from
that manual loop running.
2014-06-30 00:10:25 +02:00
Michael Natterer 88450445fc app: don't unref progress twice in gimp_gegl_apply_cached_operation() 2014-06-19 23:09:41 +02:00
Michael Natterer db2ea536da app: add an optional gegl:cache at the output of GimpApplicator
Add "gboolean use_cache" to gimp_applicator_new(). Don't use a cache
anywhere but in GimpImageMap because it incrementally fills that cache
via the projection update. In gimp_drawable_merge_filter(), get that
cache and pass it to gimp_gegl_apply_cached_operation() which then
avoids doing the work twice for the already cached results. Win!
2014-06-18 18:50:53 +02:00
Michael Natterer 14614cb349 app: add gimp_gegl_apply_cached_operation()
which does the same as gimp_gegl_apply_operation() but takes
additional arguments which are a cache buffer and a list of rectangles
that specify the already computed region in the cache buffer.
2014-06-18 18:42:17 +02:00
Michael Natterer 8aa0019c2e app: clean up inclusion of gegl-plugin.h, mostly removals 2014-06-10 03:13:09 +02:00
Michael Natterer 987d9e2800 app: add a gegl:copy-buffer to GimpApplicator
which allows to get a buffer copy of the result of the applied
operation without the overhead of running the entire graph again just
for this purpose.
2014-06-01 18:35:18 +02:00
Michael Natterer dac7201ead app: follow GEGL propertiy keys convention change
and clean up the magic a bit.
2014-05-16 03:10:01 +02:00
Michael Natterer 2acbf8a70f Bug 730071 - Selection bounds miscalculated for multiples of 128
gimp_gegl_mask_bounds(): when we succeed avoiding iterating a tile by
checking its upper-left and bottom-right, use the function's internal
meaning of x2, y2, which is the rightmost/bottommost selected pixel,
while the external meaning is the pixel right/below it.
 Short: use "foo - 1" not "foo".
2014-05-13 21:46:31 +02:00
Michael Natterer 22c222291d libgimpbase,*: clean up enum values in gimpbaseenums.h
GIMP_ADD_foo_MASK -> GIMP_ADD_MASK_foo
GIMP_foo_MODE -> GIMP_BLEND_foo
GIMP_foo_CLONE -> GIMP_CLONE_foo
GIMP_foo -> GIMP_DODGE_BURN_TYPE_foo
GIMP_foo -> GIMP_TRANSFER_foo

Add compat values for the old names and compat code to script-fu
and pygimp.
2014-04-29 20:58:30 +02:00
Michael Natterer 3c918353fb app: add double precision support, for completeness
and because it makes us look utterly cool.
2014-03-09 00:43:55 +01:00
Michael Natterer 30ae88ef07 Bug 725556 - Feather selection extremely slow
gimp_gegl_apply_feather(): add a "dest_rect" parameter to restrict
the feather area. Pass the selection bounds plus the feather radius.

For consistency, newly add gimp_gegl_apply_border,grow,shrink() and use
them in gimpchannel.c
2014-03-04 22:11:50 +01:00
Michael Natterer 6e4f9185be Bug 725112 - Small canvas doesn't update when zoomed out
gimp_tile_handler_projection_invalidate(): need to invalidate
all levels up to max_z not max_z - 1. Spotted by Massimo.
2014-03-04 19:32:14 +01:00
Michael Natterer 4be11a8c0e Bug 725112 - Small canvas doesn't update when zoomed out
Remove all code that tries to calculate the maximum level of the tile
pyramid, because that's essentially impossible. Instead simply keep
track of the max_z encountered in GeglTileSource::command().
2014-02-28 23:05:02 +01:00
Daniel Sabo db52f88308 app: Set Gimp specific TileHandler properties
Remove a dependency on GEGL setting Gimp specific properties
on custom tile handlers.
2014-02-02 02:12:02 -08:00
Daniel Sabo 71bddaa23c app: Remove deprecated "babl-tolerance" setting 2013-10-19 17:02:04 -07:00
Michael Natterer 41c92af49b app: add gimp_gegl_node_set_color() and use it in GimpChannel 2013-10-19 17:31:56 +02:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
  finally acknowledging the fact that app/ depends on gdk-pixbuf almost
  globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
2013-10-15 01:58:39 +02:00
Michael Natterer b5ff4fbab4 app: support src ops in gimp_gegl_apply_operation() 2013-09-13 09:42:53 +02:00
Daniel Sabo 34c50b0fea app, plug-ins: Don't modify iter->length
The new by-row iteration doesn't re-write the length
value for each row. In general it is not safe to modify
the iterator data because the internal logic depends
on the public data, but this specific case is new.
2013-09-12 17:43:54 -07:00
Massimo Valentini dae8291065 app: do not recurse to invalidate the pyramid 2013-08-10 16:24:16 +02:00
Michael Natterer b44ffdd198 app: add gimp_tile_handler_projection_undo_invalidate()
which removes a rectangle from the handler's dirty region, for cases
where the caller knows that the rectangle has been explicitly
constructed. Only needed by the gtk3-port branch.
2013-08-02 20:19:00 +02:00
Ville Sokk 9daf2b8443 app: remove flush parameter from write-buffer op in GimpApplicator 2013-07-06 21:24:12 +03:00
Michael Natterer f56f6d1255 app: follow the GEGL invert -> invert-linear vs. invert-gamma change
and invert masks using invert-linear and other drawables using
invert-gamma. drawable_invert_cmd_callback() still always uses
invert-gamma even though it can be used on layer masks.
2013-06-24 00:45:04 +02:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Michael Natterer 150a3e9c7e app: don't run graphs that read and write the same buffer
Work around artifacts at processing chunk borders by dup()ing the
source buffer. See bug #701875.
2013-06-18 08:06:24 +02:00
Michael Natterer f70e4cdba9 app: don't reset the mode node's opacity when changing the layer mode
gimp_gegl_mode_node_set_mode(): re-set the previously set opacity.
2013-06-12 22:13:01 +02:00
Michael Natterer d6b3a81821 app: add gimp_babl_print_pixel (format, pixel)
which returns a NULL-terminated string array with the pixels's
components, converted to text in the current locale.
2013-06-10 00:30:18 +02:00
Michael Henning 87bcc4aa3d app: Use gegl:scale-ratio instead of the deprecated gegl:scale 2013-06-09 15:10:15 -04:00
Michael Muré c2da46d810 app: adapt to the transform ops API change in GEGL 2013-06-06 19:58:48 +02:00
Michael Natterer 30e1f39ba6 app: remove support for the old GeglConfig:cache-size property 2013-06-06 00:03:26 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Michael Natterer 260c62ed94 app: don't pass "hard-edges" to the transform ops, it's gone 2013-06-04 01:16:13 +02:00
Michael Natterer 1cc9d7d7aa app: add "Use OpenCL" toggle to Prefs -> Environment
and configure GEGL accordingly. Let's see if it's really runtime
switchable :)
2013-06-01 23:04:03 +02:00