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:

committed by
Michael Natterer

parent
8e5c4ef906
commit
96fd65ed40
10
ChangeLog
10
ChangeLog
@ -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>
|
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,
|
|||||||
|
|
||||||
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;
|
|||||||
|
|
||||||
/* 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,
|
|||||||
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);
|
||||||
@ -217,8 +215,10 @@ 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,8 +315,11 @@ 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;
|
||||||
|
|
||||||
|
low = gimp_histogram_get_threshold (t_tool->hist,
|
||||||
|
gimp_drawable_is_rgb (drawable) ?
|
||||||
GIMP_HISTOGRAM_RGB :
|
GIMP_HISTOGRAM_RGB :
|
||||||
GIMP_HISTOGRAM_VALUE,
|
GIMP_HISTOGRAM_VALUE,
|
||||||
0, 255);
|
0, 255);
|
||||||
|
Reference in New Issue
Block a user