2007-12-29 08:57:51 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2007-12-29 09:35:04 +08:00
|
|
|
* gimp-gegl.c
|
2007-12-29 08:57:51 +08:00
|
|
|
* Copyright (C) 2007 Øyvind Kolås <pippin@gimp.org>
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2007-12-29 08:57:51 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2007-12-29 08:57:51 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2007-12-29 08:57:51 +08:00
|
|
|
*/
|
|
|
|
|
2007-12-29 09:35:04 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2014-07-05 18:51:54 +08:00
|
|
|
#include <gio/gio.h>
|
2008-01-16 23:52:02 +08:00
|
|
|
#include <gegl.h>
|
2007-12-29 09:35:04 +08:00
|
|
|
|
2009-02-21 23:06:49 +08:00
|
|
|
#include "gimp-gegl-types.h"
|
2007-12-29 23:25:40 +08:00
|
|
|
|
2012-05-15 04:57:58 +08:00
|
|
|
#include "config/gimpgeglconfig.h"
|
2008-11-16 18:30:49 +08:00
|
|
|
|
2012-05-11 03:22:44 +08:00
|
|
|
#include "operations/gimp-operations.h"
|
|
|
|
|
2008-11-16 18:30:49 +08:00
|
|
|
#include "core/gimp.h"
|
|
|
|
|
2012-04-22 05:46:41 +08:00
|
|
|
#include "gimp-babl.h"
|
2007-12-29 09:35:04 +08:00
|
|
|
#include "gimp-gegl.h"
|
2012-03-17 23:22:59 +08:00
|
|
|
|
2007-12-29 08:57:51 +08:00
|
|
|
|
2012-05-15 04:57:58 +08:00
|
|
|
static void gimp_gegl_notify_tile_cache_size (GimpGeglConfig *config);
|
2012-05-19 14:50:05 +08:00
|
|
|
static void gimp_gegl_notify_num_processors (GimpGeglConfig *config);
|
2013-06-02 05:02:42 +08:00
|
|
|
static void gimp_gegl_notify_use_opencl (GimpGeglConfig *config);
|
2008-11-16 18:30:49 +08:00
|
|
|
|
|
|
|
|
2007-12-29 09:35:04 +08:00
|
|
|
void
|
2008-11-16 18:30:49 +08:00
|
|
|
gimp_gegl_init (Gimp *gimp)
|
2007-12-29 08:57:51 +08:00
|
|
|
{
|
2012-05-15 04:57:58 +08:00
|
|
|
GimpGeglConfig *config;
|
2008-11-16 18:30:49 +08:00
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
2012-05-15 04:57:58 +08:00
|
|
|
config = GIMP_GEGL_CONFIG (gimp->config);
|
2008-11-16 18:30:49 +08:00
|
|
|
|
2012-05-21 01:35:04 +08:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#warning not setting GeglConfig:threads
|
2012-05-15 08:29:47 +08:00
|
|
|
#endif
|
|
|
|
|
2013-06-06 06:03:26 +08:00
|
|
|
g_object_set (gegl_config (),
|
|
|
|
"tile-cache-size", (guint64) config->tile_cache_size,
|
2012-05-21 01:35:04 +08:00
|
|
|
#if 0
|
2013-06-06 06:03:26 +08:00
|
|
|
"threads", config->num_processors,
|
2012-05-21 01:35:04 +08:00
|
|
|
#endif
|
2013-06-06 06:03:26 +08:00
|
|
|
"use-opencl", config->use_opencl,
|
|
|
|
NULL);
|
2008-06-04 20:49:18 +08:00
|
|
|
|
2008-11-16 18:30:49 +08:00
|
|
|
g_signal_connect (config, "notify::tile-cache-size",
|
|
|
|
G_CALLBACK (gimp_gegl_notify_tile_cache_size),
|
|
|
|
NULL);
|
2012-05-19 14:50:05 +08:00
|
|
|
g_signal_connect (config, "notify::num-processors",
|
|
|
|
G_CALLBACK (gimp_gegl_notify_num_processors),
|
|
|
|
NULL);
|
2013-06-02 05:02:42 +08:00
|
|
|
g_signal_connect (config, "notify::use-opencl",
|
|
|
|
G_CALLBACK (gimp_gegl_notify_use_opencl),
|
|
|
|
NULL);
|
2008-11-16 18:30:49 +08:00
|
|
|
|
2012-04-22 05:46:41 +08:00
|
|
|
gimp_babl_init ();
|
2012-04-21 22:05:49 +08:00
|
|
|
|
2012-06-07 01:23:55 +08:00
|
|
|
gimp_operations_init ();
|
2007-12-29 08:57:51 +08:00
|
|
|
}
|
2008-11-16 18:30:49 +08:00
|
|
|
|
|
|
|
static void
|
2012-05-15 04:57:58 +08:00
|
|
|
gimp_gegl_notify_tile_cache_size (GimpGeglConfig *config)
|
2008-11-16 18:30:49 +08:00
|
|
|
{
|
2013-06-06 06:03:26 +08:00
|
|
|
g_object_set (gegl_config (),
|
|
|
|
"tile-cache-size", (guint64) config->tile_cache_size,
|
|
|
|
NULL);
|
2008-11-16 18:30:49 +08:00
|
|
|
}
|
2012-05-19 14:50:05 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_gegl_notify_num_processors (GimpGeglConfig *config)
|
|
|
|
{
|
2012-05-21 01:35:04 +08:00
|
|
|
#if 0
|
2012-05-19 14:50:05 +08:00
|
|
|
g_object_set (gegl_config (),
|
|
|
|
"threads", config->num_processors,
|
|
|
|
NULL);
|
2012-05-21 01:35:04 +08:00
|
|
|
#endif
|
2012-05-19 14:50:05 +08:00
|
|
|
}
|
2013-06-02 05:02:42 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_gegl_notify_use_opencl (GimpGeglConfig *config)
|
|
|
|
{
|
|
|
|
g_object_set (gegl_config (),
|
|
|
|
"use-opencl", config->use_opencl,
|
|
|
|
NULL);
|
|
|
|
}
|