Commit Graph

1786 Commits

Author SHA1 Message Date
Jehan 6bec0bc82d app: radius map actually not useful during smart colorization grow step.
The distance map has all the information we need already. Also we will
actually grow up to the max radius pixel (middle pixel of a stroke).
After discussing with Aryeom, we realized it was better to fill a stroke
fully (for cases of overflowing, I already added the "Maximum growing
size" property anyway).
2018-11-27 14:59:35 +01:00
Jehan 613bf7c5ab app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous
version of the file by incomplete contents. So run
g_output_stream_close() with a cancelled GCancellable to do so.
See also discussion in #2565.
2018-11-26 15:50:38 +01:00
Jehan eb042e6c87 app: add "line-art-max-grow" property to the bucket fill options.
When flooding the line art, we may overflood it in sample merge (which
would use color in the line art computation). And if having all colors
on the same layer, this would go over other colors (making the wrong
impression that the line art leaked).
This new option is mostly to keep some control over the mask growth.
Usually a few pixels is enough for most styles of drawing (though we
could technically allow for very wide strokes).
2018-11-22 18:13:58 +01:00
Jehan 3467acf096 app: replace gegl:watershed-transform with custom algorithm.
We don't really need to flow every line art pixel and this new
implementation is simpler (because we don't actually need over-featured
watershedding), and a lot lot faster, making the line art bucket fill
now very reactive.
For this, I am keeping the computed distance map, as well as local
thickness map around to be used when flooding the line art pixels
(basically I try to flood half the stroke thickness).

Note that there are still some issues with this new implementation as it
doesn't properly flood yet created (i.e. invisible) splines and
segments, and in particular the ones between 2 colored sections. I am
going to fix this next.
2018-11-22 14:24:52 +01:00
Jehan 3f58a38574 app: remove now useless erosion size option.
Since commit b00037b850, erosion size is not used anymore, as this step
has been removed, and the end point detection now uses local thickness
of strokes instead.
2018-11-19 14:18:18 +01:00
Jehan 824af12438 app: edit the bucket fill tool options with new line art options.
I have not added all the options for this new tool yet, but this sets
the base. I also added a bit of TODO for several places where we need to
make it settable, in particular the fuzzy select tool, but also simply
PDB calls (this will need to be a PDB context settings.

Maybe also I will want to make some LineArtOptions struct in order not
to have infinite list of parameters to functions. And at some point, it
may also be worth splitting a bit process with other type of
selection/fill (since they barely share any settings anyway).

Finally I take the opportunity to document a little more the parameters
to gimp_lineart_close(), which can still be improved later (I should
have documented these straight away when I re-implemented this all from
G'Mic code, as I am a bit fuzzy on some details now and will need to
re-understand code).
2018-11-14 13:37:42 +01:00
Jehan f246f40494 app: compute line art in advance.
Right now, this is mostly meaningless as it is still done sequentially.
But I am mostly preparing the field to pre-compute the line art as
background thread.
2018-11-14 13:37:42 +01:00
Michael Natterer 0b99fc8194 plug-ins, pdb: remove the fractal-trace plug-in and add a PDB compat proc 2018-10-20 13:05:17 +02:00
Michael Natterer 6938d11716 Issue #1997 - Colors not properly converted to image's color space
Add a Babl space parameter to gimp_gegl_color_new() and all utility
functions using it. Pass NULL if the GimpRGB actually is sRGB, pass
the image's layer space if the color was already converted using
gimp_pickable_srgb_to_image_color() or similar.
2018-08-09 20:04:44 +02:00
Michael Natterer e09e563a70 Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.

libgimp:

- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
  as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
  NON_LINEAR and PERCPTUAL for each encoding, matching the babl
  encoding variants RGB, R'G'B' and R~G~B~.

- gimp_color_transform_can_gegl_copy() now returns TRUE if both
  profiles can return a babl space, increasing the amount of fast babl
  color conversions significantly.

- TODO: no solution yet for getting libgimp drawable proxy buffers in
  the right format with space.

plug-ins:

- follow the GimpPrecision change.

- TODO: everything else unchanged and partly broken or sub-optimal,
  like setting a new image's color profile too late.

app:

- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
  replacement for all "linear" booleans.

- change gimp-babl functions to take babl spaces and GimpTRCType
  parameters and support all sorts of new perceptual ~ formats.

- a lot of places changed in the early days of goat invasion didn't
  take advantage of gimp-babl utility functions and constructed
  formats manually. They all needed revisiting and many now use much
  simpler code calling gimp-babl API.

- change gimp_babl_format_get_color_profile() to really extract a
  newly allocated color profile from the format, and add
  gimp_babl_get_builtin_color_profile() which does the same as
  gimp_babl_format_get_color_profile() did before. Visited all callers
  to decide whether they are looking for the format's actual profile,
  or for one of the builtin profiles, simplifying code that only needs
  builtin profiles.

- drawables have a new get_space_api(), get_linear() is now get_trc().

- images now have a "layer space" and an API to get it,
  gimp_image_get_layer_format() returns formats in that space.

- an image's layer space is created from the image's color profile,
  change gimpimage-color-profile to deal with that correctly

- change many babl_format() calls to babl_format_with_space() and take
  the space from passed formats or drawables

- add function gimp_layer_fix_format_space() which replaces the
  layer's buffer with one that has the image's layer format, but
  doesn't change pixel values

- use gimp_layer_fix_format_space() to make sure layers loaded from
  XCF and created by plug-ins have the right space when added to the
  image, because it's impossible to always assign the right space upon
  layer creation

- "assign color profile" and "discard color profile" now require use
  of gimp_layer_fix_format_space() too because the profile is now
  embedded in all formats via the space.  Add
  gimp_image_assign_color_profile() which does all that and call it
  instead of a simple gimp_image_set_color_profile(), also from the
  PDB set-color-profile functions, which are essentially "assign" and
  "discard" calls.

- generally, make sure a new image's color profile is set before
  adding layers to it, gimp_image_set_color_profile() is more than
  before considered know-what-you-are-doing API.

- take special precaution in all places that call
  gimp_drawable_convert_type(), we now must pass a new_profile from
  all callers that convert layers within the same image (such as
  image_convert_type, image_convert_precision), because the layer's
  new space can't be determined from the image's layer format during
  the call.

- change all "linear" properties to "trc", in all config objects like
  for levels and curves, in the histogram, in the widgets. This results
  in some GUI that now has three choices instead of two.
  TODO: we might want to reduce that back to two later.

- keep "linear" boolean properties around as compat if needed for file
  pasring, but always convert the parsed parsed boolean to
  GimpTRCType.

- TODO: the image's "enable color management" switch is currently
  broken, will fix that in another commit.
2018-07-21 16:42:57 +02:00
Ell b4ac956859 app, pdb: add gimp-register-file-handler-priority procedure
Add a gimp-register-file-handler-priority procedure, which can be
used to set the priority of a file-handler procedure.  When more
than one file-handler procedure matches a file, the procedure with
the lowest priority is used; if more than one procedure has the
lowest priority, it is unspecified which one of them is used.  The
default priority of file-handler procedures is 0.

Add the necessary plumbing (plus some fixes) to the plug-in manager
to handle file-handler priorities.  In particular, use two
different lists for each type of file-handler procedures: one meant
for searching, and is sorted according to priority, and one meant
for display, and is sorted alphabetically.
2018-07-17 02:56:18 -04:00
Michael Natterer 2cd829eb85 app: add GimpAuxItem as base class for GimpGuide and GimpSamplePoint
and GimpAuxItemUndo for their respective undo classes.
2018-07-15 17:08:06 +02:00
Michael Natterer 680642e37c plug-ins, pdb: remove the unsharp-mask plug-in and add a PDB compat proc 2018-07-14 17:11:25 +02:00
Michael Natterer bab75b7365 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.
2018-07-14 14:19:27 +02:00
Michael Natterer 397ae027ba Issue #1834 - (gimp-context-get-gradient) could return a gradient name...
...not found if language changed since last session

For various reasons, (gimp-context-get-brush, pattern, gradient, ...)
can return "Standard" which is the untranslatable name of the internal
fallback object.

Therefore, we must accept "Standard" as fallback in all PDB functions
that take brush, pattern, gradient etc. names.
2018-07-12 12:42:49 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell 49ca383fa4 app, pdb: use gimp_babl_is_valid() in more places
Use gimp_babl_is_valid(), added in the previous commit, to validate
image-type/precision combinations in various functions.
2018-07-06 13:44:57 -04:00
Michael Natterer 63817485c0 app: when a plug-in procedure is not sensitive, show the reason in the tooltip
Return an optional tooltip from gimp_procedure_get_sensitive(), in
GimpPlugInProcedure, build that tooltip from the image types the
procedure works on.
2018-06-22 13:29:52 +02:00
Jehan d56a8d439e app: do not stop the measurement when straightening.
Instead just transform the measurement extremities appropriately to
still map to the same points.
To do so, I also added out parameters to gimp_image_resize_to_layers()
so that calling code can get offsets from old origin (as well as new
image dimensions).
2018-06-05 23:34:30 +02:00
Michael Natterer e88fb8e9c7 app: remove all old font management code, switch to GimpFontFactory[View]
Biggest change in this commit is reordering stuff in GimpContext
because GimpFont is now a first class citizen.
2018-06-03 01:27:06 +02:00
Ell f2134180de app, pdb: wait for fonts to load before dependent operations
Use gimp_fonts_wait(), added in the previous commit, to wait for
fonts to finish loading before operations that depend on font
availability.  In particular, this includes font- and text-related
PDB functions, and text-layer rendering.
2018-05-29 16:04:28 -04:00
Jehan 2484dec7d5 Issue #1211: Load fonts in background after startup.
Fonts should not be blocking startup as this provides a very bad
experience when people have a lot of fonts. This was experienced even
more on Windows where loading time are often excessively long.
We were already running font loading in a thread, yet were still
blocking startup (thread was only so that the loading status GUI could
get updated as a feedback). Now we will only start loading and proceed
directly to next steps.
While fonts are not loaded, the text tool will not be usable, yet all
other activities can be performed.
2018-05-27 02:13:33 +02:00
Michael Natterer 8511eb6451 pdb: remove all compat procedures for the old lcms plug-in 2018-05-20 21:06:33 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer f180a171cd pdb: remove all deprecated procedures 2018-05-20 21:06:29 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Michael Natterer 7e1df2c8c6 app: add layers/channels/vectors freeze/thaw to gimpplugin-cleanup
so plug-ins cannot thaw what they haven't frozen, and the code
can clean up frozen stuff left behind by crashed or broken plug-ins.

Also redo the cleanup code so it only keeps track of the undo group
counts and freeze counts of what *this* GimpPlugInProcFrame did
itself. That should make it even stricter against broken code that
could mess up internals.
2018-05-07 20:09:07 +02:00
Ell 40e3406b91 pdb: add gimp-image-{freeze,thaw}-{layers,channels,vectors}
These procedures freeze/thaw the corresponding containers of the
image, allowing plug-ins that perform many changes affecting any of
these containers to suppress updates to the corresponding dialogs,
significantly improving performance.
2018-05-07 02:56:10 -04:00
Jehan e796e3a50a app: popup error at startup when some fonts fail to load.
As proposed on IRC. This will allow people to debug their fonts (for
instance when there are permission issues or whatnot) by knowing the
list of problematic fonts in an error dialog at startup (and not only on
terminal).
2018-05-01 03:25:58 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Simon Budig 44a931e16c ripple: put the compat code in the proper place, fix up POTFILES.in 2018-04-24 14:26:39 +02:00
Simon Budig e6de783b3c remove the ripple plugin, provide compat PDB-API 2018-04-24 13:05:58 +02:00
Michael Natterer db227148f0 pdb: finally deprecate gimp-color-balance
Since nobody can tell me how the new gimp-drawable-color-balance can
be improved, it's going to be identical, just with a namespace.
2018-04-23 18:20:05 +02:00
Michael Natterer a9fb4f9a39 pdb: make all item-transform procedures honor the "linked" flag
and improve their documentation.
2018-04-23 17:10:46 +02:00
Michael Natterer b80036e14f pdb: deprecated gimp-layer-translate
and port all plug-ins/scripts to gimp-item-transform-translate.
2018-04-23 15:49:23 +02:00
Michael Natterer acbdc4d5b4 pdb: add gimp-item-transform-translate procedure
We were only able to translate selections and layers (bot not channels
and paths) via the PDB, this new procedure fixes that. Deprecation of
old API and some more transform consistency to follow...
2018-04-23 03:06:23 +02:00
Michael Natterer 8be37da012 Bug 795418 - Gimp 'critical error' when running luminosity masks script
In the gimp-channel-combine-masks PDB wrapper, only push an undo step
if the modified channel is attached to an image. It's a completely
reasonable use case to combine unattached channels.
2018-04-21 10:41:29 +02:00
Jehan 38a2887802 app, pdb: s/gimp_pdb_item_is_modifyable/gimp_pdb_item_is_modifiable/
Fix proper English.
2018-04-20 23:34:01 +02:00
Michael Natterer a1081bd595 app: fix gimp_pdb_item_is_modifyable() for channels
When a channel is position-locked, it is also implicitly
content-locked because we translate channels by modifying their
pixels.
2018-04-20 19:17:01 +02:00
Michael Natterer 12d38816a5 pdb: fix formatting of generated code in item_transform.pdb 2018-04-19 01:03:29 +02:00
Michael Natterer 428110f63f app: remove non-cut/copy/paste functions from gimp-edit.[ch]
Move them to the new files gimpdrawable-edit.[ch] and
gimpimage-fade.[ch].
2018-04-18 23:48:33 +02:00
Michael Natterer 436e53d390 pdb: improve docs about which procedures are affected by context settings
Also add some double blank lines so they show up as single blank
lines in the generated docs, which improves readablility.
2018-04-17 13:19:16 +02:00
Michael Natterer 93f41b344c pdb: improve docs of gimp_context_set_diagonal_neighbors() 2018-04-17 01:16:54 +02:00
Michael Natterer c0dd812ea6 pdb: fix use of "seed" properties in plug_in_compat.pdb
now that GeglParamSpecSeed is uint.
2018-04-17 00:42:15 +02:00
Michael Natterer 3f4995d3d7 pdb: add procedures to set the built-in gradients
gimp-context-set-gradient-fg-bg-rgb
gimp-context-set-gradient-fg-bg-hsv-cw
gimp-context-set-gradient-fg-bg-hsv-ccw
gimp-context-set-gradient-fg-transparent
2018-04-16 11:42:46 +02:00
Michael Natterer 410e55c40c pdb: never pass bogus supersample values to gimp_drawable_gradient()
even when supersampling is not enabled, or we will get warnings about
out-of-range property values.
2018-04-16 01:18:05 +02:00
Michael Natterer 5ee67deea5 pdb: deprecate all non-clipboard functions in the "edit" group
Still have to port script-fu scripts...
2018-04-15 16:39:59 +02:00
Michael Natterer ef3edece9b pdb: improve docs of deprecated functions
Don't unconditionally overwrite all the proc's description, author
etc.  Instead, try to preserve them and append the "Deprecated" notes
to the help texts and generated comments.

Only affects one procedure because we killed the meta info of all
other deprecated procs so far, but now we don't have to do that any
longer.
2018-04-15 16:06:00 +02:00
Michael Natterer 50536e1c38 Bug 795230 - Rename Blend tool and provide PDB compatibility
Add new PDB group "drawable_edit" which has all procedures from the
"edit" group which are not cut/copy/paste.

The new group's procedures don't have opacity, paint_mode
etc. arguments but take them from the context instead. Unlike the old
gimp-edit-fill, gimp-drawable-edit-fill now uses the context's opacity
and paint_mode.

The new gimp-drawable-edit-gradient-fill procedure uses even more
context properties which are also newly added with this commit
(gradient_color_space, gradient_repeat_mode, gradient_reverse).

And some cleanup in context.pdb.

This is still WIP, nothing in the edit group is depcreated yet.
2018-04-15 15:28:50 +02:00
Michael Natterer 3661097c04 app: add gimp_pdb_context_get_paint_options_list()
Which returns the entire GimpContainer of paint options.
2018-04-14 21:11:05 +02:00
Michael Natterer 5f6dfc7617 app: add GimpGradientBlendColorSpace parameter to gimp_drawable_gradient() 2018-04-14 01:34:50 +02:00
Michael Natterer 4f2e078ccb Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpdrawable-blend.[ch] to gimpdrawable-gradient.[ch]
2018-04-13 23:43:27 +02:00
Michael Natterer bf49b47620 Bug 795207 - Add color space to blend(gradient) tool options
First WIP commit, adds:

- enum GimpGradientBlendColorSpace { RGB_PERCEPTUAL, RGB_LINEAR }
- linear blending mode for gradient segments
- tool options GUI for the blend and paint tools which use gradients
2018-04-13 22:33:16 +02:00
Michael Natterer 3f95dc52d3 Bug 791519 - Unexpected selection from channel
Make sure a channel -> selection -> channel roundtrip never does any
gamma conversion.

In gimp_channel_duplicate(), make sure a created channel has the
right format, and the right data. Fixes selection -> channel.

When switching off quick mask, call gimp_item_to_selection() instead
if gimp_selection_load(), the latter was implementing a shortcut which
is now wrong.

Remove gimp_selection_load() which is now unused.

Unrelated: also remove gimp_selection_save(), it was an obvious
3-liner used only twice.
2018-04-10 02:00:23 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Michael Natterer 753bd0a0c9 pdb: add jehan_pdb_misc() and use it in the new procedures
so they have the correct aithor.
2018-03-18 13:57:43 +01:00
Jehan 1789f0fe2a app, libgimp, pdb: update gimp_edit_blend() description.
Make it known that gimp_context_set_distance_metric() influences the end
render of a shapeburst blend.
2018-03-18 13:21:05 +01:00
Jehan e164aee7a9 app, libgimp, pdb: add "distance-metric" property to GimpPDBContext.
This property is currently only used for gimp_edit_blend() to control
how are computed distances. In the future, it could be used for more
functions making use of "gegl:distance-transform" operation, or even for
other algorithms, if relevant.
This new property obviously comes with 2 new PDB calls:
gimp_context_get_distance_metric() & gimp_context_set_distance_metric()
2018-03-18 01:03:40 +01:00
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Ell 7e661d3ca9 pdb: allow adding masks to group layers in layer-add-mask
... and a small fix to last commit.
2018-02-05 15:33:55 -05:00
Ell 9befb8594e pdb: fail layer-remove-mask if applying a mask to a group layer
... which is not supported.
2018-02-05 15:15:22 -05:00
Jehan 9fdf35550b app: new error dialog to backtrace and encourage people to report bugs.
GIMP will now try to get a backtrace (on Unix machines only for now,
using g_on_error_stack_trace(); for Windows, we will likely have to look
into DrMinGW).
This is now applied to CRITICAL errors only, which usually means major
bugs but are currently mostly hidden unless you run GIMP in terminal. We
limit to 3 backtraces, because many CRITICAL typically get into domino
effect and cause more CRITICALs (for instance when a g_return*_if_fail()
returns too early).
2018-01-28 15:43:07 +01:00
Michael Natterer dce93c7d7e Bug 762443 - Levels tool Output Level sliders works incorrectly
Add "clamp-input" (which clamps the input values to [0..1])
and "clamp-output" (which clips the final result to [0..1]),
properties, parameters and GUI to:

- GimpLevelsConfig
- GimpOperationLevels
- The levels tool dialog
- The gimp_drawable_levels() PDB API

The old deprecated gimp_levels() PDB API now sets both clamping
options to TRUE which restores the 2.8 behavior.

Also reorder some stuff in GimpLevelsConfig and elsewhere so the
levels parameters are always in the same order.
2018-01-02 18:47:20 +01:00
Michael Natterer b05cfc6050 pdb: (try 3) move PDB generation and sources to toplevel/pdb
It never belonged inside "tools". Also rename its "pdb" subdirectory
to "groups". This had to happen before 2.10 so cherry-picking between
branches doesn't become a nightmare in the future.
2017-12-17 14:16:08 -05:00
Ell bccef43049 app, pdb: prevent custom gradient from being renamed
Make internal data objects non-renamable, even if they're writable,
through gimp_data_is_name_editable().  Currently, the only such
object is the custom gradient.

Prevent changing the name of non-renamable data by making the name
entry of GimpDataEditor non-editable whenever
gimp_viewable_is_name_editable() is FALSE, even if the data is
otherwise editable.

Prevent the vairous PDB -rename() functions from renaming non-
renamable data, by adding a GimpPDBDataAccess flags type,
specifying the desired access mode for the data -- any combination
of READ, WRITE, and RENAME -- and replacing the 'writable'
parameter of the gimp_pdb_get_foo() functions with an 'access'
parameter.  Change the various .pdb files to use READ where they'd
used FALSE, and WRITE where they'd used TRUE; use RENAME, isntead
of WRITE, in the -rename() functions.
2017-10-30 17:22:29 -04:00
Ell 4db000a522 pdb, libgimp: add gimp-item-{get,set}-expanded()
... which call gimp_viewable_{get,set}_expanded()
2017-10-22 12:30:21 -04:00
Michael Natterer 723c4d7f87 app: remove GimpColorizeConfig, merge its props into GimpOperationColorize
Colorize doesn't need a config object just because it has a generated
property for the GUI only.
2017-09-05 21:26:59 +02:00
Michael Natterer e6c1c14a94 pdb, libgimp: change the gimp-drawable-invert API again
Remove the invert-linear and invert-non-linear variants and simply add
"gboolean linear" to gimp-drawable-invert. This should actually be an
enum but I didn't find a good name right now...
2017-09-03 21:28:47 +02:00
Michael Natterer 2e6c39ed9c pdb, libgimp: rename gimp_drawable_invert() to _invert_non_linear()
and add gimp_drawable_invert_linear(). Also, finally deprecate
gimp_invert() and port all its uses in plug-ins and scripts to
gimp_drawable_invert_non_linear() so the result is the same.
2017-08-30 12:27:17 +02:00
Michael Natterer e16c8a2352 Move the new "default_new_layer_mode" APIs to the image...
...in both the core and libgimp.

Images now know what the default mode for new layers is:

- NORMAL for empty images
- NORMAL for images with any non-legacy layer
- NORMAL_LEGAVY for images with only legacy layers

This changes behavior when layers are created from the UI, but *also*
when created by plug-ins (yes there is a compat issue here):

- Most (all?) single-layer file importers now create NORMAL layers
- Screenshot, Webpage etc also create NORMAL layers

Scripts that create images from scratch (logos etc) should not be
affected because they usually have NORMAL_LEGACY hardcoded.

3rd party plug-ins and scripts will also behave old-style unless they
get ported to gimp_image_get_default_new_layer_mode().
2017-08-21 20:18:00 +02:00
Michael Natterer 59fae30b53 pdb: add new procedure gimp-get-default-new-layer-mode
Which returns GimpCoreConfig::default-new-layer-mode and will be
used to make plug-ins create layers/images in the configured way.
2017-08-20 16:12:53 +02:00
Michael Natterer 7ce77c47cc app: stop hardcoding NORMAL_LEGACY for new layers/images
Use GimpCoreConfig::default-new-layer-mode instead.
2017-08-20 15:02:46 +02:00
Michael Natterer 0cfe550639 app, pdb: change a lot of GIMP_LAYER_MODE_NORMAL_LEGACY to just NORMAL
this commit changes just those which make no difference to
functionality: property and object member defaults that get overridden
anyway, return values of g_return_val_if_fail(), some other stuff.
2017-08-19 20:33:47 +02:00
Michael Natterer c41e8eca86 Bug 785535 - Histogram not updating in real when filters are active
Add "gboolean with_filters" to gimp_drawable_calculate_histogram(),
which is passed as FALSE in almost all places, except the histogram
dockable where we want to see both the drawable's unmodified histogram
*and* the histogram after filters are applied.
2017-08-05 17:15:31 +02:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer a72026820f app: rename gimpimage-pick-layer.[ch] to gimpimage-pick-item.[ch] 2017-06-22 08:17:40 +02:00
Michael Natterer c0c1225e93 pdb: remove a misplaced " from fileops.pdb 2017-06-03 18:12:50 +02:00
Michael Natterer e122303fe0 Bug 783382 - Lava filter broken
Allow NONE(0) for "wrapmode" (which translates to GEGL_ABYSS_NONE) in
the plug-in-edge PDB compat wrapper. The old plug-in accepted this
(undocumented) value and used a GimpPixelFetches in NONE mode.
2017-06-03 17:08:47 +02:00
Michael Natterer 03085f491d app: ref the GimpProgress in gimp_procedure_execute[_async]()
around calling the actual execute vfuncs, Seen a crash when quitting
GIMP while a script-fu window was open, the progress was already
finalized. Now it simply prints the error message about the failing
script on the concole.
2017-05-28 17:41:52 +02:00
Michael Natterer 7f33edea1b app, libgimp: allow to register more than one MIME type per procedure
GIMP will always use the first one from the list, but at least now
there is a way to register variants.
2017-05-04 23:22:37 +02:00
Michael Natterer 560340e8d6 app, pdb, libgimp: make the raw image importer configurable
Add "import-raw-plug-in" to gimprc, and a new procedure
gimp_register_file_handler_raw(). On startup, remove all load
procedures that are marked as "handles raw" but are not implemented by
the configured plug-in. Add the list of available plug-ins to prefs ->
import/export. Register all file-darktable procedures as handling raw.
2017-05-04 20:38:58 +02:00
Michael Natterer 722a1a1368 app: add gimp_edit_paste_as_new_image() and use it from GUI and PDB 2017-05-01 19:10:52 +02:00
Michael Natterer 536cc8531a app: keep the src image's resolution and unit in copied/cut GimpBuffers
and use them for the new image in "Paste as new image". We were using
the resolution and unit of the image the paste command was invoked
from, which is entirely random and useless.
2017-05-01 18:39:13 +02:00
Michael Natterer c2f0226f66 Bug 781408 - script fails due to error in edit-copy / edit-paste
Fix the edit-paste and edit-paste-as-new-image PDB wrappers to use
gimp_get_clipboard_object(), not just clipboard_buffer(), and deal
correctly with entire images in the clipboard.
2017-04-19 16:44:08 -03:00
Ell 0a42c6b4bd pdb: fix input range of context-set-brush-size 2017-04-10 09:57:54 -04:00
Ell 16bebedc44 pdb: add debug group; add debug-timer-{start,end} procs
Add a debug procedure group, living in 'debug.pdb', which would host
useful debug helper functions.  Functions in this group are not part
of the stable API, and may be changed at any point.

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

Add two debug procedures: gimp-debug-timer-start() and
gimp-debug-timer-end(), which measure elapsed time, a la
GIMP_TIMER_{START,END}, and can be used to profile script-fu
commands.
2017-04-06 11:48:05 -04:00
Ell 7c7a1b6383 app: integer-ify position/offset members of GimpSourceCore
We don't support subpixel source sampling, so there's no use in
pretending that we do.  Demoting everything to int as soon as
possible helps guarantee that these values are at least rounded
properly and in fewer places.

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

Keep using floats only in the signatures of the relevant PDB
functions.
2017-04-03 15:32:27 -04:00
Jehan bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01:00
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 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +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 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
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
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 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 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
Ø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 07600c6db6 libgimpbase: proper names for the GimpChannelType enum
Register the old value names as compat. Also add some forgotten
values and enums to gimpcompatenums.h
2017-01-09 19:40:30 +01:00
Michael Natterer 178794f6f1 libgimpbase: rename enum GimpHueRange's values
and add compat cruft for the old names.
2017-01-09 02:45:16 +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
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Michael Natterer fc9da4c9a3 app: allow to toggle the histogram dialog between gamma and linear
Change GimpHistogram to take a "gboolean linear" parameter and always
honor that parameter, so both kinds of histograms can now be created
for all drawables.

Add a horrible "Linear" toggle to the histogram dockable which always
defaults to the active layer's actual pixel format, but can be
switched at any time. This UI is ugly and needs to change.

On the PDB, default to gamma-corrected if the plug-in is unaware of
higher precision, and to the drawable's native pixel format otherwise.

Other places using histograms (e.g. levels, curves) are unchanged.
2016-12-26 17:32:17 +01:00
Jehan 3fa016fb4b app: clean out tab indentations. 2016-12-21 04:05:32 +01:00
Michael Natterer 87d38194d7 app, pdb: use GeglDitherMethod instead of simply an integer 2016-11-07 20:41:39 +01:00
Michael Natterer c767179ced app, pdb: fix bug in recent gimp-drawable-threshold change
Actually use the passed ranges again, instead of using uninitialized
local variables.
2016-11-07 20:27:36 +01:00
Michael Natterer 3cef404e20 app, pdb, libgimp: allow to choose the channel when thresholding
so the threshold can now be based on the GimpHistogramChannel enum.
Add a channel menu to the threshold dialog and a channel argument to
the PDB procedure (which is new in 2.10).

If I hadn't forgotten what the "RGB" channel is supposed to do I would
have implemented the RGB mode in GimpOperationThreshold correctly.
Right now I'm just guessing. Anyone?
2016-11-01 22:45:37 +01:00
Michael Natterer 3307c71966 pdb, app, libgimp: change ranges for histogram and threshold to 0.0..1.0
They used to be 0..255, inherited from the old gimp_histogram() and
gimp_threshold() procedures. This commit deprecates these old
procedures and changes the ranges in the new gimp_drawable_histogram()
and gimp_drawable_threshold() to double with a 0.0..1.0 range.
2016-11-01 20:57:16 +01:00
Michael Natterer 31fcd79dd9 Bug 769738 - Add color tags/labels for layers/channels/paths
Add property "color-tag" of type enum GimpColorTag to GimpItem so all
layers, channels and paths can be tagged with a color.

For interoperability, use the color list from Krita which is a
superset of Photoshop's colors.

Features a "Color Tag" submenu in the layers, channels and paths
menus, a row of color radio buttons in the properties dialogs,
undo and PDB API.

As a side effect, some common code is now factores out into
items-actions.[ch] and items-commands.[ch] which adds visible, linked
and lock actions for layers and channels.
2016-10-29 17:02:16 +02:00
Michael Natterer 997ae1e28b Bug 764024 - Allow to choose fill color when resizing layers and images
Add a GimpFillType argument to GimpItem::resize() and fill type
widgets to the canvas and layer resize dialogs. Fill the new parts of
the drawable according to fill type in gimp_drawable_resize(). Make
sure places that need the old behavior get GIMP_FILL_TRANSPARENT
passed by hardcoding it in the GimpItem::resize() implemetations of
channel, mask, selection etc.
2016-10-10 00:02:16 +02:00
Michael Natterer 41754669e6 pdb: fix PDB compat wrappers which i just broke
and simplify them using gimp_color_config_get_rgb_color_profile().
2016-10-01 00:43:17 +02:00
Michael Natterer 0524b60228 app: consistently treat GimpColorConfig profile paths as config paths
and use gimp_file_new_for_config_path() and _get_config_path() when
dealing with them. We used a weird mix of config paths and plain
(filesystem encoded) paths, waiting to to break on umlauts or
whatever. The code in gimpcolorconfig.c was particularly bad.
2016-10-01 00:29:44 +02:00
Michael Natterer 009417e450 app: reorder and rename indexed conversion parameters to make more sense 2016-09-27 23:51:33 +02:00
Michael Natterer ea98f9967e app: change gimp_pickable_auto_shrink()'s parameters
from x1, y1, x2, y2 to x, y, width, height.
2016-09-25 22:40:28 +02:00
Michael Natterer 21ec859c4a app: rename gimp_layer_flatten() to gimp_layer_remove_alpha() 2016-09-21 11:56:25 +02:00
Michael Natterer 109e01dbdd pdb, app, libgimp: rename *-paste-as-new to *-paste-as-new-image
Keep the old function names around as deprecated compat wrappers.
2016-09-20 20:20:25 +02:00
Michael Natterer be91db8107 pdb: fix typo in edit-paste's help 2016-09-20 18:54:34 +02:00
Michael Natterer 67863dabf9 Bug 637313 - Should be possible to copy/paste whole layers in a single step
Use the newly added clipboard for entire images to copy/paste layers
(we only create single-layer clipboard images, and use only the first
layer of any recieved image, the layers can be arbitrarily complex
though):

- change gimp_edit_copy,cut,paste() to return/take a GimpObject
  that can be a GimpImage or GimpBuffer
- cut/copy the whole layer if there is no selection
- always paste layers as new layers, not floating selections
- always paste news layers on top of the active layer, where
  we would attach a floating selection
- add enum GimpPasteType { FLOATING, FLOATING_INTO, NEW_LAYER }
- add GimpPasteType parameter to gimp_edit_paste() and handle all
  three cases there because there is now a lot of common code
  involved
- change all callers accordingly, use only legacy buffer pasting
  from the PDB for now
2016-09-20 00:20:07 +02:00
Michael Natterer d85157c376 app: rename gimp->global_buffer to gimp->clipboard_buffer
Also rename the "buffer-changed" signal and the setter, and add a
getter.
2016-09-17 17:39:54 +02:00
Michael Natterer 9188f549e8 app, pdb: remove useless include of "core/gimpunit.h" 2016-09-12 23:46:21 +02:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 2ef8719cbe app: rename more stuff from "floating sel" to "floating selection" 2016-05-20 16:46:26 +02:00
Ell 2f96950eaa pdb: Modify gimp-selection-border to use BORDER_STYLE_SMOOTH
instead of BORDER_STYLE_FEATHERD.

Changes the behavior of the function, but probably for the better.

This, and the previous 5 commits, fix bug 764614.
2016-05-08 19:23:48 +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
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 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 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
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
Sven Claussner 0fa6c7f121 flood: improve PDB description completely
Improve PDB description in generator template and all generated files.
2016-04-16 06:19:36 +00:00
Sven Claussner 9272da1a21 Flood op: improve descriptions
Add more user friendly description to the PDB op.
Partially keep the technical description for the PDB op and add a
reference to the developer wiki.
Use the new "reference" key for the GEGL op.
2016-04-08 08:52:12 +00:00
Elle Stone 96d8397114 Bug 763996 - Where appropriate, change "gamma correction" to "gamma adjustment"
Gamma correction refers to correcting how an image is displayed on
various devices. Gamma adjustment is a more general phrase that also
applies to adjusting gamma as a step in image enhancement in a
color-managed workflow.
2016-03-28 14:57:24 +02:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Michael Natterer c09a724bda app: change parameters of gimp_fill_options_new()
to be the same as of gimp_stroke_options_new() because it's about to
be needed for the same purposes.
2016-03-15 20:10:16 +01:00
Michael Natterer 3b6ab62c1e app: remove boolean return value from gimp_edit_clear() and gimp_edit_fill() 2016-03-11 22:41:25 +01:00
Michael Natterer d71f53dfe9 app: change gimp_drawable_bucket_fill() to use GimpFillOptions
and get rid of gimp_drawable_bucket_fill_internal().
2016-03-11 22:05:33 +01:00
Michael Natterer e1e77f88fa app: change gimp_edit_fill() to take a GimpFillOptions
instead of a long list of parameters. Get rid of gimp_edit_fill_full().
2016-03-11 19:55:50 +01:00
Michael Natterer 05b619cb8c pdb: also fix gimp-edit-bucket-fill-full, see below 2016-03-08 02:26:20 +01:00
Michael Natterer ad2c01f8d8 app: move gimp_drawable_fill() to gimpdrawable-fill.[ch]
and get rid of gimp_drawable_fill_full().
2016-03-08 01:44:35 +01:00
Michael Natterer 8d3c6a4f38 pdb: fix gimp-edit-bucket-fill when there is a selection
use the passed opacity and paint mode instead of hardcoding OPAQUE and
NORMAL.
2016-03-08 01:17:35 +01:00
Michael Natterer e5b6806fe2 app: port tons of files to the new GIMP_CONFIG_PROP_FOO() macros
and remove lots of labels from calls to gimp_prop_foo_new(). Also
had to manually remove some unwanted labels that are now added
automatically, fixes bug #761880.
2016-02-11 23:46:24 +01:00
Jehan 76f573c981 Bug 648776 - mirror symmetries.
You can now set any paint tool to mirror painting relatively
horizontal/vertical axis or a central point (any combination of these 3
symmetries).
This has been implemented as a new multi-stroke core, where every stroke
is actually handled as a multi-stroke (default of size 1).
This is also the first usage of custom guides for symmetry guiding.
Current version has to be activated in the playground.
2016-02-02 21:15:13 +01:00
Ell b52da8a17e pdb: Add gimp-selection-flood 2016-01-25 23:01:53 +01:00
Michael Natterer cd47aac435 app: remove GimpThresholdConfig
The new more general GimpImageMapTool code handles this case
completely automatically now.
2016-01-22 22:37:23 +01:00
Michael Natterer 37dd1778ad pdb: clean up the channel mixel PDB compat proc
Fix indentation, remove unneeded casts.
2016-01-18 02:14:49 +01:00
Michael Natterer 7c0d7c6311 app: add new virtual function GimpProcedure::get_help_id()
Implement the new function in GimpPlugInProcedure and remove
gimp_plug_in_procedure_get_help_id().
2016-01-17 17:15:27 +01:00
Ell 7b89fe6536 pdb: Use the diagonal-neighbors setting from GimpPDBContext...
...in gimp-image-select-contiguous-color()

This and the last 5 commits fix bug 760481.
2016-01-17 00:46:54 +01:00
Ell 7b3e5ba1e9 pdb: Add "diagonal-neighbors" as GimpPDBContext property
and add PDB API to get/set it.
2016-01-17 00:46:54 +01:00
Ell e0b1aa1c26 app: Add diagonal_neighbors parameter to gimp_channel_select_fuzzy()
and propagate it to gimp_pickable_contiguous_region_by_seed(), in
preperation for adding a diagonal-neighbors setting to PDB.
2016-01-17 00:46:54 +01:00
Ell 350c7ca338 app: Add "Diagonal neighbors" option to the bucket fill tool
When checked, diagonally neighboring pixels are considered connected
when calculating the affected area.

This commit also adds a corresponding diagonal_neighbors parameter to
gimp_drawable_bucket_fill(), and modifies the callers, other than the
bucket fill tool, to pass FALSE for this parameter, to retain the
current behavior.
2016-01-17 00:46:54 +01:00
Michael Natterer 149d3f441f app: turn the desaturate tool into a normal GEGL filter 2016-01-16 22:38:12 +01:00
Michael Natterer 7b009c6900 app: turn the posterize tool into an ordinary GEGL filter
which means replacing the whole thing by a few lines.
2016-01-16 21:41:00 +01:00
Alexandre Prokoudine ba39a5a523 Update plug-ins compatibility list 2016-01-16 00:44:02 +03:00
Michael Natterer db9ba0c8f6 Bug 760212 - method edit-stroke fails in version 2.9
Need to keep GimpPDBContext's stroke options (which is a context too)
in sync with the PDB context itself, so setting any of the context's
properties properly affects subsquent strokes, and also avoids running
into inconsistent states like happened in this bug.
2016-01-10 19:31:14 +01:00
Michael Natterer 26d1b93e0c app: also copy the parent PDB context's stroke options
so a push() will take over the current settings.
2016-01-10 19:01:26 +01:00
Michael Natterer d7bf9de526 Bug 759104 - Allow coordinates of sample points to be accessed from scripts
Add PDB sample point API similar to how the guide API works. Add core
API similar to the core guide API to make guide and sample point APIs
as similar as possible.
2016-01-04 21:24:44 +01:00
Michael Natterer 5455b8bfd0 app: move some stuff out of app/file/
file-procedure.[ch] is gone and its functions moved to
GimpPlugInManager where they belong (the manager keeps around the
lists of load, save and export procedures).

Utility functions from file-utils.[ch] that have nothing to do with
image files moved to core/gimp-utils.[ch].
2016-01-03 23:38:08 +01:00
Michael Natterer 80f713c9b8 pdb, libgimp: add gimp_context_set/get_mypaint_brush() 2016-01-02 13:40:38 +01:00
Michael Natterer 926dd1dffb app: add GimpProcedure::get_sensntive()
to replace gimp_plug_in_procedure_get_seisitive().
2016-01-01 23:24:53 +01:00
Michael Natterer 78f5dbeac3 app: add GimpProcedure::get_menu_label()
which returns a procedure's *menu* label (not stripped of mnemonics
and ellipses). Use it to further reduce dependencies on
GimpPlugInProcedure.
2016-01-01 22:41:42 +01:00
Michael Natterer 1d3bf65934 app: turn get_label() and get_blurb() into virtual functions of GimpProcedure 2016-01-01 20:52:45 +01:00
Michael Natterer d5255dc133 app: derive GimpProcedure from GimpViewable
and remove redundant icon managing code from GimpPlugInProcedure
2016-01-01 20:05:32 +01:00
Michael Natterer 51520278cd app, pdb: s/GRAY/grayscale/ in user-visible strings 2015-12-26 01:14:43 +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 0ff7d3ba14 libgimp, PDB: add gimp_get_icon_theme_dir() 2015-12-09 23:22:05 +01:00
Michael Natterer 16a0421894 plug-ins, pdb: remove the blur-gauss-selective plug-in, add a PDB compat proc 2015-11-29 22:01:53 +01:00
Michael Natterer b3239f58df Bug 758597 - gimp-drawable-get-pixel fails, assertion error in BABL
The code that actually allocates the returned pixel got lost when
porting this to GEGL.
2015-11-25 00:00:44 +01:00
Michael Natterer 7d1a47a554 Bug 314379 - Allow stroking as outline (not with a paint tool) via the PDB
Add PDB API to configure/query all aspects of line stroking.
2015-11-11 00:47:31 +01:00
Michael Natterer dac5493132 app: implement GimpConfig::reset() in GimpPDBContext
and reset its paint and stroke options.
2015-11-09 03:20:45 +01:00
Michael Natterer 8fa7bc3622 Bug 314379 - Allow stroking as outline (not with a paint tool) via the PDB
Add new PDB procedures gimp-context-get/set-stroke-method and honor
the new setting in gimp-edit-stroke and gimp-edit-stroke-vectors.

Internally, keep a GimpStrokeOptions around in GimpPDBContext to keep
track of the newly added PDB state, and use it for the stroke
operations instead of creating a scratch GimpStrokeOptions.
2015-11-09 01:46:07 +01:00
Michael Natterer e3ea383580 app, libgimpbase: move enum GimpStrokeMethod to libgimpbase
and rename its values.
2015-11-08 22:48:48 +01:00
Jehan 2e40768ea5 pdb: update documentation for brush-related functions.
Blurbs use third person and need a final point.
Some description were wrong or inaccurate. Add also units where
needed (radius in pixels, angle in degrees).
Some returned values have to be freed.
2015-11-02 17:19:56 +01:00
Michael Natterer 0bc3a82c77 Bug 755703 - new gaussian blur: default Abyss policy to Clamp
Fix operation name in last commit.
2015-09-28 17:40:47 +02:00
Michael Natterer 1aeeada2d8 Bug 755703 - new gaussian blur: default Abyss policy to Clamp
Default to CLAMP in the PDB compat wrappers that replace the old
plug-ins.
2015-09-28 17:27:29 +02:00
Michael Natterer 22fc50c279 app: rename all values of enum GimpContextPropMask
from GIMP_CONTEXT_FOO_MASK to GIMP_CONTEXT_PROP_MASK_FOO.
Also rename the FIRST and LAST values of enum GimpContextPropType.
2015-09-08 21:18:49 +02:00
Michael Natterer a4a0ec9598 plug-ins, pdb: remove the maze plug-in and add a PDB compat proc 2015-09-04 00:34:38 +02:00
Michael Natterer b45d31072b app, libgimpcolor: refactor GimpColorManaged::get_color_profile()
to not return a reference that has to be dropped. Also allow NULL to
be returned if the managed cannot have a profile. If it can have one,
get_color_profile() still always returns a profile (either the
assigned one, or a generated built-in one).
2015-09-03 01:36:02 +02:00
Michael Natterer e83d5e7090 plug-ins, pdb: remove the lcms plug-in and add PDB compat procedures 2015-08-27 22:06:25 +02:00
Michael Natterer 8c80ee14ff Bug 748749 - picked colors don't match image colors...
...when a color profile is active

This commit doesn't fix anything, but it prepares the code to do the
right thing:

It passes the actual raw image pixels through the entire color picking
mechanism to the widgets which display colors, particularly
GimpColorFrame.

This is needed for GimpColorFrame's "Pixel" mode (as opposed to its
RGB, HSV etc. modes) which is supposed to show the raw pixel values
from the image.

Before this commit, it was recreating the raw pixel values from the
GimpRGB value it knows, which will become impossible when we correctly
pick color managed GimpRGB values soon.
2015-08-25 00:05:59 +02:00
Michael Natterer 1715e1e60b app: keep GimpImage's profile around as GimpColorProfile
not only as parasite. This way we avoid having to create the profile
in each call to gimp_image_get_color_profile(). Also keep the built-in
profiles around in gimp_image_get_builtin_color_profile(). Add/remove
refs and unrefs as needed in all users of these functions.
2015-08-16 19:38:11 +02:00
Michael Natterer e8a5f285a7 app: change GimpBuffer to keep around an actual GimpColorProfile
not an icc_data blob. This simplifies the code using GimpBuffers
together with color profiles.
2015-08-16 13:14:56 +02:00
Michael Natterer fa5d28aad3 plug-ins, pdb: remove "set" and "set-rgb" from the lcms plug-in
and add PDB compat procedures.
2015-08-05 01:03:33 +02:00
Michael Natterer 1ca3812396 app: rename gimpimage-profile.[ch] to gimpimage-color-profile.[ch] 2015-08-02 22:18:43 +02:00
Michael Natterer 96749a440e pdb, libgimp: add gimp_image_convert_color_profile_from_file() 2015-07-28 23:11:54 +02:00
Michael Natterer b0735c9448 pdb, libgimp: add gimp_image_set_color_profile_from_file()
which sets the profile from a file containing an ICC profile.
2015-07-28 23:01:18 +02:00
Michael Natterer ccd2264a4c pdb: reorder procedures in image_color_profile.pdb 2015-07-27 23:45:25 +02:00
Michael Natterer 597a438f07 app: remove gimp_image_set_filename()
- gimp-image-set-filename PDB wrapper: implement the same there in
  a few lines
- xcf-load.c: use gimp_image_set_file() instead, and get rid of the
  last use of filename in xcf/ in favor of GFile
2015-07-13 22:43:22 +02:00
Michael Natterer 0693298d63 libgimpcolor, *: change all GimpColorConfig getters to return const gchar*
instead of a gchar* which has to be freed. Cache all the strings in
the GimpColorConfig instance.
2015-07-12 14:10:18 +02:00
Michael Natterer c102dde92b libgimpcolor, *: change GimpColorProfile to be a GObject
it used to be a typedef to gpointer and actually was a cmsHPROFILE.

Change its API to be more "standard", remove the public close()
function. The object caches both the cmsHPROFILE and the data/length
ICC blob, so conversions between the two become obsolete (simply call
get_lcms_profile() or get_icc_profile()).

Adapt everything to the new API, but port it in a naive way for now,
the code doesn't take advantage of the new possibilities yet (like
refcounting).
2015-07-10 22:53:59 +02:00
Michael Natterer d6c578c567 app: change gimp_image_crop() to use x, y, width, height 2015-07-03 19:38:08 +02:00
Michael Natterer e90e90265b app: port everything from gimp_channel_bounds() to gimp_item_bounds()
except gimpchannel.c itself.
2015-07-03 19:38:08 +02:00
Michael Natterer 4552319336 pdb: fix plug-in-autocrop compat wrapper to work like in 2.8
even if it's weird, compat is compat...
2015-07-03 17:59:08 +02:00
Thomas Manni 82223783a3 plug-ins, pdb: remove the bump-map plug-in and add 2 PDB compat procs 2015-06-30 12:02:48 +02:00
Thomas Manni 3436ae4674 plug-ins, pdb: remove the displace plug-in and add 2 PDB compat procs 2015-06-30 10:02:28 +02:00
Michael Natterer 3c706d00c6 Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers

Fix for translating layers from the PDB, and with the cursor keys
for gimpeditselectiontool. Moving layers with the mouse is still broken.

The approach is exactly the same as in 25a696c7.
2015-06-26 12:00:45 +02:00
Michael Natterer 09cd5f6720 app: add ICC data/length parameters to gimp_layer_new_from_gegl_buffer()
and pass them where we know the buffer could be from another image.
Pass "NULL, 0" if we know it's the same image.

Add gimp_layer_new_convert_profile() which takes the newly created
layer and the ICC data/length; call it from both
gimp_layer_new_from_gegl_buffer() and gimp_layer_new_from_pixbuf().

gimp_layer_new_convert_profile() is empty, this is just
infrastructure.
2015-06-20 00:39:44 +02:00
Michael Natterer 6446c007cf app: rename gimp_layer_new_from_buffer() to gimp_layer_new_from_gegl_buffer()
and add new function gimp_layer_new_from_buffer() which takes a
GimpBuffer. This will make sense soon :)
2015-06-20 00:02:11 +02:00
Michael Natterer db09d0f3d3 app: move functions to create layers to new files gimplayer-new.[ch] 2015-06-17 13:21:01 +02:00
Michael Natterer bf10da29fa app: remove GError** argument from gimp_image_get_color_profile()
we validate everything when setting it, so this function always
returns either a valid profile, or NULL.
2015-06-17 00:45:43 +02:00
Thomas Manni 769bc933d4 plug-ins, pdb: remove the wind plug-in and add a PDB compat proc 2015-06-11 11:31:36 +02:00
Michael Natterer c632ffad18 pdb, app, libgimp: add gimp_image_convert_color_profile() PDB wrapper
This commit is more complex than a usual PDB procedure because it
needs to make the enums from libgimpconfig/gimpcolorconfig-enums.h
known to the PDB.
2015-06-10 01:38:20 +02:00
Michael Natterer d1102d2be9 pdb, plug-ins: remove two procedures from lcms.c and add PDB compat procs
The lcms plug-in is on its way out: add compat procedures implementing
plug-in-icc-profile-info and plug-in-icc-profile-file-info and remove
that code from lcms.c.
2015-06-07 12:52:37 +02:00
Michael Natterer 16749cd395 pdb, app, libgimp: add gimp_image_get_effective_color_profile()
which returns the profile that is actually used for the image. And
some cleanup and fixes in image_color_profile.pdb.
2015-06-07 01:38:50 +02:00
Michael Natterer 80093a85df pdb, app, libgimp: add new PDB group image_color_profile
Which will have proper API to deal with an image's color profile (no
parasites, no ICC blobs). So far contains gimp_image_get_color_profile()
and gimp_image_set_color_profile().
2015-06-05 12:51:46 +02:00
Adrian Likins e708f41970 Bug 750377 - typo in plug-in-compat-cmds for edge invoker "algorihm"
Scripts calling plug-in-edge would cause the error:

g_object_new_valist: object class 'GeglOpedge_c' has
no property named 'algorihm'
2015-06-04 00:08:06 -04:00
Michael Natterer 4ef3c918a0 pdb, app, libgimp: move the image transform procedures to their own PDB group
because image.pdb is way too large.
2015-05-30 23:55:58 +02:00
Michael Natterer b9773efa5e pdb, app, libgimp: rename the "guides" PDB group to "imageguides"
This only renames files, no code changes.
2015-05-30 15:27:16 +02:00
Michael Natterer 3b70fb8d3a pdb, app, libgimp: rename the "grid" PDB group to "imagegrid"
This only renames files, no code changes.
2015-05-30 15:19:11 +02:00
Michael Natterer b34ed029ac pdb, app, libgimp: rename the "convert" PDB group to "imageconvert"
This only renames files, no code changes.
2015-05-30 15:09:57 +02:00
Michael Natterer f269651cc6 pdb, app, libgimp: rename the "undo" PDB group to "imageundo"
This only renames files, no code changes.
2015-05-30 15:01:50 +02:00
Michael Natterer e6703aa6b8 plug-ins, pdb: remove the papertile plug-in and add a PDB compat proc 2015-04-30 17:18:01 -04: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 Natterer 573f0f69bb plug-ins, pdb: remove the edge plug-in and add a PDB compat procedure 2015-03-03 23:18:53 +01:00
Michael Natterer b856a8ba76 plug-ins, pdb: remove the value-propagate plug-in and add PDB compat procedures 2015-02-08 23:09:06 +01:00
Michael Natterer 9be37aaa91 plug-ins, pdb: remove the diffraction plug-in and add a PDB compat procedure 2015-01-21 22:51:49 +01:00
Michael Natterer b87d97ae68 plug-ins, pdb: remove the lens-flare plug-in and add a PDB compat procedure 2015-01-08 23:39:03 +01:00
Michael Natterer 4d5e42ac1a plug-ins, pdb: remove the engrave plug-in and add a PDB compat procedure 2014-12-15 23:54:35 +01:00
Alexia Death 6f582ba527 pdb: make channel-mixer compat function use mono-mixer for monochrome mode
This is preparation of removing monochrome mode from the channel
mixer op, as there is already mono mixer doing the exact same thing
2014-12-11 00:30:23 +02:00
Michael Natterer 221db7ac94 Revert "pdb: make channel mixer compat function use mono-mixer for monochrome case"
This reverts commit fc8a2185a5 because
it only changed the generated file.
2014-12-10 19:29:46 +01:00
Alexia Death fc8a2185a5 pdb: make channel mixer compat function use mono-mixer for monochrome case 2014-12-10 19:43:11 +02:00
Michael Natterer 7313cb559e plug-ins, pdb: remove the illusion plug-in and add a PDB compat procedure 2014-12-04 20:42:15 +01:00
Michael Natterer 212b44cf2f plug-ins, pdb: remove the Solid Noise plug-in and add a PDB compat procedure 2014-11-22 21:04:31 +01:00
Michael Natterer b49e8098d4 plug-ins, pdb: remove the sinus plug-in and add a PDB compat procedure 2014-11-21 22:11:15 +01:00
Michael Natterer b94ba871ac plug-ins, pdb: remove the nova plug-in and add a PDB compat procedure 2014-11-18 21:05:32 +01:00
Michael Natterer a101ed2aef app, pdb: change range of brush-spacing to 0.01..5.0
And only use percent in the GUI.
2014-11-17 23:56:16 +01:00
Michael Natterer b4f721cdfb pdb: set value ranges on PDB brush parameters/return values
Also fix a few glitches and spelling.
2014-11-17 23:18:22 +01:00
Alexia Death 6247d8978f pdb: missed generated file 2014-11-17 22:25:59 +02:00
Alexia Death 60cf10f581 pdb: add pdb calls for hardness and force 2014-11-17 15:29:45 +02:00
Michael Natterer e78540e581 plug-ins, pdb: remove the video plug-in and add a PDB compat procedure 2014-11-16 22:08:51 +01:00
Alexia Death 6f4fb84645 pdb: pdb definitions for spacing in tool options 2014-11-13 14:49:12 +02:00
Michael Natterer effeefb84a plug-ins, pdb: remove the color-exchange plug-in
and add a PDB compat procedure.
2014-11-10 22:40:58 +01:00
Michael Natterer e47ded9420 pdb: fix gimp-file-open and gimp-file-save for GIO-ported file procedures
Pass URIs instead of filenames to the procedures if they are ported to GIO.
2014-10-18 01:14:58 +02:00
Michael Natterer 5d8824f42e app: move all GimpBrush members to a private struct
Add and use accessors for width, height, x_axis and y_axis.
2014-10-12 01:16:32 +02:00
Michael Natterer e4171c5bff plug-ins, PDB: remove edge-sobel and add a PDB compat procedure 2014-10-11 19:41:49 +02:00
Michael Natterer 14978bfe5d Simplify calls to g_output_stream_write_all()
It returns TRUE only if all bytes were written, so there is no need to
get and check the bytes_written return value.
2014-09-07 20:30:14 +02:00
Michael Natterer bda1cd049d Bug 735516 - Crop to content fails
Return a new enum GimpAutoShrink { SHRINK, EMPTY, UNSHRINKABLE } from
gimp_pickable_auto_shrink() because a simply boolean FALSE doesn't
distinguish between "not further shrinkable" and "no content". Change
the callers accordingly add a special "already cropped" message where
we only had a "no content" message before.
2014-08-31 17:41:54 +02:00
Michael Natterer 1326cc5562 pdb: fix uninitialized variable warning in the convmatrix compat wrapper 2014-08-29 21:37:17 +02:00
Mikael Magnusson 541de6ed9c plug-ins, pdb: Add missing break statements to switch 2014-08-16 02:25:49 +02:00
Michael Natterer 980ba7f85a app: move memsize functions into their own files gimp-memsize.[ch] 2014-08-12 13:57:57 +02:00
Michael Natterer 14c39816d8 app: keep the theme directories around a GFiles
and change gimp_get_theme_dir() to return a GFile.
2014-07-20 17:09:25 +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 a4b807905c app: change gimp_get_temp_filename() to gimp_get_temp_file() 2014-07-10 22:32:09 +02:00
Michael Natterer c1f7ec52a8 app: add gimp_pdb_image_get_guide() and use it in the guide PDB wrappers
It returns a proper error message if a guide ID doesn't exist.
2014-07-10 20:24:10 +02:00
Michael Natterer c3573c3c45 app: keep the plug-in executable path around as GFile 2014-07-08 21:09:35 +02:00
Michael Natterer c884c4f630 app: change file_utils_filename_to_uri() to file_utils_filename_to_file() 2014-07-08 10:25:25 +02:00
Michael Natterer d0a6d95dad app: remove a bunch of file-utils.h includes 2014-07-08 00:23:34 +02:00
Michael Natterer ff6ea69569 app: change the image's various URIs to GFiles
which gets rid of a lot of temporarily added GFile code again because
we don't need to convert between URI and GFile any longer.
2014-07-07 23:58:11 +02:00