add "gboolean color" parameter to gimp_threshold_config_to_cruft() and set

2008-02-04  Michael Natterer  <mitch@gimp.org>

	* app/gegl/gimpthresholdconfig.[ch]: add "gboolean color"
	parameter to gimp_threshold_config_to_cruft() and set the "color"
	boolean in the Threshold cruft struct.

	* app/tools/gimpthresholdtool.c: don't fiddle with the cruft
	struct any longer and pass gimp_drawable_is_rgb() to above
	function instead.


svn path=/trunk/; revision=24778
This commit is contained in:
Michael Natterer 2008-02-03 23:50:55 +00:00 committed by Michael Natterer
parent 8e5c4ef906
commit 96fd65ed40
4 changed files with 27 additions and 11 deletions

View File

@ -1,3 +1,13 @@
2008-02-04 Michael Natterer <mitch@gimp.org>
* app/gegl/gimpthresholdconfig.[ch]: add "gboolean color"
parameter to gimp_threshold_config_to_cruft() and set the "color"
boolean in the Threshold cruft struct.
* app/tools/gimpthresholdtool.c: don't fiddle with the cruft
struct any longer and pass gimp_drawable_is_rgb() to above
function instead.
2008-02-02 Martin Nordholts <martinn@svn.gnome.org>
* INSTALL: Update GEGL dependency to GEGL trunk.

View File

@ -138,11 +138,13 @@ gimp_threshold_config_set_property (GObject *object,
void
gimp_threshold_config_to_cruft (GimpThresholdConfig *config,
Threshold *cruft)
Threshold *cruft,
gboolean color)
{
g_return_if_fail (GIMP_IS_THRESHOLD_CONFIG (config));
g_return_if_fail (cruft != NULL);
cruft->low_threshold = config->low * 255.999;
cruft->high_threshold = config->high * 255.999;
cruft->color = color;
}

View File

@ -54,7 +54,8 @@ GType gimp_threshold_config_get_type (void) G_GNUC_CONST;
/* temp cruft */
void gimp_threshold_config_to_cruft (GimpThresholdConfig *config,
Threshold *cruft);
Threshold *cruft,
gboolean color);
#endif /* __GIMP_THRESHOLD_CONFIG_H__ */

View File

@ -164,8 +164,6 @@ gimp_threshold_tool_initialize (GimpTool *tool,
if (! t_tool->hist)
t_tool->hist = gimp_histogram_new ();
t_tool->threshold->color = gimp_drawable_is_rgb (drawable);
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
gimp_drawable_calculate_histogram (drawable, t_tool->hist);
@ -216,9 +214,11 @@ gimp_threshold_tool_get_operation (GimpImageMapTool *image_map_tool,
static void
gimp_threshold_tool_map (GimpImageMapTool *image_map_tool)
{
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (image_map_tool);
GimpDrawable *drawable = image_map_tool->drawable;
gimp_threshold_config_to_cruft (t_tool->config, t_tool->threshold);
gimp_threshold_config_to_cruft (t_tool->config, t_tool->threshold,
gimp_drawable_is_rgb (drawable));
}
@ -315,11 +315,14 @@ static void
gimp_threshold_tool_auto_clicked (GtkWidget *button,
GimpThresholdTool *t_tool)
{
gdouble low = gimp_histogram_get_threshold (t_tool->hist,
t_tool->threshold->color ?
GIMP_HISTOGRAM_RGB :
GIMP_HISTOGRAM_VALUE,
0, 255);
GimpDrawable *drawable = GIMP_IMAGE_MAP_TOOL (t_tool)->drawable;
gdouble low;
low = gimp_histogram_get_threshold (t_tool->hist,
gimp_drawable_is_rgb (drawable) ?
GIMP_HISTOGRAM_RGB :
GIMP_HISTOGRAM_VALUE,
0, 255);
gimp_histogram_view_set_range (t_tool->histogram_box->view,
low, 255.0);