Commit 96fd65ed authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

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
parent 8e5c4ef9
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.
......
......@@ -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;
}
......@@ -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__ */
......@@ -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);
......@@ -217,8 +215,10 @@ static void
gimp_threshold_tool_map (GimpImageMapTool *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,8 +315,11 @@ 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 ?
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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment