[gimp/wip/passthrough: 17/26] app: add pass-through layer mode
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/passthrough: 17/26] app: add pass-through layer mode
- Date: Tue, 2 May 2017 15:14:25 +0000 (UTC)
commit 3d1dcaf5947340af54da773687a94422ed001e94
Author: Ell <ell_se yahoo com>
Date: Fri Apr 21 13:38:22 2017 -0400
app: add pass-through layer mode
Only add the enum-value/mode-info for now. Pass-through mode
appears above normal mode, in the default group, for layer groups
only.
app/core/gimpimage.c | 1 +
app/operations/layer-modes/gimp-layer-modes.c | 19 +++++++++++++++++++
.../layer-modes/gimpoperationlayermode.c | 1 +
app/operations/operations-enums.c | 2 ++
app/operations/operations-enums.h | 1 +
libgimp/gimpenums.h | 3 ++-
tools/pdbgen/enums.pl | 6 ++++--
7 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 8531253..7739aa8 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -2466,6 +2466,7 @@ gimp_image_get_xcf_version (GimpImage *image,
case GIMP_LAYER_MODE_ERASE:
case GIMP_LAYER_MODE_MERGE:
case GIMP_LAYER_MODE_SPLIT:
+ case GIMP_LAYER_MODE_PASS_THROUGH:
version = MAX (10, version);
break;
diff --git a/app/operations/layer-modes/gimp-layer-modes.c b/app/operations/layer-modes/gimp-layer-modes.c
index 0ce18a2..12a47e3 100644
--- a/app/operations/layer-modes/gimp-layer-modes.c
+++ b/app/operations/layer-modes/gimp-layer-modes.c
@@ -850,6 +850,17 @@ static const GimpLayerModeInfo layer_mode_infos[] =
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP
},
+ { GIMP_LAYER_MODE_PASS_THROUGH,
+
+ .op_name = "gimp:replace",
+ .function = gimp_operation_replace_process,
+ .flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
+ GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE,
+ .context = GIMP_LAYER_MODE_CONTEXT_GROUP,
+ .composite_mode = GIMP_LAYER_COMPOSITE_SRC_OVER,
+ .composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
+ },
+
{ GIMP_LAYER_MODE_REPLACE,
.op_name = "gimp:replace",
@@ -875,6 +886,10 @@ static const GimpLayerModeInfo layer_mode_infos[] =
static const GimpLayerMode layer_mode_group_default[] =
{
+ GIMP_LAYER_MODE_PASS_THROUGH,
+
+ GIMP_LAYER_MODE_SEPARATOR,
+
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_REPLACE,
GIMP_LAYER_MODE_DISSOLVE,
@@ -1123,6 +1138,10 @@ static const GimpLayerMode layer_mode_groups[][2] =
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
},
+ { [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_PASS_THROUGH,
+ [GIMP_LAYER_MODE_GROUP_LEGACY ] = -1,
+ },
+
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_REPLACE,
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1
},
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c
b/app/operations/layer-modes/gimpoperationlayermode.c
index c9d18b5..7706a76 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -2488,6 +2488,7 @@ gimp_layer_mode_get_blend_fun (GimpLayerMode mode)
case GIMP_LAYER_MODE_ERASE:
case GIMP_LAYER_MODE_MERGE:
case GIMP_LAYER_MODE_SPLIT:
+ case GIMP_LAYER_MODE_PASS_THROUGH:
case GIMP_LAYER_MODE_REPLACE:
case GIMP_LAYER_MODE_ANTI_ERASE:
case GIMP_LAYER_MODE_SEPARATOR: /* to stop GCC from complaining :P */
diff --git a/app/operations/operations-enums.c b/app/operations/operations-enums.c
index b60e2a6..ee0d488 100644
--- a/app/operations/operations-enums.c
+++ b/app/operations/operations-enums.c
@@ -142,6 +142,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
{ GIMP_LAYER_MODE_MERGE, "GIMP_LAYER_MODE_MERGE", "merge" },
{ GIMP_LAYER_MODE_SPLIT, "GIMP_LAYER_MODE_SPLIT", "split" },
+ { GIMP_LAYER_MODE_PASS_THROUGH, "GIMP_LAYER_MODE_PASS_THROUGH", "pass-through" },
{ GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
{ GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
{ 0, NULL, NULL }
@@ -210,6 +211,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
{ GIMP_LAYER_MODE_MERGE, NC_("layer-mode", "Merge"), NULL },
{ GIMP_LAYER_MODE_SPLIT, NC_("layer-mode", "Split"), NULL },
+ { GIMP_LAYER_MODE_PASS_THROUGH, NC_("layer-mode", "Pass through"), NULL },
{ GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
{ GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
{ 0, NULL, NULL }
diff --git a/app/operations/operations-enums.h b/app/operations/operations-enums.h
index 59f2860..c1cd056 100644
--- a/app/operations/operations-enums.h
+++ b/app/operations/operations-enums.h
@@ -122,6 +122,7 @@ typedef enum
GIMP_LAYER_MODE_ERASE, /*< desc="Erase" >*/
GIMP_LAYER_MODE_MERGE, /*< desc="Merge" >*/
GIMP_LAYER_MODE_SPLIT, /*< desc="Split" >*/
+ GIMP_LAYER_MODE_PASS_THROUGH, /*< desc="Pass through" >*/
/* Internal modes, not available to the PDB, must be kept at the end */
GIMP_LAYER_MODE_REPLACE, /*< pdb-skip, desc="Replace" >*/
diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h
index 4ccc4ad..ab09488 100644
--- a/libgimp/gimpenums.h
+++ b/libgimp/gimpenums.h
@@ -155,7 +155,8 @@ typedef enum
GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_LAYER_MODE_ERASE,
GIMP_LAYER_MODE_MERGE,
- GIMP_LAYER_MODE_SPLIT
+ GIMP_LAYER_MODE_SPLIT,
+ GIMP_LAYER_MODE_PASS_THROUGH
} GimpLayerMode;
diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl
index 6273438..b828ca8 100644
--- a/tools/pdbgen/enums.pl
+++ b/tools/pdbgen/enums.pl
@@ -750,7 +750,8 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY
GIMP_LAYER_MODE_LUMINANCE
GIMP_LAYER_MODE_COLOR_ERASE GIMP_LAYER_MODE_ERASE
- GIMP_LAYER_MODE_MERGE GIMP_LAYER_MODE_SPLIT) ],
+ GIMP_LAYER_MODE_MERGE GIMP_LAYER_MODE_SPLIT
+ GIMP_LAYER_MODE_PASS_THROUGH) ],
mapping => { GIMP_LAYER_MODE_NORMAL_LEGACY => '0',
GIMP_LAYER_MODE_DISSOLVE => '1',
GIMP_LAYER_MODE_BEHIND_LEGACY => '2',
@@ -811,7 +812,8 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_COLOR_ERASE => '57',
GIMP_LAYER_MODE_ERASE => '58',
GIMP_LAYER_MODE_MERGE => '59',
- GIMP_LAYER_MODE_SPLIT => '60' }
+ GIMP_LAYER_MODE_SPLIT => '60',
+ GIMP_LAYER_MODE_PASS_THROUGH => '61' }
},
GimpConvertDitherType =>
{ contig => 1,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]