Commit Graph

4769 Commits

Author SHA1 Message Date
Michael Natterer 2b170e3a80 app: include gimpdrawable-floating-selection.h in gimplayer-floating-sel.c 2016-05-19 19:22:09 +02:00
Michael Natterer 81fd3e9c3f app: move GimpDrawable's FS to gimpdrawable-floating-selection.[ch]
and refactor it a bit to have separate functions for adding, removing
and updating the FS' drawable filter. Should be a lot more
understandable now.
2016-05-19 17:40:33 +02:00
Michael Natterer 201b11e230 app: add separate opacity and mode API to GimpDrawableFilter 2016-05-18 09:47:58 +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
Michael Natterer c0fb136203 app: add tooltips that mention that disabling color management == sRGB
Also say "better leave this enabled".
2016-05-16 17:41:04 +02:00
Michael Natterer 9fb70a44f2 app: rename GimpImageMap to GimpDrawableFilter
and gimpdrawable-filter.[ch] to gimpdrawable-filters.[ch] because of
the name clash.
2016-05-12 01:49:53 +02:00
Michael Natterer cb1a6024ff app: normalize gegl:distance-transform, it's unusuable otherwise 2016-05-12 00:13:33 +02:00
Michael Natterer 43990e8e0e app: more cleanup in GimpImageMap
Remove the filter area calculation code from gimp_image_map_apply().
Instead, automatically update the area when adding the filter to the
drawable, and when the selection changes. Also, connect to the
drawable's "removed" and remove the filter when the drawable gets
removed from the image.
2016-05-11 22:53:49 +02:00
Michael Natterer 4f0521c7cf app: don't call gimp_gegl_progress_connect() with a NULL text 2016-05-11 22:50:05 +02:00
Michael Natterer 477987dce3 app: make GimpImageMap a subclass of GimpFilter
Reduces members and all sorts of duplication and is a much better
abstraction of what it does. Also make it a lot smarter and
self-updating, chop up the apply() function and move its parts where
they belong. Also, it's now aware of selection changes and does the
right thing.

Don't abort GimpImageMapTool on selection changes, it now nicely
handles that.
2016-05-09 21:40:20 +02:00
Michael Natterer 143a2bcb95 app: make GimpImageMap setters update the drawable by itself
As in, don't require a call to gimp_image_map_apply() after setting.
2016-05-09 01:40:01 +02:00
Michael Natterer 54c0b047b2 app: add basic support for creating images with color profiles
Add "gboolean color_managed" and "GFile *color_profile" to
GimpTemplate. Add a toggle and profile combo to GimpTemplateEditor.
Honor the new template properties in gimp_image_new_from_template().

Using a GFile property instead of a GIMP_TYPE_CONFIG_PATH is
preliminary, see the previous commit. I'd like to use GFile more
directly when dealing with config files, this is for testing that.
2016-05-08 23:20:26 +02:00
Ell 8b11a505d9 app: Handle zero radius in gimp_channel_border()
Can only be triggered through PDB.  Currently assigns illegal values
to the GEGL ops' properties.
2016-05-08 19:22:24 +00:00
Ell 15d4908076 app, pdb: Modify gimp_channel_border() to take a style parameter
isntead of the feather parameter, and pass it to
gimp_gegl_apply_border().

Make the necessary changes to the rest of the code to maintain the
current behavior.

Mass parameter alignment changes to gimpchannel.h. Sigh #2...
2016-05-08 19:22:24 +00: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
Ell 46a9690353 app: Add GimpChannelBorderStyle enum
Will be used as a parameter to control the behavior of
gimp_channel_border(), and the corresponding "Select -> Border..."
action, instead of the feather flag.

Can be one of:

  - GIMP_CHANNEL_BORDER_STYLE_HARD: Current behavior, unfeathered.
  - GIMP_CHANNEL_BORDER_STYLE_SMOOTH: Smooth border, better handling
    partial selection, implemented as explained in the next commit.
  - GIMP_CHANNEL_BORDER_STYLE_FEATHERED: Current behavior, feathered.
2016-05-08 19:22:24 +00:00
Michael Natterer a544ad4718 app: #include "gimpimage-color-profile.h" in gimplayer-new.c 2016-05-08 19:56:16 +02:00
Michael Natterer 1da4236e44 app: set the image's "is color managed" in gimp_image_new_from_drawable()
based on the src image's setting.
2016-05-08 19:53:16 +02:00
Michael Natterer 8eb6cdf488 app: pass profiles around along with the buffers in the transform code
"transform" as in flip, rotate, affine. Same reasoning as in the
gimp_selection_float() commit below.
2016-05-08 18:35:40 +02:00
Michael Natterer 2739c34573 app: pass the right color profile around in gimp_selection_float()
This doesn make any difference because a NULL profile would do the
same, but it's safer to pass the actual profile instead of relying on
the magic meaning of NULL in the call to
gimp_layer_new_from_gegl_buffer().
2016-05-08 18:33:22 +02:00
Michael Natterer 5ec6d2c0f7 app: same fix as below in gimplayer-new.c
Don't use the (wrong) global display color managment switch to
determine whether or not to convert the buffer to the image's
profile. Use the image's "is color managed" switch.
2016-05-08 18:30:17 +02:00
Michael Natterer 0e3c7ea204 app: handle profile conversion correctly in gimp_layer_convert()
We used to depend on the global color management OFF switch from
prefs, but that's meant for display color management. Now, don't do a
profile transform if the target image's color management is disabled.
2016-05-08 18:23:09 +02:00
Michael Natterer cc9154b425 app: don't return any cached transforms is the image is not color managed 2016-05-08 18:20:19 +02:00
Michael Natterer 34a826d735 app: return built-in profiles from GimpColorManaged::get_color_profile(image)
if the image is not color managed.
2016-05-08 18:15:36 +02:00
Michael Natterer c28244c49d app: enable color management when the image is converted to a profile 2016-05-08 18:12:28 +02:00
Michael Natterer 7fffa9dc2a app: don't run and color profile import if the image is not color managed 2016-05-08 18:10:50 +02:00
Michael Natterer 801b1bb9bc app: reorder private functions in gimpimage-color-profile.c 2016-05-08 18:06:16 +02:00
Michael Natterer 81845552ef app: add a per-image "is color managed" switch
in order to enable/disable color management for this image. Completely
unused at the moment.
2016-05-08 18:02:57 +02:00
Michael Natterer 08b67de9bf app: don't disable profile import when display color management is off
It's the wrong switch, and the dialog has its own "don't ask me again"
logic.
2016-05-03 23:57:04 +02:00
Michael Natterer 58f8808847 app: transfer the right profile in gimp_image_new_from_drawable()
Use the drawable's profile not the image's.
2016-05-03 12:51:52 +02:00
Michael Natterer f1f91ecc2f app: don't reverse lists in GimpFilterStack and GimpUndoEditor
GimpList has a tail pointer now and can be traversed in reverse order.
2016-05-03 01:05:49 +02:00
Michael Natterer a659036b40 app: switch the list of tools to using "append" mode
and ret rid of registering tools in reverse order, and reversing the
list after deserializing it.
2016-05-01 16:05:44 +02:00
Michael Natterer 0ab6e6be69 app: make sure the last *visible* layer is displayed in normal mode
The bottom visible layer must be rendered in normal mode because
every other mode on top of nothing renders nothing.

Before, we would display a stack's last layer in normal mode, which
was a braindead attempt to make the layer stack look like in 2.8. Now
we set GimpFilter's "is-last-node" property the right way by looking
at the filters' visibility in GimpFilterStack.
2016-05-01 15:38:36 +02:00
Michael Natterer 39909b6008 app: replace GimpList's internal GList with a GQueue
so we can easily iterate in reverse order, and access the last element
in O(1). Nothing makes use of this yet.
2016-05-01 15:22:44 +02:00
Michael Natterer 7ae81e70b9 app: move the "visible" property from GimpItem to GimpFilter
Same for the "visibility_changed" signal. GimpItem keeps its
visibility API because it adds undo over GimpItem's API.
2016-05-01 14:27:43 +02:00
Michael Natterer 8c107963e6 app: implement GimpColorManaged in GimpDrawable
so now all drawables have a profile. Default to the babl format's
bultin profile and override to use the image's format in GimpLayer.
2016-04-30 23:41:32 +02:00
Michael Natterer 329d5c0a0f app: #include gimp-babl.h in gimpimage-convert-type.c 2016-04-30 18:50:23 +02:00
Michael Natterer 12f9aa9bd2 Bug 765176 - ICC profile conversions between grayscale and RGB images
Add a dest_profile parameter to gimp_image_convert_type() so a profile
can be chosen when converting between RGB and GRAY. Has no GUI yet.
2016-04-30 18:35:52 +02:00
Michael Natterer 33adec2a3e app: add gimp_image_validate_color_profile_by_format()
which checks if a color profile is suited for pixels of a Babl format.
2016-04-30 18:35:52 +02:00
Michael Natterer ef8b802032 app: move indexed conversion to gimpimage-convert-indexed.[ch]
It's so much code and takes so many additional parameters over RGB and
GRAY conversion, it got its own place and function now.
2016-04-30 18:35:52 +02:00
Michael Natterer 4086932e8d app: tiny and completely irrelevant stylistic cleanup 2016-04-30 18:35:52 +02:00
Michael Natterer ef4ab94a12 app: change GimpDrawable::convert_type() to take a target profile
instead of just a boolean "convert_profile". This takes the logic to
figure the right target profile out of gimp_layer_convert_type(), it
can't possibly know everything about how to convert anyway, and having
the logic in the callers conveniently splits it up and distributes its
parts to the places they belong.

This commit should cause no behavor change and is just preparation for
fixing bug 765176.
2016-04-30 18:35:52 +02:00
Massimo Valentini 022439e463 Bug 765492: Memory leak in gimp_brush_cache_add
g_free the lru 'unit' when removed from the cache

and keep track of the list length and last item
while looking for a duplicate already present in
the cache.
2016-04-24 19:41:22 +02:00
Michael Natterer 19738412ce app: simplify gimp_image_convert_type()
It's pretty pointless to have 5 differently-styled if(INDEXED) blocks
after each other, with zero non-INDEXED code in between.
2016-04-24 00:55:04 +02:00
Jehan 77a68e00af Bug 765459 - Artifacts symmetry painting with big brushes.
Use gegl_node_blit() instead of gegl_node_process() as proposed by
Massimo in the bug report.
2016-04-24 00:01:45 +05:30
Massimo Valentini a357bfec89 Bug 765247: Foreground select tool does not respect item offsets 2016-04-20 06:48:04 +02:00
Michael Natterer 3968226644 Bug 765176 - ICC profile conversions between grayscale and RGB images
gimp_image_convert_type(): call gimp_drawable_convert_type() with
convert_profile = TRUE.
2016-04-20 04:20:58 +01:00
Michael Natterer 66525e634e app: fix wrong parameter name in gimp_drawable_real_convert_type() 2016-04-20 04:19:44 +01:00
Thomas Manni f4cb2dd881 Bug 109161 - Improve Histogram with Luminance Channel
Add a luminance channel to GimpHistogram
2016-04-18 19:35:06 +01:00
Michael Natterer 29f55a95ef app, pdb: minor cleanup in the new font loading code 2016-04-17 21:06:00 +01:00