Simplify things a bit and enable gegl-only color correction tools (without
2008-01-10 Michael Natterer <mitch@gimp.org> Simplify things a bit and enable gegl-only color correction tools (without legacy functions). * app/tools/gimpimagemaptool.c (gimp_image_map_tool_create_map): always create the operation if ::get_operation() is implemented and always use it when creating the GimpImageMap if there is no legacy apply_func. * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorizetool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimpthresholdtool.c (map): set the operation's properties unconditionally since it always exists now if we also implement ::get_operation(). svn path=/trunk/; revision=24588
This commit is contained in:

committed by
Michael Natterer

parent
91788fe393
commit
dac333f72d
19
ChangeLog
19
ChangeLog
@ -1,3 +1,22 @@
|
|||||||
|
2008-01-10 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
Simplify things a bit and enable gegl-only color correction
|
||||||
|
tools (without legacy functions).
|
||||||
|
|
||||||
|
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_create_map):
|
||||||
|
always create the operation if ::get_operation() is implemented
|
||||||
|
and always use it when creating the GimpImageMap if there is no
|
||||||
|
legacy apply_func.
|
||||||
|
|
||||||
|
* app/tools/gimpbrightnesscontrasttool.c
|
||||||
|
* app/tools/gimpcolorbalancetool.c
|
||||||
|
* app/tools/gimpcolorizetool.c
|
||||||
|
* app/tools/gimplevelstool.c
|
||||||
|
* app/tools/gimpposterizetool.c
|
||||||
|
* app/tools/gimpthresholdtool.c (map): set the operation's
|
||||||
|
properties unconditionally since it always exists now if we also
|
||||||
|
implement ::get_operation().
|
||||||
|
|
||||||
2008-01-10 Michael Natterer <mitch@gimp.org>
|
2008-01-10 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/gegl/Makefile.am
|
* app/gegl/Makefile.am
|
||||||
|
@ -196,9 +196,6 @@ static void
|
|||||||
gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
|
gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
|
||||||
{
|
{
|
||||||
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
|
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (im_tool);
|
||||||
|
|
||||||
if (im_tool->operation)
|
|
||||||
{
|
|
||||||
gdouble brightness;
|
gdouble brightness;
|
||||||
gdouble contrast;
|
gdouble contrast;
|
||||||
|
|
||||||
@ -211,7 +208,6 @@ gimp_brightness_contrast_tool_map (GimpImageMapTool *im_tool)
|
|||||||
"brightness", brightness,
|
"brightness", brightness,
|
||||||
"contrast", contrast,
|
"contrast", contrast,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
|
||||||
|
|
||||||
brightness_contrast_lut_setup (bc_tool->lut,
|
brightness_contrast_lut_setup (bc_tool->lut,
|
||||||
bc_tool->brightness / 255.0,
|
bc_tool->brightness / 255.0,
|
||||||
|
@ -177,9 +177,6 @@ static void
|
|||||||
gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
|
gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
|
||||||
{
|
{
|
||||||
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (image_map_tool);
|
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (image_map_tool);
|
||||||
|
|
||||||
if (image_map_tool->operation)
|
|
||||||
{
|
|
||||||
ColorBalance *cb = cb_tool->color_balance;
|
ColorBalance *cb = cb_tool->color_balance;
|
||||||
GimpTransferMode range;
|
GimpTransferMode range;
|
||||||
|
|
||||||
@ -199,7 +196,6 @@ gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
|
|||||||
gegl_node_set (image_map_tool->operation,
|
gegl_node_set (image_map_tool->operation,
|
||||||
"preserve-luminosity", cb->preserve_luminosity,
|
"preserve-luminosity", cb->preserve_luminosity,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
|
||||||
|
|
||||||
color_balance_create_lookup_tables (cb_tool->color_balance);
|
color_balance_create_lookup_tables (cb_tool->color_balance);
|
||||||
}
|
}
|
||||||
|
@ -171,14 +171,11 @@ gimp_colorize_tool_map (GimpImageMapTool *image_map_tool)
|
|||||||
{
|
{
|
||||||
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
|
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (image_map_tool);
|
||||||
|
|
||||||
if (image_map_tool->operation)
|
|
||||||
{
|
|
||||||
gegl_node_set (image_map_tool->operation,
|
gegl_node_set (image_map_tool->operation,
|
||||||
"hue", col_tool->colorize->hue,
|
"hue", col_tool->colorize->hue,
|
||||||
"saturation", col_tool->colorize->saturation,
|
"saturation", col_tool->colorize->saturation,
|
||||||
"lightness", col_tool->colorize->lightness,
|
"lightness", col_tool->colorize->lightness,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
|
||||||
|
|
||||||
colorize_calculate (col_tool->colorize);
|
colorize_calculate (col_tool->colorize);
|
||||||
}
|
}
|
||||||
|
@ -468,6 +468,7 @@ static void
|
|||||||
gimp_image_map_tool_create_map (GimpImageMapTool *tool)
|
gimp_image_map_tool_create_map (GimpImageMapTool *tool)
|
||||||
{
|
{
|
||||||
GimpCoreConfig *config = GIMP_TOOL (tool)->tool_info->gimp->config;
|
GimpCoreConfig *config = GIMP_TOOL (tool)->tool_info->gimp->config;
|
||||||
|
gboolean use_gegl;
|
||||||
|
|
||||||
if (tool->image_map)
|
if (tool->image_map)
|
||||||
{
|
{
|
||||||
@ -475,14 +476,16 @@ gimp_image_map_tool_create_map (GimpImageMapTool *tool)
|
|||||||
g_object_unref (tool->image_map);
|
g_object_unref (tool->image_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->use_gegl && ! tool->operation &&
|
if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
|
||||||
GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation)
|
|
||||||
tool->operation = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation (tool);
|
tool->operation = GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->get_operation (tool);
|
||||||
|
|
||||||
|
g_assert (tool->operation || tool->apply_func);
|
||||||
|
|
||||||
|
use_gegl = (config->use_gegl || ! tool->apply_func);
|
||||||
|
|
||||||
tool->image_map = gimp_image_map_new (tool->drawable,
|
tool->image_map = gimp_image_map_new (tool->drawable,
|
||||||
GIMP_TOOL (tool)->tool_info->blurb,
|
GIMP_TOOL (tool)->tool_info->blurb,
|
||||||
config->use_gegl ?
|
use_gegl ? tool->operation : NULL,
|
||||||
tool->operation : NULL,
|
|
||||||
tool->apply_func,
|
tool->apply_func,
|
||||||
tool->apply_data);
|
tool->apply_data);
|
||||||
|
|
||||||
|
@ -270,10 +270,6 @@ static void
|
|||||||
gimp_levels_tool_map (GimpImageMapTool *image_map_tool)
|
gimp_levels_tool_map (GimpImageMapTool *image_map_tool)
|
||||||
{
|
{
|
||||||
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
GimpLevelsTool *tool = GIMP_LEVELS_TOOL (image_map_tool);
|
||||||
|
|
||||||
if (image_map_tool->operation)
|
|
||||||
{
|
|
||||||
Levels *levels = tool->levels;
|
|
||||||
GimpHistogramChannel channel;
|
GimpHistogramChannel channel;
|
||||||
|
|
||||||
for (channel = GIMP_HISTOGRAM_VALUE;
|
for (channel = GIMP_HISTOGRAM_VALUE;
|
||||||
@ -291,18 +287,17 @@ gimp_levels_tool_map (GimpImageMapTool *image_map_tool)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gegl_node_set (image_map_tool->operation,
|
gegl_node_set (image_map_tool->operation,
|
||||||
"gamma", levels->gamma[channel],
|
"gamma", tool->levels->gamma[channel],
|
||||||
"low-input", levels->low_input[channel] / 255.0,
|
"low-input", tool->levels->low_input[channel] / 255.0,
|
||||||
"high-input", levels->high_input[channel] / 255.0,
|
"high-input", tool->levels->high_input[channel] / 255.0,
|
||||||
"low-output", levels->low_output[channel] / 255.0,
|
"low-output", tool->levels->low_output[channel] / 255.0,
|
||||||
"high-output", levels->high_output[channel] / 255.0,
|
"high-output", tool->levels->high_output[channel] / 255.0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* FIXME: hack */
|
/* FIXME: hack */
|
||||||
if (! tool->color && channel == 1)
|
if (! tool->color && channel == 1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
gimp_lut_setup (tool->lut,
|
gimp_lut_setup (tool->lut,
|
||||||
(GimpLutFunc) levels_lut_func,
|
(GimpLutFunc) levels_lut_func,
|
||||||
|
@ -174,12 +174,9 @@ gimp_posterize_tool_map (GimpImageMapTool *image_map_tool)
|
|||||||
{
|
{
|
||||||
GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
|
GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (image_map_tool);
|
||||||
|
|
||||||
if (image_map_tool->operation)
|
|
||||||
{
|
|
||||||
gegl_node_set (image_map_tool->operation,
|
gegl_node_set (image_map_tool->operation,
|
||||||
"levels", posterize_tool->levels,
|
"levels", posterize_tool->levels,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
|
||||||
|
|
||||||
posterize_lut_setup (posterize_tool->lut,
|
posterize_lut_setup (posterize_tool->lut,
|
||||||
posterize_tool->levels,
|
posterize_tool->levels,
|
||||||
|
@ -198,14 +198,11 @@ 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);
|
||||||
|
|
||||||
if (image_map_tool->operation)
|
|
||||||
{
|
|
||||||
gegl_node_set (image_map_tool->operation,
|
gegl_node_set (image_map_tool->operation,
|
||||||
"low", t_tool->threshold->low_threshold / 255.0,
|
"low", t_tool->threshold->low_threshold / 255.0,
|
||||||
"high", t_tool->threshold->high_threshold / 255.0,
|
"high", t_tool->threshold->high_threshold / 255.0,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**********************/
|
/**********************/
|
||||||
|
Reference in New Issue
Block a user