[gimp/pippin/linear-is-the-new-black: 9/10] app: enable pin, vivid and linear light modes
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/pippin/linear-is-the-new-black: 9/10] app: enable pin, vivid and linear light modes
- Date: Mon, 23 Jan 2017 16:20:12 +0000 (UTC)
commit 2f2c376aee1402840dbad3092d8c2c8919477090
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Jan 23 16:24:13 2017 +0100
app: enable pin, vivid and linear light modes
app/core/core-enums.c | 20 +++++++++++
app/core/core-enums.h | 10 +++++
app/core/gimp-layer-modes.c | 36 +++++++++++++++++---
.../layer-modes/gimpoperationlayermode.c | 10 +++---
app/widgets/gimpwidgets-constructors.c | 9 ++++-
5 files changed, 73 insertions(+), 12 deletions(-)
---
diff --git a/app/core/core-enums.c b/app/core/core-enums.c
index 3e7b530..12e2e80 100644
--- a/app/core/core-enums.c
+++ b/app/core/core-enums.c
@@ -352,6 +352,16 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR, "GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR", "grain-extract-linear" },
{ GIMP_LAYER_MODE_GRAIN_MERGE, "GIMP_LAYER_MODE_GRAIN_MERGE", "grain-merge" },
{ GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR, "GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR", "grain-merge-linear" },
+ { GIMP_LAYER_MODE_VIVID_LIGHT, "GIMP_LAYER_MODE_VIVID_LIGHT", "vivid-light" },
+ { GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR, "GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR", "vivid-light-linear" },
+ { GIMP_LAYER_MODE_PIN_LIGHT, "GIMP_LAYER_MODE_PIN_LIGHT", "pin-light" },
+ { GIMP_LAYER_MODE_PIN_LIGHT_LINEAR, "GIMP_LAYER_MODE_PIN_LIGHT_LINEAR", "pin-light-linear" },
+ { GIMP_LAYER_MODE_LINEAR_LIGHT, "GIMP_LAYER_MODE_LINEAR_LIGHT", "linear-light" },
+ { GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR, "GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR", "linear-light-linear" },
+ { GIMP_LAYER_MODE_EXCLUSION, "GIMP_LAYER_MODE_EXCLUSION", "exclusion" },
+ { GIMP_LAYER_MODE_EXCLUSION_LINEAR, "GIMP_LAYER_MODE_EXCLUSION_LINEAR", "exclusion-linear" },
+ { GIMP_LAYER_MODE_LINEAR_BURN, "GIMP_LAYER_MODE_LINEAR_BURN", "linear-burn" },
+ { GIMP_LAYER_MODE_LINEAR_BURN_LINEAR, "GIMP_LAYER_MODE_LINEAR_BURN_LINEAR", "linear-burn-linear" },
{ GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
{ GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
{ GIMP_LAYER_MODE_ANTI_ERASE, "GIMP_LAYER_MODE_ANTI_ERASE", "anti-erase" },
@@ -423,6 +433,16 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR, NC_("layer-mode", "Grain extract (linear)"), NULL },
{ GIMP_LAYER_MODE_GRAIN_MERGE, NC_("layer-mode", "Grain merge"), NULL },
{ GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR, NC_("layer-mode", "Grain merge (linear)"), NULL },
+ { GIMP_LAYER_MODE_VIVID_LIGHT, NC_("layer-mode", "Vivid light"), NULL },
+ { GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR, NC_("layer-mode", "Vivid light (linear)"), NULL },
+ { GIMP_LAYER_MODE_PIN_LIGHT, NC_("layer-mode", "Pin light"), NULL },
+ { GIMP_LAYER_MODE_PIN_LIGHT_LINEAR, NC_("layer-mode", "Pin light (linear)"), NULL },
+ { GIMP_LAYER_MODE_LINEAR_LIGHT, NC_("layer-mode", "Linear light"), NULL },
+ { GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR, NC_("layer-mode", "Linear light (linear)"), NULL },
+ { GIMP_LAYER_MODE_EXCLUSION, NC_("layer-mode", "Exclusion"), NULL },
+ { GIMP_LAYER_MODE_EXCLUSION_LINEAR, NC_("layer-mode", "Exclusion (linear)"), NULL },
+ { GIMP_LAYER_MODE_LINEAR_BURN, NC_("layer-mode", "Linear light"), NULL },
+ { GIMP_LAYER_MODE_LINEAR_BURN_LINEAR, NC_("layer-mode", "Linear burn (linear)"), NULL },
{ GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
{ GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
{ GIMP_LAYER_MODE_ANTI_ERASE, NC_("layer-mode", "Anti erase"), NULL },
diff --git a/app/core/core-enums.h b/app/core/core-enums.h
index 4b2ae31..acd103f 100644
--- a/app/core/core-enums.h
+++ b/app/core/core-enums.h
@@ -222,6 +222,16 @@ typedef enum
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR, /*< desc="Grain extract (linear)" >*/
GIMP_LAYER_MODE_GRAIN_MERGE, /*< desc="Grain merge" >*/
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR, /*< desc="Grain merge (linear)" >*/
+ GIMP_LAYER_MODE_VIVID_LIGHT, /*< desc="Vivid light" >*/
+ GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR, /*< desc="Vivid light (linear)" >*/
+ GIMP_LAYER_MODE_PIN_LIGHT, /*< desc="Pin light" >*/
+ GIMP_LAYER_MODE_PIN_LIGHT_LINEAR, /*< desc="Pin light (linear)" >*/
+ GIMP_LAYER_MODE_LINEAR_LIGHT, /*< desc="Linear light" >*/
+ GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR, /*< desc="Linear light (linear)" >*/
+ GIMP_LAYER_MODE_EXCLUSION, /*< desc="Exclusion" >*/
+ GIMP_LAYER_MODE_EXCLUSION_LINEAR, /*< desc="Exclusion (linear)" >*/
+ GIMP_LAYER_MODE_LINEAR_BURN, /*< desc="Linear light" >*/
+ GIMP_LAYER_MODE_LINEAR_BURN_LINEAR, /*< desc="Linear burn (linear)" >*/
/* Internal modes, not available to the PDB */
GIMP_LAYER_MODE_ERASE = 1000, /*< pdb-skip, desc="Erase" >*/
diff --git a/app/core/gimp-layer-modes.c b/app/core/gimp-layer-modes.c
index d476156..0726502 100644
--- a/app/core/gimp-layer-modes.c
+++ b/app/core/gimp-layer-modes.c
@@ -127,6 +127,11 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_MERGE:
+ case GIMP_LAYER_MODE_VIVID_LIGHT:
+ case GIMP_LAYER_MODE_PIN_LIGHT:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT:
+ case GIMP_LAYER_MODE_EXCLUSION:
+ case GIMP_LAYER_MODE_LINEAR_BURN:
return TRUE;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
@@ -145,6 +150,11 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
+ case GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_PIN_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
return TRUE;
case GIMP_LAYER_MODE_ERASE:
@@ -157,7 +167,7 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
return TRUE;
}
- return FALSE;
+ return TRUE;
}
GimpLayerColorSpace
@@ -226,6 +236,11 @@ gimp_layer_mode_get_blend_space (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_MERGE:
+ case GIMP_LAYER_MODE_VIVID_LIGHT:
+ case GIMP_LAYER_MODE_PIN_LIGHT:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT:
+ case GIMP_LAYER_MODE_EXCLUSION:
+ case GIMP_LAYER_MODE_LINEAR_BURN:
return GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
@@ -244,6 +259,11 @@ gimp_layer_mode_get_blend_space (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
+ case GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_PIN_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
case GIMP_LAYER_MODE_ERASE:
@@ -327,6 +347,11 @@ gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_MERGE:
+ case GIMP_LAYER_MODE_VIVID_LIGHT:
+ case GIMP_LAYER_MODE_PIN_LIGHT:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT:
+ case GIMP_LAYER_MODE_EXCLUSION:
+ case GIMP_LAYER_MODE_LINEAR_BURN:
return GIMP_LAYER_COMPOSITE_SRC_ATOP;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
@@ -345,6 +370,11 @@ gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
+ case GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_PIN_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR:
+ case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
+ case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
return GIMP_LAYER_COMPOSITE_SRC_ATOP;
case GIMP_LAYER_MODE_ERASE:
@@ -443,10 +473,6 @@ gimp_layer_mode_get_operation (GimpLayerMode mode)
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
return "gimp:grain-merge-legacy";
- case GIMP_LAYER_MODE_GRAIN_MERGE:
- case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
- return "gimp:grain-merge";
-
case GIMP_LAYER_MODE_COLOR_ERASE:
return "gimp:color-erase";
diff --git a/app/operations/layer-modes/gimpoperationlayermode.c
b/app/operations/layer-modes/gimpoperationlayermode.c
index c43fafe..c7676fc 100644
--- a/app/operations/layer-modes/gimpoperationlayermode.c
+++ b/app/operations/layer-modes/gimpoperationlayermode.c
@@ -322,11 +322,11 @@ static inline GimpBlendFunc gimp_layer_mode_get_blend_fun (GimpLayerMode mode)
case GIMP_LAYER_MODE_DIFFERENCE: return blendfun_difference;
case GIMP_LAYER_MODE_DARKEN_ONLY: return blendfun_darken_only;
case GIMP_LAYER_MODE_LIGHTEN_ONLY: return blendfun_lighten_only;
- //case GIMP_LAYER_MODE_VIVID_LIGHT: return blendfun_vivid_light;
- //case GIMP_LAYER_MODE_PIN_LIGHT: return blendfun_pin_light;
- //case GIMP_LAYER_MODE_LINEAR_LIGHT: return blendfun_linear_light;
- //case GIMP_LAYER_MODE_EXCLUSION: return blendfun_exclusion;
- //case GIMP_LAYER_MODE_LINEAR_BURN: return blendfun_linear_burn;
+ case GIMP_LAYER_MODE_VIVID_LIGHT: return blendfun_vivid_light;
+ case GIMP_LAYER_MODE_PIN_LIGHT: return blendfun_pin_light;
+ case GIMP_LAYER_MODE_LINEAR_LIGHT: return blendfun_linear_light;
+ case GIMP_LAYER_MODE_EXCLUSION: return blendfun_exclusion;
+ case GIMP_LAYER_MODE_LINEAR_BURN: return blendfun_linear_burn;
default:
return (void*)dummy_fun;
}
diff --git a/app/widgets/gimpwidgets-constructors.c b/app/widgets/gimpwidgets-constructors.c
index 4c8a875..80e4fa3 100644
--- a/app/widgets/gimpwidgets-constructors.c
+++ b/app/widgets/gimpwidgets-constructors.c
@@ -123,15 +123,20 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
GIMP_LAYER_MODE_MULTIPLY_LEGACY,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LEGACY,
+ GIMP_LAYER_MODE_LINEAR_BURN,
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
+ GIMP_LAYER_MODE_VIVID_LIGHT,
+ GIMP_LAYER_MODE_PIN_LIGHT,
+ GIMP_LAYER_MODE_LINEAR_LIGHT,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LEGACY,
+ GIMP_LAYER_MODE_EXCLUSION,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
GIMP_LAYER_MODE_GRAIN_MERGE,
@@ -158,10 +163,10 @@ gimp_paint_mode_menu_new (gboolean with_behind_mode,
GIMP_LAYER_MODE_ADDITION_LEGACY, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
- GIMP_LAYER_MODE_BURN_LEGACY, -1);
+ GIMP_LAYER_MODE_LINEAR_BURN, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
- GIMP_LAYER_MODE_HARDLIGHT_LEGACY, -1);
+ GIMP_LAYER_MODE_LINEAR_LIGHT, -1);
gimp_int_store_insert_separator_after (GIMP_INT_STORE (store),
GIMP_LAYER_MODE_DIVIDE_LEGACY, -1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]