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> 2008-02-02 Martin Nordholts <martinn@svn.gnome.org>
* INSTALL: Update GEGL dependency to GEGL trunk. * INSTALL: Update GEGL dependency to GEGL trunk.
......
...@@ -138,11 +138,13 @@ gimp_threshold_config_set_property (GObject *object, ...@@ -138,11 +138,13 @@ gimp_threshold_config_set_property (GObject *object,
void void
gimp_threshold_config_to_cruft (GimpThresholdConfig *config, 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 (GIMP_IS_THRESHOLD_CONFIG (config));
g_return_if_fail (cruft != NULL); g_return_if_fail (cruft != NULL);
cruft->low_threshold = config->low * 255.999; cruft->low_threshold = config->low * 255.999;
cruft->high_threshold = config->high * 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; ...@@ -54,7 +54,8 @@ GType gimp_threshold_config_get_type (void) G_GNUC_CONST;
/* temp cruft */ /* temp cruft */
void gimp_threshold_config_to_cruft (GimpThresholdConfig *config, void gimp_threshold_config_to_cruft (GimpThresholdConfig *config,
Threshold *cruft); Threshold *cruft,
gboolean color);
#endif /* __GIMP_THRESHOLD_CONFIG_H__ */ #endif /* __GIMP_THRESHOLD_CONFIG_H__ */
...@@ -164,8 +164,6 @@ gimp_threshold_tool_initialize (GimpTool *tool, ...@@ -164,8 +164,6 @@ gimp_threshold_tool_initialize (GimpTool *tool,
if (! t_tool->hist) if (! t_tool->hist)
t_tool->hist = gimp_histogram_new (); 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_TOOL_CLASS (parent_class)->initialize (tool, display, error);
gimp_drawable_calculate_histogram (drawable, t_tool->hist); gimp_drawable_calculate_histogram (drawable, t_tool->hist);
...@@ -216,9 +214,11 @@ gimp_threshold_tool_get_operation (GimpImageMapTool *image_map_tool, ...@@ -216,9 +214,11 @@ gimp_threshold_tool_get_operation (GimpImageMapTool *image_map_tool,
static void static void
gimp_threshold_tool_map (GimpImageMapTool *image_map_tool) 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 ...@@ -315,11 +315,14 @@ static void
gimp_threshold_tool_auto_clicked (GtkWidget *button, gimp_threshold_tool_auto_clicked (GtkWidget *button,
GimpThresholdTool *t_tool) GimpThresholdTool *t_tool)
{ {
gdouble low = gimp_histogram_get_threshold (t_tool->hist, GimpDrawable *drawable = GIMP_IMAGE_MAP_TOOL (t_tool)->drawable;
t_tool->threshold->color ? gdouble low;
GIMP_HISTOGRAM_RGB :
GIMP_HISTOGRAM_VALUE, low = gimp_histogram_get_threshold (t_tool->hist,
0, 255); gimp_drawable_is_rgb (drawable) ?
GIMP_HISTOGRAM_RGB :
GIMP_HISTOGRAM_VALUE,
0, 255);
gimp_histogram_view_set_range (t_tool->histogram_box->view, gimp_histogram_view_set_range (t_tool->histogram_box->view,
low, 255.0); low, 255.0);
......
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