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"
|
|
|
|
|
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
|
|
|
|
2008-06-04 20:49:18 +08:00
|
|
|
#include "base/tile.h"
|
|
|
|
|
2008-11-16 18:30:49 +08:00
|
|
|
#include "config/gimpbaseconfig.h"
|
|
|
|
|
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
|
|
|
|
2008-11-16 18:30:49 +08:00
|
|
|
static void gimp_gegl_notify_tile_cache_size (GimpBaseConfig *config);
|
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2008-11-16 18:30:49 +08:00
|
|
|
GimpBaseConfig *config;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
|
|
|
|
|
|
|
config = GIMP_BASE_CONFIG (gimp->config);
|
|
|
|
|
2008-06-04 20:49:18 +08:00
|
|
|
g_object_set (gegl_config (),
|
|
|
|
"tile-width", TILE_WIDTH,
|
|
|
|
"tile-height", TILE_HEIGHT,
|
2011-07-27 00:44:16 +08:00
|
|
|
"cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
|
2008-06-04 20:49:18 +08:00
|
|
|
NULL);
|
|
|
|
|
2012-04-01 10:09:20 +08:00
|
|
|
/* turn down the precision of babl - permitting use of lookup tables for
|
|
|
|
* gamma conversions, this precision is anyways high enough for both 8bit
|
|
|
|
* and 16bit operation
|
|
|
|
*/
|
|
|
|
g_object_set (gegl_config (),
|
2012-04-01 22:04:54 +08:00
|
|
|
"babl-tolerance", 0.00015,
|
2012-04-01 10:09:20 +08:00
|
|
|
NULL);
|
|
|
|
|
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-04-22 05:46:41 +08:00
|
|
|
gimp_babl_init ();
|
2012-04-21 22:05:49 +08:00
|
|
|
|
2012-05-11 03:22:44 +08:00
|
|
|
gimp_operations_init (gimp);
|
2007-12-29 08:57:51 +08:00
|
|
|
}
|
2008-11-16 18:30:49 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_gegl_notify_tile_cache_size (GimpBaseConfig *config)
|
|
|
|
{
|
|
|
|
g_object_set (gegl_config (),
|
2011-07-27 00:44:16 +08:00
|
|
|
"cache-size", (gint) MIN (config->tile_cache_size, G_MAXINT),
|
2008-11-16 18:30:49 +08:00
|
|
|
NULL);
|
|
|
|
}
|