Commit Graph

74 Commits

Author SHA1 Message Date
a29f73bd9a Issue #2224 - Use the "Swap folder" setting for the GEGL cache
Move swap/cache and temporary files out the GIMP user config dir:

libgimpbase: add gimp_cache_directory() and gimp_temp_directory()
which return the new default values inside XDG_CACHE_HOME and the
system temp directory. Like all directories from gimpenv.[ch] the
values can be overridden by environment variables. Improve API docs
for all functions returning directories.

Add new config file substitutions ${gimp_cache_dir} and
${gimp_temp_dir}.

Document all the new stuff in the gimp and gimprc manpages.

app: default "swap-path" and "temp-path" to the new config file
substitutions. On startup and config changes, make sure that the swap
and temp directories actually exist.

In the preferences dialog, add reset buttons to all file path pages.
2018-11-18 18:10:34 +01:00
Ell
432a884715 app: flush async-operations queue when setting async thread count to 0
In gimp-parallel, always flush the async-operations queue (by
executing all remaining operations on the caller thread) when
setting the async-pool thread count to 0 (as happens when setting
GEGL_THREADS=1, per the previous commit,) and not only when
shutting GIMP down.  Otherwise, pending asynchronous operations
can "get lost" when setting GEGL_THREADS to 1.

Additionally, in gimp_gegl_init(), initialize gimp-parallel before
before connecting to GimpGeglConfig's "notify::num-processors"
signal, so that the number of async threads is set *before*
GEGL_THREADS, in order to avoid setting GEGL_THREADS to 1 while
async operations are still executing.

Also, allow setting the number of gimp-parallel-distribute threads
while a gimp-parallel-distribute function is running (which can
happen if gimp-parallel-distribute is used in an async operation,
as is the case for histogram calculation), by waiting for the
parallel-distribute function to finish before setting the number of
threads.
2018-07-15 05:07:20 -04:00
5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell
86b89cf62a app: add gimp-parallel
Add gimp-parallel.[cc,h], which provides a set of parallel
algorithms.

These currently include:

  - gimp_parallel_distribute():  Calls a callback function in
    parallel on multiple threads, passing it the current thread
    index, and the total number of threads.  Allows specifying the
    maximal number of threads used.

  - gimp_parallel_distribute_range():  Splits a range of integers
    between multiple threads, passing the sub-range to a callback
    function.  Allows specifying the minimal sub-range size.

  - gimp_parallel_distribute_area():  Splits a rectangular area
    between multiple threads, passing the sub-area to a callback
    function.  Allows specifying the minimal sub-area.

The callback function is passed using an appropriately-typed
function pointer, and a user-data pointer.  Additionally, when used
in a C++ file, each of the above functions has an overloaded
template version, taking the callback through a generic parameter,
without a user-data pointer, which allows using function objects.
2018-04-04 17:49:46 -04:00
415f869f20 app: drop workaround for bug #785521
We now hard depend on a fresher release of GEGL that already has this fix in
it.
2017-09-09 23:54:53 +02:00
bac042db39 app/gegl: temp hotfix to disable threading in gegl:copy-buffer 2017-08-19 17:12:15 +02:00
1f5739de57 app: set the number of threads on GeglConfig again, it needs testing
- enable the setting code in gimp-gegl.c again
- but set the default to one thread in GimpGeglConfig, with a CPP warning
- rename "processors" to "threads" in the GUI
- add a warning box about unexpected results when increasing #threads
2017-06-28 19:05:58 +02:00
ee6c7ec7b7 Bug 780015 - Filter settings are not properly restored after Gimp restart
Filters settings used to be serialized and deserialized only
when a filter tool's GUI was shown, too late for the code that
re-runs/re-shows filters with previous values.

Move the entire loading/saving code to gimp-operation-config.c, even
adding/removing the dummy separator item between timestamped automatic
history and manually saved settings. Load the settings automatically
when a settings container is requested, but still trigger saving from
the few places the container is changed in the GUI; could also
automate that later.

This commit also moves all settings of filters that have their own
tools from gimpdir/tool-options/ to gimpdir/filters/. Add compat code
to try the old filename if the new doesn't exist, so files are
migrated automatically.

WIP, but this step already fixes the bug.
2017-03-24 01:29:50 +01:00
3f52828896 app: change GimpImageFile and GimpDocumentList to speak GFile 2014-07-07 23:58:11 +02:00
71bddaa23c app: Remove deprecated "babl-tolerance" setting 2013-10-19 17:02:04 -07:00
30e1f39ba6 app: remove support for the old GeglConfig:cache-size property 2013-06-06 00:03:26 +02:00
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
52af6e3f3f app: fix the code that sets the 64bit tile cache size on GeglConfig 2012-09-18 20:07:13 +02:00
5c11326ad7 app: use GeglConfig's new 64 bit tile-cache-size property if it exists 2012-06-29 01:51:56 +02:00
373a4e7469 app: completely remove TileManager and friends (base/ and paint-funcs/)
And along with it a lot of stuff like the drawable preview cache, the
gegl tile manager backend, temporary gimp_gegl_buffer_foo() stuff, and
the remaining bits of performance.

The projection is in an evil semi-ported state which makes it work
ok-ish for stuff like layer moving, but absolutely unbearable for
painting, there is also an off-by-one rendering glitch at some zoom
levels.
2012-06-20 21:44:09 +02:00
83680825d0 app: removed unnecessary argument from gimp_operations_init 2012-06-14 21:29:43 +03:00
85a92cf800 app: don't set GeglConfig:threads, it breaks things 2012-05-20 19:35:04 +02:00
120db980dc app: connect GimpGeglConfig:num-processors to GeglConfig:threads
whatever it might be good for...
2012-05-19 08:50:05 +02:00
9d1ff75c61 app: limit the tile-cache size to G_MAXINT also in the UI
and #warning about it in the code until GEGL has a guint64 cache size
property.
2012-05-15 02:29:47 +02:00
ede421bd45 app: rename GimpBaseConfig to GimpGeglConfig
because that's its future purpose.
2012-05-14 22:57:58 +02:00
7101ee191a app: move all GEGL operations to new directory app/operations/ 2012-05-10 21:22:44 +02:00
f1a771439a Replace the semi-flatten plug-in by a GEGL operation 2012-05-04 23:56:10 +02:00
f24445efbc Replace the threshold-slpha plug-in by a GEGL operation 2012-05-04 17:59:36 +02:00
d81ea1315e app: implement active, affected components in GEGL
Add GimpOperationMaskComponents, enum GimpComponentMask, and image and
drawable infrastructure to get the right mask, and plug the mask
operation into gimp_gegl_create_apply_buffer_node().
2012-05-02 17:51:17 +02:00
e737bf77fa app: add gimp-babl.[ch] and move Babl specific code there 2012-05-02 17:51:08 +02:00
3e9fdf1815 app: change GimpBoundary to find the boundary a float component
Require passing in a Babl format that will extract the float component
the algorithm should run on.
2012-05-02 17:51:07 +02:00
3ea0e3f090 app: return double not int from GimpPickable::get_opacity_at()
and fix GimpLayer's impl to honor the mask also for layers without
alpha.
2012-05-02 17:51:07 +02:00
cadd54823b app: clean up and build the histogram op gift 2012-05-02 17:51:04 +02:00
310c1bfb71 app: add gimp_babl_get_description()
which keeps around human readable and translatable strings for Babl
formats, as replacement for the to-be-obsoleted image type etc. enum
descriptions.
2012-05-02 17:51:03 +02:00
925f49c489 app: gegl-config babl-tolerance
Lower the precision further, we're still doing it at higher precision than
8bit but since GIMP itself is still only dealing with 8bit data we can permit
these shortcuts for adding and removing gamma without affecting the fidelity
of the produced results.
2012-05-02 17:50:50 +02:00
1b64710e66 app: specify a lower tolerance for babl
Permitting the use of LUT based functions for gamma conversions in float32.
2012-05-02 17:50:49 +02:00
e540444b56 app: fix registration of babl formats 2012-05-02 17:50:38 +02:00
69cd6d033a app: fix registration of babl_format("A u8") 2012-05-02 17:50:38 +02:00
ee97c1f4ff app: correct usage of babl formats
GIMP was doing evil hacks lying to GEGL about it's pixels being in a linear
color space when they are not. This causes incorrect rendering, makes gaussian
blur misbehave etc.

The legacy projection modes should be implemented using the same 2.2 gamma
formats that are correct to specify for sRGB data. (for proper color
management in higher bitdepths; icc backend babl formats should be used.)

For the old image modes correct babl formats are:

R'G'B'A u8  -  8 bit RGB with 2.2 gamma (sRGB) with linear alpha component
R'G'B' u8   -  8 bit RGB with 2.2 gamma (sRGB)
Y'A u8      -  8 bit Grayscale with 2.2 gamma with linear alpha component
Y' u8       -  8 bit Grayscale with 2.2 gamma

Y u8        -  8 bit linear data, used for masks/channels
A u8        -  8 bit linear alpha

-----------------------------------------------

RGBA float  -     32bit floating point linear light RGB
RaGaBaA float  -  32bit floating point linear light RGB, premultiplied alpha
                  to be used for processing that needs to scale by the alpha,
                  (blurs, resampling etc)
R'G'B'A float  -  32bit floating point sRGB with gamma, to be used where
                  the result depends on being closer to perceptual when
                  processing, can be used a cheaper alternative to CIE Lab
                  based modes.

-----------------------------------------------

The legacy layer modes should use the formats with gamma 2.2 only for loading
and rendering legacy XCF files correctly, in the brave new world compositing
should most likely be done in linear light with "RGBA float" and even better
"RaGaBaA float" like GEGL does for porter duff and other compositing modes.

The ability to chose the legacy layer modes should probably be hidden from the
user unless an old .xcf has been opened.
2012-05-02 17:50:38 +02:00
865b925598 app: add GimpOperationShapeburst to calculate the distance map for blend 2012-05-02 17:50:36 +02:00
b08ba684cf app: replace border_region() by GimpOperationBorder 2012-05-02 17:46:14 +02:00
8fc7c17d39 app: replace fatten_region() by GimpOperationGrow 2012-05-02 17:46:14 +02:00
cbb2766f07 app: add GimpOperationShrink which does "shrink selection"
but it's horribly slow, so keep the old code around for now and make
the new one depend on use_gegl.
2012-05-02 17:46:13 +02:00
cf86aeceb3 app: add GimpOperationEqualize and port equalize to it 2012-05-02 17:46:13 +02:00
72cd3c0fc8 app: add our own GimpOperationNormalMode so we can opt out of premultiply 2012-05-02 17:46:12 +02:00
5b644f1037 app: add GimpOperationSetAlpha which sets the alpha channel to a value 2012-05-02 17:45:56 +02:00
5d1474c17e app: use GEGL to extract an image's component into a channel
Add gimp_image_get_component_format() for that purpose.
2012-05-02 17:45:53 +02:00
a898491b3f app: allow to "cast" a buffer's pixel format to another one
as long as it has the same number of bytes. Add
gimp_tile_manager_create_buffer_with_format() for that purpose,
register a format that contains's only a u8 alpha byte, and use that
to extract alpha from drawables.
2012-05-02 17:45:52 +02:00
ca85d2c906 app: remove GimpOperationTileSink 2012-05-02 17:45:47 +02:00
0fdf01de02 app: remove GimpOperationTileSource
GIMP has a GeglBuffer backend for it's tiles now.
2012-05-02 17:45:47 +02:00
b262c93048 app: create an own GimpOperationBrightnessContrast
and use it instead of gegl:brightness-contrast because the GEGL op is
giving different reaults.
2012-03-13 15:02:17 +01:00
220d06324d Bug 648265 - tile cache size larger than 2G causes...
limit gegl cache-size to its maximum value
otherwise modulo arithmetic causes Warnings or
small values
2011-07-26 18:44:16 +02:00
d7492cb528 app: remove forward transform preview from cage tool, reverse is actually faster 2010-10-07 00:41:40 +03:00
9b3dbf9f3e renaming of GimpOperationCage to GimpOperationCagePreview + cleaning 2010-08-12 14:34:19 +02:00
69cf476387 add a gegl op that compute the reverse transformation of a cage deform. still wip. 2010-08-08 13:27:31 +02:00