added reset() and to_cruft() functions.
2008-01-24 Michael Natterer <mitch@gimp.org> * app/gegl/gimpcolorizeconfig.[ch]: added reset() and to_cruft() functions. * app/tools/gimpcolorizetool.c: use them. svn path=/trunk/; revision=24698
This commit is contained in:
parent
d089ea9c3e
commit
fdc4eded22
4 changed files with 49 additions and 17 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2008-01-24 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/gegl/gimpcolorizeconfig.[ch]: added reset() and to_cruft()
|
||||
functions.
|
||||
|
||||
* app/tools/gimpcolorizetool.c: use them.
|
||||
|
||||
2008-01-23 Martin Nordholts <martinn@svn.gnome.org>
|
||||
|
||||
* app/tools/gimprectangleselecttool.c
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@
|
|||
|
||||
#include "gegl-types.h"
|
||||
|
||||
/* temp cruft */
|
||||
#include "base/colorize.h"
|
||||
|
||||
#include "gimpcolorizeconfig.h"
|
||||
|
||||
|
||||
|
|
@ -145,3 +148,33 @@ gimp_colorize_config_set_property (GObject *object,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
void
|
||||
gimp_colorize_config_reset (GimpColorizeConfig *config)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_COLORIZE_CONFIG (config));
|
||||
|
||||
config->hue = 0.5;
|
||||
config->saturation = 0.5;
|
||||
config->lightness = 0.0;
|
||||
}
|
||||
|
||||
|
||||
/* temp cruft */
|
||||
|
||||
void
|
||||
gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
|
||||
Colorize *cruft)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_COLORIZE_CONFIG (config));
|
||||
g_return_if_fail (cruft != NULL);
|
||||
|
||||
cruft->hue = config->hue * 360.0;
|
||||
cruft->saturation = config->saturation * 100.0;
|
||||
cruft->lightness = config->lightness * 100.0;
|
||||
|
||||
colorize_calculate (cruft);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,5 +50,11 @@ struct _GimpColorizeConfigClass
|
|||
|
||||
GType gimp_colorize_config_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void gimp_colorize_config_reset (GimpColorizeConfig *config);
|
||||
|
||||
/* temp cruft */
|
||||
void gimp_colorize_config_to_cruft (GimpColorizeConfig *config,
|
||||
Colorize *cruft);
|
||||
|
||||
|
||||
#endif /* __GIMP_COLORIZE_CONFIG_H__ */
|
||||
|
|
|
|||
|
|
@ -155,11 +155,7 @@ gimp_colorize_tool_initialize (GimpTool *tool,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
g_object_set (col_tool->config,
|
||||
"hue", 0.5,
|
||||
"saturation", 0.5,
|
||||
"lightness", 0.0,
|
||||
NULL);
|
||||
gimp_colorize_config_reset (col_tool->config);
|
||||
|
||||
GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error);
|
||||
|
||||
|
|
@ -193,14 +189,8 @@ static void
|
|||
gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
|
||||
{
|
||||
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
|
||||
GimpColorizeConfig *config = col_tool->config;
|
||||
Colorize *colorize = col_tool->colorize;
|
||||
|
||||
colorize->hue = config->hue * 360.0;
|
||||
colorize->saturation = config->saturation * 100.0;
|
||||
colorize->lightness = config->lightness * 100.0;
|
||||
|
||||
colorize_calculate (colorize);
|
||||
gimp_colorize_config_to_cruft (col_tool->config, col_tool->colorize);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -282,11 +272,7 @@ gimp_colorize_tool_reset (GimpImageMapTool *image_map_tool)
|
|||
{
|
||||
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
|
||||
|
||||
g_object_set (col_tool->config,
|
||||
"hue", 0.5,
|
||||
"saturation", 0.5,
|
||||
"lightness", 0.0,
|
||||
NULL);
|
||||
gimp_colorize_config_reset (col_tool->config);
|
||||
|
||||
colorize_update_sliders (col_tool);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue