[gimp/goat-invasion] app: remove the legacy color-balance cruft
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/goat-invasion] app: remove the legacy color-balance cruft
- Date: Tue, 27 Mar 2012 19:56:53 +0000 (UTC)
commit f10f3ceab2e4ecbbd99eeb149351f8563fce2434
Author: Michael Natterer <mitch gimp org>
Date: Tue Mar 27 21:56:29 2012 +0200
app: remove the legacy color-balance cruft
app/base/Makefile.am | 2 -
app/base/base-types.h | 1 -
app/base/color-balance.c | 181 ---------------------------------
app/base/color-balance.h | 43 --------
app/core/Makefile.am | 2 -
app/core/gimpdrawable-color-balance.c | 95 -----------------
app/core/gimpdrawable-color-balance.h | 31 ------
app/gegl/gimpcolorbalanceconfig.c | 27 -----
app/gegl/gimpcolorbalanceconfig.h | 4 -
app/pdb/color-cmds.c | 33 ++++--
app/tools/gimpcolorbalancetool.c | 35 -------
app/tools/gimpcolorbalancetool.h | 1 -
tools/pdbgen/pdb/color.pdb | 33 ++++--
13 files changed, 46 insertions(+), 442 deletions(-)
---
diff --git a/app/base/Makefile.am b/app/base/Makefile.am
index 59d31f6..2c749fd 100644
--- a/app/base/Makefile.am
+++ b/app/base/Makefile.am
@@ -22,8 +22,6 @@ libappbase_a_SOURCES = \
base-types.h \
base-utils.c \
base-utils.h \
- color-balance.c \
- color-balance.h \
cpercep.c \
cpercep.h \
gimplut.c \
diff --git a/app/base/base-types.h b/app/base/base-types.h
index 881e8a3..2599e1c 100644
--- a/app/base/base-types.h
+++ b/app/base/base-types.h
@@ -49,7 +49,6 @@
typedef struct _GimpLut GimpLut;
-typedef struct _ColorBalance ColorBalance;
typedef struct _HueSaturation HueSaturation;
typedef struct _PixelRegionIterator PixelRegionIterator;
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 81165ac..a4ad4b2 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -126,8 +126,6 @@ libappcore_a_sources = \
gimpdrawable-blend.h \
gimpdrawable-bucket-fill.c \
gimpdrawable-bucket-fill.h \
- gimpdrawable-color-balance.c \
- gimpdrawable-color-balance.h \
gimpdrawable-combine.c \
gimpdrawable-combine.h \
gimpdrawable-convert.c \
diff --git a/app/gegl/gimpcolorbalanceconfig.c b/app/gegl/gimpcolorbalanceconfig.c
index 05f9749..b20805b 100644
--- a/app/gegl/gimpcolorbalanceconfig.c
+++ b/app/gegl/gimpcolorbalanceconfig.c
@@ -29,9 +29,6 @@
#include "gimp-gegl-types.h"
-/* temp cruft */
-#include "base/color-balance.h"
-
#include "gimpcolorbalanceconfig.h"
@@ -356,27 +353,3 @@ gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config)
g_object_thaw_notify (G_OBJECT (config));
}
-
-
-/* temp cruft */
-
-void
-gimp_color_balance_config_to_cruft (GimpColorBalanceConfig *config,
- ColorBalance *cruft)
-{
- GimpTransferMode range;
-
- g_return_if_fail (GIMP_IS_COLOR_BALANCE_CONFIG (config));
- g_return_if_fail (cruft != NULL);
-
- for (range = GIMP_SHADOWS; range <= GIMP_HIGHLIGHTS; range++)
- {
- cruft->cyan_red[range] = config->cyan_red[range] * 100.0;
- cruft->magenta_green[range] = config->magenta_green[range] * 100.0;
- cruft->yellow_blue[range] = config->yellow_blue[range] * 100.0;
- }
-
- cruft->preserve_luminosity = config->preserve_luminosity;
-
- color_balance_create_lookup_tables (cruft);
-}
diff --git a/app/gegl/gimpcolorbalanceconfig.h b/app/gegl/gimpcolorbalanceconfig.h
index 778a776..d207db0 100644
--- a/app/gegl/gimpcolorbalanceconfig.h
+++ b/app/gegl/gimpcolorbalanceconfig.h
@@ -58,9 +58,5 @@ GType gimp_color_balance_config_get_type (void) G_GNUC_CONST;
void gimp_color_balance_config_reset_range (GimpColorBalanceConfig *config);
-/* temp cruft */
-void gimp_color_balance_config_to_cruft (GimpColorBalanceConfig *config,
- ColorBalance *cruft);
-
#endif /* __GIMP_COLOR_BALANCE_CONFIG_H__ */
diff --git a/app/pdb/color-cmds.c b/app/pdb/color-cmds.c
index 2392fb4..7da8252 100644
--- a/app/pdb/color-cmds.c
+++ b/app/pdb/color-cmds.c
@@ -23,7 +23,6 @@
#include "pdb-types.h"
-#include "core/gimpdrawable-color-balance.h"
#include "core/gimpdrawable-equalize.h"
#include "core/gimpdrawable-histogram.h"
#include "core/gimpdrawable-hue-saturation.h"
@@ -33,6 +32,7 @@
#include "core/gimphistogram.h"
#include "core/gimpparamspecs.h"
#include "gegl/gimpbrightnesscontrastconfig.h"
+#include "gegl/gimpcolorbalanceconfig.h"
#include "gegl/gimpcolorizeconfig.h"
#include "gegl/gimpcurvesconfig.h"
#include "gegl/gimpdesaturateconfig.h"
@@ -504,16 +504,29 @@ color_balance_invoker (GimpProcedure *procedure,
if (success)
{
- if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) ||
- ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
- gimp_drawable_is_indexed (drawable))
- success = FALSE;
+ if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
+ gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
+ {
+ GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
+ "range", transfer_mode,
+ "preserve-luminosity", preserve_lum,
+ NULL);
- if (success)
- gimp_drawable_color_balance (drawable, progress,
- transfer_mode,
- cyan_red, magenta_green, yellow_blue,
- preserve_lum);
+ g_object_set (config,
+ "cyan-red", cyan_red / 100.0,
+ "magenta-green", magenta_green / 100.0,
+ "yellow-blue", yellow_blue / 100.0,
+ NULL);
+
+ gimp_drawable_apply_operation_by_name (drawable, progress,
+ C_("undo-type", "Color Balance"),
+ "gimp:color-balance",
+ config);
+
+ g_object_unref (config);
+ }
+ else
+ success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c
index 8b701f6..5351842 100644
--- a/app/tools/gimpcolorbalancetool.c
+++ b/app/tools/gimpcolorbalancetool.c
@@ -27,8 +27,6 @@
#include "tools-types.h"
-#include "base/color-balance.h"
-
#include "gegl/gimpcolorbalanceconfig.h"
#include "core/gimpdrawable.h"
@@ -47,15 +45,12 @@
/* local function prototypes */
-static void gimp_color_balance_tool_finalize (GObject *object);
-
static gboolean gimp_color_balance_tool_initialize (GimpTool *tool,
GimpDisplay *display,
GError **error);
static GeglNode * gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool,
GObject **config);
-static void gimp_color_balance_tool_map (GimpImageMapTool *im_tool);
static void gimp_color_balance_tool_dialog (GimpImageMapTool *im_tool);
static void gimp_color_balance_tool_reset (GimpImageMapTool *im_tool);
@@ -102,12 +97,9 @@ gimp_color_balance_tool_register (GimpToolRegisterCallback callback,
static void
gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpImageMapToolClass *im_tool_class = GIMP_IMAGE_MAP_TOOL_CLASS (klass);
- object_class->finalize = gimp_color_balance_tool_finalize;
-
tool_class->initialize = gimp_color_balance_tool_initialize;
im_tool_class->dialog_desc = _("Adjust Color Balance");
@@ -116,7 +108,6 @@ gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
im_tool_class->export_dialog_title = _("Export Color Balance Settings");
im_tool_class->get_operation = gimp_color_balance_tool_get_operation;
- im_tool_class->map = gimp_color_balance_tool_map;
im_tool_class->dialog = gimp_color_balance_tool_dialog;
im_tool_class->reset = gimp_color_balance_tool_reset;
}
@@ -124,24 +115,6 @@ gimp_color_balance_tool_class_init (GimpColorBalanceToolClass *klass)
static void
gimp_color_balance_tool_init (GimpColorBalanceTool *cb_tool)
{
- GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (cb_tool);
-
- cb_tool->color_balance = g_slice_new0 (ColorBalance);
-
- color_balance_init (cb_tool->color_balance);
-
- im_tool->apply_func = (GimpImageMapApplyFunc) color_balance;
- im_tool->apply_data = cb_tool->color_balance;
-}
-
-static void
-gimp_color_balance_tool_finalize (GObject *object)
-{
- GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (object);
-
- g_slice_free (ColorBalance, cb_tool->color_balance);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
}
static gboolean
@@ -194,14 +167,6 @@ gimp_color_balance_tool_get_operation (GimpImageMapTool *im_tool,
return node;
}
-static void
-gimp_color_balance_tool_map (GimpImageMapTool *image_map_tool)
-{
- GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (image_map_tool);
-
- gimp_color_balance_config_to_cruft (cb_tool->config, cb_tool->color_balance);
-}
-
/**************************/
/* Color Balance dialog */
diff --git a/app/tools/gimpcolorbalancetool.h b/app/tools/gimpcolorbalancetool.h
index 8974750..3f6d891 100644
--- a/app/tools/gimpcolorbalancetool.h
+++ b/app/tools/gimpcolorbalancetool.h
@@ -39,7 +39,6 @@ struct _GimpColorBalanceTool
GimpImageMapTool parent_instance;
GimpColorBalanceConfig *config;
- ColorBalance *color_balance;
/* dialog */
GtkWidget *range_radio;
diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb
index 537cefc..dd6d83a 100644
--- a/tools/pdbgen/pdb/color.pdb
+++ b/tools/pdbgen/pdb/color.pdb
@@ -540,19 +540,32 @@ HELP
);
%invoke = (
- headers => [ qw("core/gimpdrawable-color-balance.h") ],
+ headers => [ qw("gegl/gimpcolorbalanceconfig.h") ],
code => <<'CODE'
{
- if (! gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) ||
- ! gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error) ||
- gimp_drawable_is_indexed (drawable))
- success = FALSE;
+ if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL, TRUE, error) &&
+ gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
+ {
+ GObject *config = g_object_new (GIMP_TYPE_COLORIZE_CONFIG,
+ "range", transfer_mode,
+ "preserve-luminosity", preserve_lum,
+ NULL);
- if (success)
- gimp_drawable_color_balance (drawable, progress,
- transfer_mode,
- cyan_red, magenta_green, yellow_blue,
- preserve_lum);
+ g_object_set (config,
+ "cyan-red", cyan_red / 100.0,
+ "magenta-green", magenta_green / 100.0,
+ "yellow-blue", yellow_blue / 100.0,
+ NULL);
+
+ gimp_drawable_apply_operation_by_name (drawable, progress,
+ C_("undo-type", "Color Balance"),
+ "gimp:color-balance",
+ config);
+
+ g_object_unref (config);
+ }
+ else
+ success = FALSE;
}
CODE
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]