Commit 440d8d68 authored by Ell's avatar Ell

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.
parent 7ecd3f27
......@@ -2374,6 +2374,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;
......
......@@ -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
},
......
......@@ -2491,6 +2491,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 */
......
......@@ -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 }
......
......@@ -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" >*/
......
......@@ -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;
......
......@@ -756,7 +756,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',
......@@ -817,7 +818,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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment