1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
#include "core-types.h"
25
#include "base/hue-saturation.h"
27
#include "gegl/gimphuesaturationconfig.h"
31
#include "gimpimage.h"
33
#include "gimpdrawable.h"
34
#include "gimpdrawable-hue-saturation.h"
35
#include "gimpdrawable-operation.h"
36
#include "gimpdrawable-process.h"
38
#include "gimp-intl.h"
41
/* public functions */
44
gimp_drawable_hue_saturation (GimpDrawable *drawable,
45
GimpProgress *progress,
51
GimpHueSaturationConfig *config;
53
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
54
g_return_if_fail (! gimp_drawable_is_indexed (drawable));
55
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)));
57
config = g_object_new (GIMP_TYPE_HUE_SATURATION_CONFIG,
63
"saturation", saturation / 100.0,
64
"lightness", lightness / 100.0,
67
if (gimp_use_gegl (GIMP_ITEM (drawable)->image->gimp))
71
node = g_object_new (GEGL_TYPE_NODE,
72
"operation", "gimp-hue-saturation",
78
gimp_drawable_apply_operation (drawable, progress, _("Hue-Saturation"),
80
g_object_unref (node);
86
gimp_hue_saturation_config_to_cruft (config, &cruft);
88
gimp_drawable_process (drawable, progress, _("Hue_Saturation"),
89
(PixelProcessorFunc) hue_saturation, &cruft);
92
g_object_unref (config);