1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (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
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
|
|
|
|
#include "base/gimphistogram.h"
|
2002-08-26 19:35:56 +08:00
|
|
|
#include "base/threshold.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2003-01-15 21:40:44 +08:00
|
|
|
#include "config/gimpbaseconfig.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimpdrawable-histogram.h"
|
|
|
|
#include "core/gimpimage.h"
|
2002-08-26 19:35:56 +08:00
|
|
|
#include "core/gimpimagemap.h"
|
2003-01-15 21:40:44 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2002-09-08 01:27:32 +08:00
|
|
|
#include "widgets/gimphistogrambox.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "widgets/gimphistogramview.h"
|
2004-03-05 09:31:33 +08:00
|
|
|
#include "widgets/gimppropwidgets.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
|
|
|
|
2003-10-24 16:12:21 +08:00
|
|
|
#include "gimphistogramoptions.h"
|
2001-05-25 07:57:08 +08:00
|
|
|
#include "gimpthresholdtool.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
1999-11-22 19:14:29 +08:00
|
|
|
#define LOW 0x1
|
|
|
|
#define HIGH 0x2
|
2001-05-25 07:57:08 +08:00
|
|
|
#define HISTOGRAM 0x4
|
1999-11-22 19:14:29 +08:00
|
|
|
#define ALL (LOW | HIGH | HISTOGRAM)
|
|
|
|
|
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
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static void gimp_threshold_tool_class_init (GimpThresholdToolClass *klass);
|
|
|
|
static void gimp_threshold_tool_init (GimpThresholdTool *threshold_tool);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static void gimp_threshold_tool_finalize (GObject *object);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static gboolean gimp_threshold_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *gdisp);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static void gimp_threshold_tool_map (GimpImageMapTool *image_map_tool);
|
|
|
|
static void gimp_threshold_tool_dialog (GimpImageMapTool *image_map_tool);
|
|
|
|
static void gimp_threshold_tool_reset (GimpImageMapTool *image_map_tool);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static void gimp_threshold_tool_histogram_range (GimpHistogramView *view,
|
|
|
|
gint start,
|
|
|
|
gint end,
|
|
|
|
GimpThresholdTool *t_tool);
|
2000-12-31 12:07:42 +08:00
|
|
|
|
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
static GimpImageMapToolClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
/* public functions */
|
2001-05-25 07:57:08 +08:00
|
|
|
|
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_threshold_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_THRESHOLD_TOOL,
|
2003-10-24 16:12:21 +08:00
|
|
|
GIMP_TYPE_HISTOGRAM_OPTIONS,
|
|
|
|
gimp_histogram_options_gui,
|
2003-06-28 19:20:37 +08:00
|
|
|
0,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-threshold-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Threshold"),
|
|
|
|
_("Reduce image to two colors using a threshold"),
|
2003-07-02 00:22:03 +08:00
|
|
|
N_("/Tools/Color Tools/_Threshold..."), NULL,
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_THRESHOLD,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_THRESHOLD,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-05-25 07:57:08 +08:00
|
|
|
gimp_threshold_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
2001-05-25 07:57:08 +08:00
|
|
|
|
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
|
|
|
sizeof (GimpThresholdToolClass),
|
2001-08-14 22:53:55 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_threshold_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpThresholdTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_threshold_tool_init,
|
2001-05-25 07:57:08 +08:00
|
|
|
};
|
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_IMAGE_MAP_TOOL,
|
2003-08-22 09:42:57 +08:00
|
|
|
"GimpThresholdTool",
|
2001-08-14 22:53:55 +08:00
|
|
|
&tool_info, 0);
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return tool_type;
|
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2001-05-25 07:57:08 +08:00
|
|
|
static void
|
|
|
|
gimp_threshold_tool_class_init (GimpThresholdToolClass *klass)
|
|
|
|
{
|
2002-08-26 19:35:56 +08:00
|
|
|
GObjectClass *object_class;
|
|
|
|
GimpToolClass *tool_class;
|
|
|
|
GimpImageMapToolClass *image_map_tool_class;
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
object_class = G_OBJECT_CLASS (klass);
|
|
|
|
tool_class = GIMP_TOOL_CLASS (klass);
|
|
|
|
image_map_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
object_class->finalize = gimp_threshold_tool_finalize;
|
|
|
|
|
|
|
|
tool_class->initialize = gimp_threshold_tool_initialize;
|
|
|
|
|
2004-02-25 21:55:45 +08:00
|
|
|
image_map_tool_class->shell_desc = _("Apply Threshold");
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
image_map_tool_class->map = gimp_threshold_tool_map;
|
|
|
|
image_map_tool_class->dialog = gimp_threshold_tool_dialog;
|
|
|
|
image_map_tool_class->reset = gimp_threshold_tool_reset;
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_threshold_tool_init (GimpThresholdTool *t_tool)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2003-01-15 21:40:44 +08:00
|
|
|
t_tool->threshold = g_new0 (Threshold, 1);
|
2003-01-17 21:34:26 +08:00
|
|
|
t_tool->hist = NULL;
|
2002-08-26 19:35:56 +08:00
|
|
|
|
|
|
|
t_tool->threshold->low_threshold = 127;
|
|
|
|
t_tool->threshold->high_threshold = 255;
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_threshold_tool_finalize (GObject *object)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2003-10-24 16:12:21 +08:00
|
|
|
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (object);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
|
|
|
if (t_tool->threshold)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2002-08-26 19:35:56 +08:00
|
|
|
g_free (t_tool->threshold);
|
|
|
|
t_tool->threshold = NULL;
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
if (t_tool->hist)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_histogram_free (t_tool->hist);
|
|
|
|
t_tool->hist = NULL;
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-05-25 07:57:08 +08:00
|
|
|
}
|
|
|
|
|
2004-01-22 00:07:48 +08:00
|
|
|
static gboolean
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_threshold_tool_initialize (GimpTool *tool,
|
|
|
|
GimpDisplay *gdisp)
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2003-11-13 19:23:01 +08:00
|
|
|
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (tool);
|
2002-08-26 19:35:56 +08:00
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
2003-02-04 07:54:19 +08:00
|
|
|
drawable = gimp_image_active_drawable (gdisp->gimage);
|
|
|
|
|
2003-11-13 19:23:01 +08:00
|
|
|
if (! drawable)
|
2004-01-22 00:07:48 +08:00
|
|
|
return FALSE;
|
2003-11-13 19:23:01 +08:00
|
|
|
|
2003-02-04 07:54:19 +08:00
|
|
|
if (gimp_drawable_is_indexed (drawable))
|
2001-05-25 07:57:08 +08:00
|
|
|
{
|
2003-11-13 19:23:01 +08:00
|
|
|
g_message (_("Threshold does not operate on indexed layers."));
|
2004-01-22 00:07:48 +08:00
|
|
|
return FALSE;
|
2002-08-26 19:35:56 +08:00
|
|
|
}
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2003-01-17 21:34:26 +08:00
|
|
|
if (!t_tool->hist)
|
|
|
|
{
|
|
|
|
Gimp *gimp = GIMP_TOOL (t_tool)->tool_info->gimp;
|
|
|
|
|
|
|
|
t_tool->hist = gimp_histogram_new (GIMP_BASE_CONFIG (gimp->config));
|
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
t_tool->threshold->color = gimp_drawable_is_rgb (drawable);
|
|
|
|
t_tool->threshold->low_threshold = 127;
|
|
|
|
t_tool->threshold->high_threshold = 255;
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->initialize (tool, gdisp);
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_drawable_calculate_histogram (drawable, t_tool->hist);
|
2001-05-25 07:57:08 +08:00
|
|
|
|
2003-11-01 10:39:34 +08:00
|
|
|
g_signal_handlers_block_by_func (t_tool->histogram_box->view,
|
2002-09-08 01:27:32 +08:00
|
|
|
gimp_threshold_tool_histogram_range,
|
2002-08-26 19:35:56 +08:00
|
|
|
t_tool);
|
2003-11-01 10:39:34 +08:00
|
|
|
gimp_histogram_view_set_histogram (t_tool->histogram_box->view,
|
2002-10-15 09:15:43 +08:00
|
|
|
t_tool->hist);
|
2003-11-01 10:39:34 +08:00
|
|
|
gimp_histogram_view_set_range (t_tool->histogram_box->view,
|
2002-09-08 01:27:32 +08:00
|
|
|
t_tool->threshold->low_threshold,
|
|
|
|
t_tool->threshold->high_threshold);
|
2003-11-01 10:39:34 +08:00
|
|
|
g_signal_handlers_unblock_by_func (t_tool->histogram_box->view,
|
2002-09-08 01:27:32 +08:00
|
|
|
gimp_threshold_tool_histogram_range,
|
2002-08-26 19:35:56 +08:00
|
|
|
t_tool);
|
1999-06-23 23:24:46 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));
|
2004-01-22 00:07:48 +08:00
|
|
|
|
|
|
|
return TRUE;
|
added gimphistogram*, histogramwidget*, removed histogram.[ch]
* app/Makefile.am: added gimphistogram*, histogramwidget*,
removed histogram.[ch]
* app/histogram.[ch]: removed. replaced with histogramwidget.[ch].
* app/{gimphistogramP.h, gimphistogram.h, gimphistogram.c}: new
functions that calculate histograms in parallel and perform
calculations on them.
* app/histogramwidget.[ch]: Same as old histogram.[ch], only it is
now a real widget, and it uses GimpHistograms instead of arrays of
values.
* app/curves.c: #include gimphistogram.h instead of histogram.h.
* app/equalize.c: use GimpHistogram and GimpLut.
* app/gimpbrush.c, app/gimpimage.c, app/gimpset.c: use
GTK_RUN_FIRST in calls to gimp_signal_new.
* app/histogram_tool.c, app/levels.c, app/threshold.c: modified to
use the new HistogramWidget.
* app/paint_funcs.c: removed some unused variables.
* app/preferences_dialog.c: only display the num-processor field
if we are configured --with-mp
* plug-ins/gee/gee.c: removed a couple of c++ style comments.
1999-03-01 13:11:19 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_threshold_tool_map (GimpImageMapTool *image_map_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-10-24 16:12:21 +08:00
|
|
|
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
|
2002-08-26 19:35:56 +08:00
|
|
|
|
|
|
|
gimp_image_map_apply (image_map_tool->image_map,
|
|
|
|
threshold,
|
|
|
|
t_tool->threshold);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
|
1999-06-23 23:24:46 +08:00
|
|
|
/**********************/
|
|
|
|
/* Threshold dialog */
|
|
|
|
/**********************/
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
static void
|
|
|
|
gimp_threshold_tool_dialog (GimpImageMapTool *image_map_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-11-13 19:23:01 +08:00
|
|
|
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
|
2003-10-24 16:12:21 +08:00
|
|
|
GimpToolOptions *tool_options;
|
2004-03-05 09:31:33 +08:00
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *menu;
|
2002-10-15 09:15:43 +08:00
|
|
|
GtkWidget *box;
|
2002-08-26 19:35:56 +08:00
|
|
|
|
2004-03-05 09:31:33 +08:00
|
|
|
tool_options = GIMP_TOOL (t_tool)->tool_info->tool_options;
|
|
|
|
|
|
|
|
vbox = image_map_tool->main_vbox;
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
menu = gimp_prop_enum_stock_box_new (G_OBJECT (tool_options),
|
|
|
|
"histogram-scale", "gimp-histogram",
|
|
|
|
0, 0);
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), menu, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (menu);
|
|
|
|
|
2002-10-15 09:15:43 +08:00
|
|
|
box = gimp_histogram_box_new (_("Threshold Range:"));
|
2004-03-05 09:31:33 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), box, TRUE, TRUE, 0);
|
2002-10-15 09:15:43 +08:00
|
|
|
gtk_widget_show (box);
|
2002-08-29 03:47:07 +08:00
|
|
|
|
2002-10-15 09:15:43 +08:00
|
|
|
t_tool->histogram_box = GIMP_HISTOGRAM_BOX (box);
|
1999-11-22 19:14:29 +08:00
|
|
|
|
2003-11-01 10:39:34 +08:00
|
|
|
g_signal_connect (t_tool->histogram_box->view, "range_changed",
|
2002-09-08 01:27:32 +08:00
|
|
|
G_CALLBACK (gimp_threshold_tool_histogram_range),
|
2002-08-26 19:35:56 +08:00
|
|
|
t_tool);
|
2003-10-24 16:12:21 +08:00
|
|
|
|
|
|
|
gimp_histogram_options_connect_view (GIMP_HISTOGRAM_OPTIONS (tool_options),
|
2003-11-01 10:39:34 +08:00
|
|
|
t_tool->histogram_box->view);
|
1999-11-22 19:14:29 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_threshold_tool_reset (GimpImageMapTool *image_map_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2003-10-24 16:12:21 +08:00
|
|
|
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
|
1999-11-22 19:14:29 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
t_tool->threshold->low_threshold = 127.0;
|
|
|
|
t_tool->threshold->high_threshold = 255.0;
|
1999-11-22 19:14:29 +08:00
|
|
|
|
2003-11-01 10:39:34 +08:00
|
|
|
gimp_histogram_view_set_range (t_tool->histogram_box->view,
|
2002-09-08 01:27:32 +08:00
|
|
|
t_tool->threshold->low_threshold,
|
|
|
|
t_tool->threshold->high_threshold);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-09-08 01:27:32 +08:00
|
|
|
gimp_threshold_tool_histogram_range (GimpHistogramView *widget,
|
|
|
|
gint start,
|
|
|
|
gint end,
|
|
|
|
GimpThresholdTool *t_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-09-08 01:27:32 +08:00
|
|
|
if (start != t_tool->threshold->low_threshold ||
|
|
|
|
end != t_tool->threshold->high_threshold)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-09-08 01:27:32 +08:00
|
|
|
t_tool->threshold->low_threshold = start;
|
|
|
|
t_tool->threshold->high_threshold = end;
|
1999-11-22 19:14:29 +08:00
|
|
|
|
2002-08-26 19:35:56 +08:00
|
|
|
gimp_image_map_tool_preview (GIMP_IMAGE_MAP_TOOL (t_tool));
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|