[gimp] pdb: make channel-mixer compat function use mono-mixer for monochrome mode
- From: Alexia Death <alexiade src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] pdb: make channel-mixer compat function use mono-mixer for monochrome mode
- Date: Wed, 10 Dec 2014 22:30:59 +0000 (UTC)
commit 6f582ba527b9fcb50230797ae9991c00fdeb120e
Author: Alexia Death <alexiadeath gmail com>
Date: Thu Dec 11 00:29:58 2014 +0200
pdb: make channel-mixer compat function use mono-mixer for monochrome mode
This is preparation of removing monochrome mode from the channel
mixer op, as there is already mono mixer doing the exact same thing
app/pdb/plug-in-compat-cmds.c | 41 +++++++++++++++++++++++------------
tools/pdbgen/pdb/plug_in_compat.pdb | 41 +++++++++++++++++++++++------------
2 files changed, 54 insertions(+), 28 deletions(-)
---
diff --git a/app/pdb/plug-in-compat-cmds.c b/app/pdb/plug-in-compat-cmds.c
index 454722f..3fd60be 100644
--- a/app/pdb/plug-in-compat-cmds.c
+++ b/app/pdb/plug-in-compat-cmds.c
@@ -635,20 +635,33 @@ plug_in_colors_channel_mixer_invoker (GimpProcedure *procedure,
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
- GeglNode *node =
- gegl_node_new_child (NULL,
- "operation", "gegl:channel-mixer",
- "monochrome", (gboolean) monochrome,
- "rr-gain", (gdouble) rr_gain,
- "rg-gain", (gdouble) rg_gain,
- "rb-gain", (gdouble) rb_gain,
- "gr-gain", (gdouble) gr_gain,
- "gg-gain", (gdouble) gg_gain,
- "gb-gain", (gdouble) gb_gain,
- "br-gain", (gdouble) br_gain,
- "bg-gain", (gdouble) bg_gain,
- "bb-gain", (gdouble) bb_gain,
- NULL);
+ GeglNode *node = NULL;
+ if ((gboolean) monochrome)
+ {
+ node =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:mono-mixer",
+ "red", (gdouble) rr_gain,
+ "green", (gdouble) rg_gain,
+ "blue", (gdouble) rb_gain,
+ NULL);
+ }
+ else
+ {
+ node =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:channel-mixer",
+ "rr-gain", (gdouble) rr_gain,
+ "rg-gain", (gdouble) rg_gain,
+ "rb-gain", (gdouble) rb_gain,
+ "gr-gain", (gdouble) gr_gain,
+ "gg-gain", (gdouble) gg_gain,
+ "gb-gain", (gdouble) gb_gain,
+ "br-gain", (gdouble) br_gain,
+ "bg-gain", (gdouble) bg_gain,
+ "bb-gain", (gdouble) bb_gain,
+ NULL);
+ }
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Channel Mixer"),
diff --git a/tools/pdbgen/pdb/plug_in_compat.pdb b/tools/pdbgen/pdb/plug_in_compat.pdb
index c5bf2cb..9ac21ed 100644
--- a/tools/pdbgen/pdb/plug_in_compat.pdb
+++ b/tools/pdbgen/pdb/plug_in_compat.pdb
@@ -513,20 +513,33 @@ HELP
GIMP_PDB_ITEM_CONTENT, error) &&
gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
{
- GeglNode *node =
- gegl_node_new_child (NULL,
- "operation", "gegl:channel-mixer",
- "monochrome", (gboolean) monochrome,
- "rr-gain", (gdouble) rr_gain,
- "rg-gain", (gdouble) rg_gain,
- "rb-gain", (gdouble) rb_gain,
- "gr-gain", (gdouble) gr_gain,
- "gg-gain", (gdouble) gg_gain,
- "gb-gain", (gdouble) gb_gain,
- "br-gain", (gdouble) br_gain,
- "bg-gain", (gdouble) bg_gain,
- "bb-gain", (gdouble) bb_gain,
- NULL);
+ GeglNode *node = NULL;
+ if ((gboolean) monochrome)
+ {
+ node =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:mono-mixer",
+ "red", (gdouble) rr_gain,
+ "green", (gdouble) rg_gain,
+ "blue", (gdouble) rb_gain,
+ NULL);
+ }
+ else
+ {
+ node =
+ gegl_node_new_child (NULL,
+ "operation", "gegl:channel-mixer",
+ "rr-gain", (gdouble) rr_gain,
+ "rg-gain", (gdouble) rg_gain,
+ "rb-gain", (gdouble) rb_gain,
+ "gr-gain", (gdouble) gr_gain,
+ "gg-gain", (gdouble) gg_gain,
+ "gb-gain", (gdouble) gb_gain,
+ "br-gain", (gdouble) br_gain,
+ "bg-gain", (gdouble) bg_gain,
+ "bb-gain", (gdouble) bb_gain,
+ NULL);
+ }
gimp_drawable_apply_operation (drawable, progress,
C_("undo-type", "Channel Mixer"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]