2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +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
|
1997-11-25 06:05:25 +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/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2008-01-31 02:31:43 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2007-12-31 01:54:51 +08:00
|
|
|
#include <gegl.h>
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2008-01-28 01:39:01 +08:00
|
|
|
#include "libgimpconfig/gimpconfig.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2012-05-11 03:22:44 +08:00
|
|
|
#include "operations/gimphuesaturationconfig.h"
|
|
|
|
#include "operations/gimpoperationhuesaturation.h"
|
2008-01-22 17:49:40 +08:00
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
2008-11-12 18:56:06 +08:00
|
|
|
#include "core/gimperror.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "core/gimpimage.h"
|
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2013-05-29 06:04:35 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
|
|
|
#include "widgets/gimpspinscale.h"
|
2003-08-22 09:42:57 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "gimphuesaturationtool.h"
|
2004-02-22 22:28:53 +08:00
|
|
|
#include "gimpimagemapoptions.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
1998-11-23 22:47:09 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2013-05-29 06:04:35 +08:00
|
|
|
#define DA_WIDTH 40
|
|
|
|
#define DA_HEIGHT 20
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
/* local function prototypes */
|
1999-11-22 19:14:29 +08:00
|
|
|
|
2008-01-15 04:44:01 +08:00
|
|
|
static gboolean gimp_hue_saturation_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *display,
|
|
|
|
GError **error);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2008-01-31 02:31:43 +08:00
|
|
|
static GeglNode * gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool,
|
2013-04-17 04:06:48 +08:00
|
|
|
GObject **config,
|
|
|
|
gchar **undo_desc);
|
2008-01-15 04:44:01 +08:00
|
|
|
static void gimp_hue_saturation_tool_dialog (GimpImageMapTool *im_tool);
|
|
|
|
static void gimp_hue_saturation_tool_reset (GimpImageMapTool *im_tool);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2008-01-31 02:31:43 +08:00
|
|
|
static void hue_saturation_config_notify (GObject *object,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpHueSaturationTool *hs_tool);
|
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
static void hue_saturation_update_color_areas (GimpHueSaturationTool *hs_tool);
|
|
|
|
|
|
|
|
static void hue_saturation_range_callback (GtkWidget *widget,
|
|
|
|
GimpHueSaturationTool *hs_tool);
|
|
|
|
static void hue_saturation_range_reset_callback (GtkWidget *widget,
|
|
|
|
GimpHueSaturationTool *hs_tool);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2005-12-13 17:13:50 +08:00
|
|
|
|
|
|
|
G_DEFINE_TYPE (GimpHueSaturationTool, gimp_hue_saturation_tool,
|
2006-05-15 17:46:31 +08:00
|
|
|
GIMP_TYPE_IMAGE_MAP_TOOL)
|
2005-12-13 17:13:50 +08:00
|
|
|
|
|
|
|
#define parent_class gimp_hue_saturation_tool_parent_class
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
|
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_hue_saturation_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_HUE_SATURATION_TOOL,
|
2004-02-22 22:28:53 +08:00
|
|
|
GIMP_TYPE_IMAGE_MAP_OPTIONS, NULL,
|
2003-06-28 19:20:37 +08:00
|
|
|
0,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-hue-saturation-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Hue-Saturation"),
|
2006-09-19 02:00:22 +08:00
|
|
|
_("Hue-Saturation Tool: Adjust hue, saturation, and lightness"),
|
2004-04-29 21:19:28 +08:00
|
|
|
N_("Hue-_Saturation..."), NULL,
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_HUE_SATURATION,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_HUE_SATURATION,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_hue_saturation_tool_class_init (GimpHueSaturationToolClass *klass)
|
|
|
|
{
|
2005-12-13 17:13:50 +08:00
|
|
|
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
|
|
|
GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2008-05-22 19:00:50 +08:00
|
|
|
tool_class->initialize = gimp_hue_saturation_tool_initialize;
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2011-03-21 01:27:11 +08:00
|
|
|
im_tool_class->dialog_desc = _("Adjust Hue / Lightness / Saturation");
|
2008-05-22 19:00:50 +08:00
|
|
|
im_tool_class->settings_name = "hue-saturation";
|
|
|
|
im_tool_class->import_dialog_title = _("Import Hue-Saturation Settings");
|
|
|
|
im_tool_class->export_dialog_title = _("Export Hue-Saturation Settings");
|
2004-02-25 21:55:45 +08:00
|
|
|
|
2008-05-22 19:00:50 +08:00
|
|
|
im_tool_class->get_operation = gimp_hue_saturation_tool_get_operation;
|
|
|
|
im_tool_class->dialog = gimp_hue_saturation_tool_dialog;
|
|
|
|
im_tool_class->reset = gimp_hue_saturation_tool_reset;
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_hue_saturation_tool_init (GimpHueSaturationTool *hs_tool)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static gboolean
|
2006-09-27 04:55:40 +08:00
|
|
|
gimp_hue_saturation_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *display,
|
|
|
|
GError **error)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2013-04-17 05:28:02 +08:00
|
|
|
GimpImage *image = gimp_display_get_image (display);
|
|
|
|
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-13 19:23:01 +08:00
|
|
|
if (! drawable)
|
2004-01-22 00:07:48 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-11-13 19:23:01 +08:00
|
|
|
if (! gimp_drawable_is_rgb (drawable))
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-11-12 18:56:06 +08:00
|
|
|
g_set_error_literal (error, GIMP_ERROR, GIMP_FAILED,
|
2008-11-04 20:33:09 +08:00
|
|
|
_("Hue-Saturation operates only on RGB color layers."));
|
2004-01-22 00:07:48 +08:00
|
|
|
return FALSE;
|
2002-08-26 19:35:56 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2009-08-20 23:05:23 +08:00
|
|
|
return GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
|
2002-08-26 19:35:56 +08:00
|
|
|
}
|
2001-07-08 01:36:00 +08:00
|
|
|
|
2008-01-15 04:44:01 +08:00
|
|
|
static GeglNode *
|
2008-01-31 02:31:43 +08:00
|
|
|
gimp_hue_saturation_tool_get_operation (GimpImageMapTool *im_tool,
|
2013-04-17 04:06:48 +08:00
|
|
|
GObject **config,
|
|
|
|
gchar **undo_desc)
|
2008-01-15 04:44:01 +08:00
|
|
|
{
|
2008-01-22 17:49:40 +08:00
|
|
|
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (im_tool);
|
|
|
|
|
|
|
|
hs_tool->config = g_object_new (GIMP_TYPE_HUE_SATURATION_CONFIG, NULL);
|
|
|
|
|
2008-01-31 02:31:43 +08:00
|
|
|
g_signal_connect_object (hs_tool->config, "notify",
|
|
|
|
G_CALLBACK (hue_saturation_config_notify),
|
|
|
|
G_OBJECT (hs_tool), 0);
|
|
|
|
|
2013-04-17 04:06:48 +08:00
|
|
|
*config = G_OBJECT (hs_tool->config);
|
2008-01-22 17:49:40 +08:00
|
|
|
|
2013-04-17 04:06:48 +08:00
|
|
|
return gegl_node_new_child (NULL,
|
|
|
|
"operation", "gimp:hue-saturation",
|
|
|
|
"config", hs_tool->config,
|
|
|
|
NULL);
|
2008-01-15 04:44:01 +08:00
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
|
1999-06-23 23:24:46 +08:00
|
|
|
/***************************/
|
|
|
|
/* Hue-Saturation dialog */
|
|
|
|
/***************************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
static void
|
|
|
|
gimp_hue_saturation_tool_dialog (GimpImageMapTool *image_map_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-01-31 02:31:43 +08:00
|
|
|
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
|
|
|
|
GimpHueSaturationConfig *config = hs_tool->config;
|
2008-06-03 18:51:04 +08:00
|
|
|
GtkWidget *main_vbox;
|
2013-05-29 06:04:35 +08:00
|
|
|
GtkWidget *frame;
|
2008-01-31 02:31:43 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *abox;
|
|
|
|
GtkWidget *table;
|
2013-05-29 06:04:35 +08:00
|
|
|
GtkWidget *scale;
|
2008-01-31 02:31:43 +08:00
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GSList *group = NULL;
|
|
|
|
gint i;
|
1999-06-23 23:24:46 +08:00
|
|
|
|
2002-08-29 03:47:07 +08:00
|
|
|
const struct
|
|
|
|
{
|
|
|
|
const gchar *label;
|
2006-05-18 17:41:32 +08:00
|
|
|
const gchar *tooltip;
|
2002-08-29 03:47:07 +08:00
|
|
|
gint label_col;
|
|
|
|
gint label_row;
|
|
|
|
gint frame_col;
|
|
|
|
gint frame_row;
|
|
|
|
}
|
2008-01-25 21:00:07 +08:00
|
|
|
hue_range_table[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2006-05-18 17:41:32 +08:00
|
|
|
{ N_("M_aster"), N_("Adjust all colors"), 2, 3, 0, 0 },
|
|
|
|
{ N_("_R"), N_("Red"), 2, 1, 2, 0 },
|
|
|
|
{ N_("_Y"), N_("Yellow"), 1, 2, 0, 2 },
|
|
|
|
{ N_("_G"), N_("Green"), 1, 4, 0, 4 },
|
|
|
|
{ N_("_C"), N_("Cyan"), 2, 5, 2, 6 },
|
|
|
|
{ N_("_B"), N_("Blue"), 3, 4, 4, 4 },
|
|
|
|
{ N_("_M"), N_("Magenta"), 3, 2, 4, 2 }
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
1999-06-23 23:24:46 +08:00
|
|
|
|
2008-06-03 18:51:04 +08:00
|
|
|
main_vbox = gimp_image_map_tool_dialog_get_vbox (image_map_tool);
|
|
|
|
|
2005-09-04 00:01:15 +08:00
|
|
|
frame = gimp_frame_new (_("Select Primary Color to Adjust"));
|
2008-06-03 18:51:04 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), frame, TRUE, TRUE, 0);
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_widget_show (frame);
|
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
|
2005-03-12 20:25:57 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
2005-03-12 20:25:57 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), abox, TRUE, TRUE, 0);
|
2002-08-29 03:47:07 +08:00
|
|
|
gtk_widget_show (abox);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
/* The table containing hue ranges */
|
2002-08-29 03:47:07 +08:00
|
|
|
table = gtk_table_new (7, 5, FALSE);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 4);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 3, 4);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (table), 0, 2);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (table), 5, 2);
|
|
|
|
gtk_container_add (GTK_CONTAINER (abox), table);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
/* the radio buttons for hue ranges */
|
|
|
|
for (i = 0; i < G_N_ELEMENTS (hue_range_table); i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-03-12 20:25:57 +08:00
|
|
|
button = gtk_radio_button_new_with_mnemonic (group,
|
2008-01-25 21:00:07 +08:00
|
|
|
gettext (hue_range_table[i].label));
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
2008-01-25 21:00:07 +08:00
|
|
|
g_object_set_data (G_OBJECT (button), "gimp-item-data",
|
2002-08-26 19:35:56 +08:00
|
|
|
GINT_TO_POINTER (i));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2006-05-18 17:41:32 +08:00
|
|
|
gimp_help_set_help_data (button,
|
2008-01-25 21:00:07 +08:00
|
|
|
gettext (hue_range_table[i].tooltip),
|
2006-05-18 17:41:32 +08:00
|
|
|
NULL);
|
|
|
|
|
2002-08-29 03:47:07 +08:00
|
|
|
if (i == 0)
|
2008-01-25 21:00:07 +08:00
|
|
|
{
|
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
|
|
|
|
|
|
|
hs_tool->range_radio = button;
|
|
|
|
}
|
2002-08-29 03:47:07 +08:00
|
|
|
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), button,
|
2008-01-25 21:00:07 +08:00
|
|
|
hue_range_table[i].label_col,
|
|
|
|
hue_range_table[i].label_col + 1,
|
|
|
|
hue_range_table[i].label_row,
|
|
|
|
hue_range_table[i].label_row + 1,
|
2002-08-29 03:47:07 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
if (i > 0)
|
|
|
|
{
|
|
|
|
GimpRGB color = { 0.0 };
|
|
|
|
|
|
|
|
frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), frame,
|
2008-01-25 21:00:07 +08:00
|
|
|
hue_range_table[i].frame_col,
|
|
|
|
hue_range_table[i].frame_col + 1,
|
|
|
|
hue_range_table[i].frame_row,
|
|
|
|
hue_range_table[i].frame_row + 1,
|
2002-08-29 03:47:07 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
2006-04-12 20:49:29 +08:00
|
|
|
gtk_widget_show (frame);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
hs_tool->hue_range_color_area[i - 1] =
|
|
|
|
gimp_color_area_new (&color, GIMP_COLOR_AREA_FLAT, 0);
|
|
|
|
gtk_widget_set_size_request (hs_tool->hue_range_color_area[i - 1],
|
2002-08-29 03:47:07 +08:00
|
|
|
DA_WIDTH, DA_HEIGHT);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame),
|
2008-01-25 21:00:07 +08:00
|
|
|
hs_tool->hue_range_color_area[i - 1]);
|
|
|
|
gtk_widget_show (hs_tool->hue_range_color_area[i - 1]);
|
2002-08-29 03:47:07 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "toggled",
|
2008-01-25 21:00:07 +08:00
|
|
|
G_CALLBACK (hue_saturation_range_callback),
|
2002-08-26 19:35:56 +08:00
|
|
|
hs_tool);
|
1999-11-22 19:14:29 +08:00
|
|
|
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_widget_show (button);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1999-11-22 19:14:29 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (table);
|
|
|
|
|
2005-03-12 20:25:57 +08:00
|
|
|
/* Create the 'Overlap' option slider */
|
2013-05-29 06:04:35 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (image_map_tool->config, "overlap",
|
|
|
|
_("_Overlap"), 0.01, 0.1, 0);
|
2014-02-04 05:57:51 +08:00
|
|
|
gimp_prop_widget_set_factor (scale, 100.0, 0.0, 0.0, 1);
|
2013-05-29 06:04:35 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
2005-03-12 20:25:57 +08:00
|
|
|
|
2005-09-04 00:01:15 +08:00
|
|
|
frame = gimp_frame_new (_("Adjust Selected Color"));
|
2008-06-03 18:51:04 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
|
2002-08-29 03:47:07 +08:00
|
|
|
gtk_widget_show (frame);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 4);
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (frame), vbox);
|
|
|
|
gtk_widget_show (vbox);
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Create the hue scale widget */
|
2013-05-29 06:04:35 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (image_map_tool->config, "hue",
|
|
|
|
_("_Hue"), 1.0 / 180.0, 15.0 / 180.0, 0);
|
2014-02-04 05:57:51 +08:00
|
|
|
gimp_prop_widget_set_factor (scale, 180.0, 0.0, 0.0, 1);
|
2013-05-29 06:04:35 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Create the lightness scale widget */
|
2013-05-29 06:04:35 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (image_map_tool->config, "lightness",
|
|
|
|
_("_Lightness"), 0.01, 0.1, 0);
|
2014-02-04 05:57:51 +08:00
|
|
|
gimp_prop_widget_set_factor (scale, 100.0, 0.0, 0.0, 1);
|
2013-05-29 06:04:35 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Create the saturation scale widget */
|
2013-05-29 06:04:35 +08:00
|
|
|
scale = gimp_prop_spin_scale_new (image_map_tool->config, "saturation",
|
|
|
|
_("_Saturation"), 0.01, 0.1, 0);
|
2014-02-04 05:57:51 +08:00
|
|
|
gimp_prop_widget_set_factor (scale, 100.0, 0.0, 0.0, 1);
|
2013-05-29 06:04:35 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (scale);
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
|
2011-09-30 17:29:11 +08:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
2005-08-23 08:18:08 +08:00
|
|
|
button = gtk_button_new_with_mnemonic (_("R_eset Color"));
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
2008-01-25 21:00:07 +08:00
|
|
|
G_CALLBACK (hue_saturation_range_reset_callback),
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
hs_tool);
|
2008-01-31 02:31:43 +08:00
|
|
|
|
|
|
|
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (hs_tool->range_radio),
|
|
|
|
config->range);
|
|
|
|
|
|
|
|
hue_saturation_update_color_areas (hs_tool);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-10-17 19:33:43 +08:00
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_hue_saturation_tool_reset (GimpImageMapTool *image_map_tool)
|
2001-10-17 19:33:43 +08:00
|
|
|
{
|
2003-11-13 19:23:01 +08:00
|
|
|
GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (image_map_tool);
|
2008-01-25 21:00:07 +08:00
|
|
|
GimpHueRange range = hs_tool->config->range;
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2008-09-30 21:46:08 +08:00
|
|
|
g_object_freeze_notify (image_map_tool->config);
|
|
|
|
|
|
|
|
if (image_map_tool->default_config)
|
|
|
|
{
|
|
|
|
gimp_config_copy (GIMP_CONFIG (image_map_tool->default_config),
|
|
|
|
GIMP_CONFIG (image_map_tool->config),
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_config_reset (GIMP_CONFIG (image_map_tool->config));
|
|
|
|
}
|
2008-01-31 02:31:43 +08:00
|
|
|
|
2008-01-22 17:49:40 +08:00
|
|
|
g_object_set (hs_tool->config,
|
2008-01-25 21:00:07 +08:00
|
|
|
"range", range,
|
2008-01-22 17:49:40 +08:00
|
|
|
NULL);
|
2007-12-30 00:29:31 +08:00
|
|
|
|
2008-09-30 21:46:08 +08:00
|
|
|
g_object_thaw_notify (image_map_tool->config);
|
2007-12-30 00:29:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-31 02:31:43 +08:00
|
|
|
hue_saturation_config_notify (GObject *object,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GimpHueSaturationTool *hs_tool)
|
2007-12-30 00:29:31 +08:00
|
|
|
{
|
2008-01-31 02:31:43 +08:00
|
|
|
GimpHueSaturationConfig *config = GIMP_HUE_SATURATION_CONFIG (object);
|
|
|
|
|
2013-05-29 06:04:35 +08:00
|
|
|
if (! hs_tool->range_radio)
|
2008-01-31 02:31:43 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
if (! strcmp (pspec->name, "range"))
|
|
|
|
{
|
|
|
|
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (hs_tool->range_radio),
|
|
|
|
config->range);
|
|
|
|
}
|
|
|
|
|
|
|
|
hue_saturation_update_color_areas (hs_tool);
|
2002-08-26 19:35:56 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2007-12-30 00:29:31 +08:00
|
|
|
hue_saturation_update_color_areas (GimpHueSaturationTool *hs_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-01-22 17:49:40 +08:00
|
|
|
static GimpRGB default_colors[6] =
|
|
|
|
{
|
|
|
|
{ 1.0, 0, 0, },
|
|
|
|
{ 1.0, 1.0, 0, },
|
|
|
|
{ 0, 1.0, 0, },
|
|
|
|
{ 0, 1.0, 1.0, },
|
|
|
|
{ 0, 0, 1.0, },
|
|
|
|
{ 1.0, 0, 1.0, }
|
|
|
|
};
|
|
|
|
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2007-12-30 00:29:31 +08:00
|
|
|
for (i = 0; i < 6; i++)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-01-22 17:49:40 +08:00
|
|
|
GimpRGB color = default_colors[i];
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-01-22 17:49:40 +08:00
|
|
|
gimp_operation_hue_saturation_map (hs_tool->config, &color, i + 1,
|
|
|
|
&color);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
gimp_color_area_set_color (GIMP_COLOR_AREA (hs_tool->hue_range_color_area[i]),
|
2007-12-30 00:29:31 +08:00
|
|
|
&color);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-25 21:00:07 +08:00
|
|
|
hue_saturation_range_callback (GtkWidget *widget,
|
|
|
|
GimpHueSaturationTool *hs_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-01-25 21:00:07 +08:00
|
|
|
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
{
|
2008-01-25 21:00:07 +08:00
|
|
|
GimpHueRange range;
|
2007-12-30 00:29:31 +08:00
|
|
|
|
2008-01-25 21:00:07 +08:00
|
|
|
gimp_radio_button_update (widget, &range);
|
2008-01-22 17:49:40 +08:00
|
|
|
g_object_set (hs_tool->config,
|
2008-01-25 21:00:07 +08:00
|
|
|
"range", range,
|
2008-01-22 17:49:40 +08:00
|
|
|
NULL);
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-25 21:00:07 +08:00
|
|
|
hue_saturation_range_reset_callback (GtkWidget *widget,
|
|
|
|
GimpHueSaturationTool *hs_tool)
|
More color correction stuff cleanup:
2002-09-04 Michael Natterer <mitch@gimp.org>
More color correction stuff cleanup:
* app/base/Makefile.am
* app/base/base-types.h
* app/base/levels.[ch]: new files containing levels_lut_func(), a
new "Levels" parameter struct and the "auto levels" stuff.
* app/base/lut-funcs.[ch]: removed the levels stuff here, added
lots of g_return_if_fail().
* app/base/color-balance.[ch]
* app/base/hue-saturation.[ch]: added init() and reset() functions
so we don't need to duplicate this code in the tool and the pdb
wrappers.
* app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made
curves_channel_reset() initialize the curves array.
* app/tools/gimpcolorbalancetool.[ch]: use the new functions,
moved the "Range" frame to the top, added a per-range "Reset"
button, made the global "Reset" button reset all ranges and
the "Preserve Luminosity" toggle.
* app/tools/gimpcurvestool.[ch]: don't initialize the curves
array manually, as curves_channel_reset() does that,
s/gint/GimpHistogramChannel/g.
* app/tools/gimphuesaturationtool.c: use the new functions, added
a per-channel "Reset" button and made the global "Reset" button
reset all channels, cleaned up the GUI update function.
* app/tools/gimplevelstool.[ch]: changed to use the new Levels
parameter struct and it's utility functions. Removed stuff
which now lives in base/levels.c
* app/tools/gimpimagemaptool.c: align the "Preview" button
bottom-left, not bottom-right.
* tools/pdbgen/pdb/color.pdb: use the new stuff and removed
uglyness because using the "Levels" struct makes the code more
straightforward.
* app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
|
|
|
{
|
2008-01-28 01:39:01 +08:00
|
|
|
gimp_hue_saturation_config_reset_range (hs_tool->config);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|