gimp r24778 - in trunk: . app/gegl app/tools



Author: mitch
Date: Sun Feb  3 23:50:55 2008
New Revision: 24778
URL: http://svn.gnome.org/viewvc/gimp?rev=24778&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/app/gegl/gimpthresholdconfig.c
   trunk/app/gegl/gimpthresholdconfig.h
   trunk/app/tools/gimpthresholdtool.c

Modified: trunk/app/gegl/gimpthresholdconfig.c
==============================================================================
--- trunk/app/gegl/gimpthresholdconfig.c	(original)
+++ trunk/app/gegl/gimpthresholdconfig.c	Sun Feb  3 23:50:55 2008
@@ -138,11 +138,13 @@
 
 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;
 }

Modified: trunk/app/gegl/gimpthresholdconfig.h
==============================================================================
--- trunk/app/gegl/gimpthresholdconfig.h	(original)
+++ trunk/app/gegl/gimpthresholdconfig.h	Sun Feb  3 23:50:55 2008
@@ -54,7 +54,8 @@
 
 /*  temp cruft  */
 void    gimp_threshold_config_to_cruft (GimpThresholdConfig *config,
-                                        Threshold           *cruft);
+                                        Threshold           *cruft,
+                                        gboolean             color);
 
 
 #endif /* __GIMP_THRESHOLD_CONFIG_H__ */

Modified: trunk/app/tools/gimpthresholdtool.c
==============================================================================
--- trunk/app/tools/gimpthresholdtool.c	(original)
+++ trunk/app/tools/gimpthresholdtool.c	Sun Feb  3 23:50:55 2008
@@ -164,8 +164,6 @@
   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 @@
 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 @@
 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]