Commit 9397aff9 authored by Michael Natterer's avatar Michael Natterer 😴
Browse files

app: add GIMP_LAYER_MODE_LUMA_DARKEN_ONLY and _LUMA_DARKEN_ONLY

which are perceptual versions of the new LUMINANCE_DARKEN_ONLY and
LUMINANCE_LIGHTEN_ONLY modes. Add the new modes to the UI.
parent 7fd76c93
......@@ -360,7 +360,9 @@ gimp_layer_mode_get_type (void)
{ 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_LUMA_DARKEN_ONLY, "GIMP_LAYER_MODE_LUMA_DARKEN_ONLY", "luma-darken-only" },
{ GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY, "GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY", "luminance-darken-only" },
{ GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, "GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY", "luma-lighten-only" },
{ GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY, "GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY", "luminance-lighten-only" },
{ GIMP_LAYER_MODE_ERASE, "GIMP_LAYER_MODE_ERASE", "erase" },
{ GIMP_LAYER_MODE_REPLACE, "GIMP_LAYER_MODE_REPLACE", "replace" },
......@@ -441,7 +443,9 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_EXCLUSION_LINEAR, NC_("layer-mode", "Exclusion (linear)"), NULL },
{ GIMP_LAYER_MODE_LINEAR_BURN, NC_("layer-mode", "Linear burn"), NULL },
{ GIMP_LAYER_MODE_LINEAR_BURN_LINEAR, NC_("layer-mode", "Linear burn (linear)"), NULL },
{ GIMP_LAYER_MODE_LUMA_DARKEN_ONLY, NC_("layer-mode", "Luma darken only"), NULL },
{ GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY, NC_("layer-mode", "Luminance darken only"), NULL },
{ GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, NC_("layer-mode", "Luma lighten only"), NULL },
{ GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY, NC_("layer-mode", "Luminance lighten only"), NULL },
{ GIMP_LAYER_MODE_ERASE, NC_("layer-mode", "Erase"), NULL },
{ GIMP_LAYER_MODE_REPLACE, NC_("layer-mode", "Replace"), NULL },
......
......@@ -230,7 +230,9 @@ typedef enum
GIMP_LAYER_MODE_EXCLUSION_LINEAR, /*< desc="Exclusion (linear)" >*/
GIMP_LAYER_MODE_LINEAR_BURN, /*< desc="Linear burn" >*/
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR, /*< desc="Linear burn (linear)" >*/
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY, /*< desc="Luma darken only" >*/
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY, /*< desc="Luminance darken only" >*/
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, /*< desc="Luma lighten only" >*/
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,/*< desc="Luminance lighten only" >*/
/* Internal modes, not available to the PDB */
......
......@@ -118,8 +118,6 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
case GIMP_LAYER_MODE_SUBTRACT:
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_HSV_HUE:
case GIMP_LAYER_MODE_HSV_SATURATION:
case GIMP_LAYER_MODE_HSV_COLOR:
......@@ -136,6 +134,8 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
case GIMP_LAYER_MODE_LINEAR_LIGHT:
case GIMP_LAYER_MODE_EXCLUSION:
case GIMP_LAYER_MODE_LINEAR_BURN:
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
return TRUE;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
......@@ -157,6 +157,8 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
case GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR:
case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
return TRUE;
case GIMP_LAYER_MODE_ERASE:
......@@ -237,6 +239,8 @@ gimp_layer_mode_get_blend_space (GimpLayerMode mode)
case GIMP_LAYER_MODE_LINEAR_LIGHT:
case GIMP_LAYER_MODE_EXCLUSION:
case GIMP_LAYER_MODE_LINEAR_BURN:
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
return GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
......@@ -248,8 +252,6 @@ gimp_layer_mode_get_blend_space (GimpLayerMode mode)
case GIMP_LAYER_MODE_SUBTRACT_LINEAR:
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_DIVIDE_LINEAR:
case GIMP_LAYER_MODE_DODGE_LINEAR:
case GIMP_LAYER_MODE_BURN_LINEAR:
......@@ -262,6 +264,8 @@ gimp_layer_mode_get_blend_space (GimpLayerMode mode)
case GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR:
case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
case GIMP_LAYER_MODE_ERASE:
......@@ -329,8 +333,6 @@ gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
case GIMP_LAYER_MODE_SUBTRACT_LINEAR:
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_HSV_HUE:
case GIMP_LAYER_MODE_HSV_SATURATION:
case GIMP_LAYER_MODE_HSV_COLOR:
......@@ -359,7 +361,11 @@ gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
case GIMP_LAYER_MODE_EXCLUSION_LINEAR:
case GIMP_LAYER_MODE_LINEAR_BURN:
case GIMP_LAYER_MODE_LINEAR_BURN_LINEAR:
return GIMP_LAYER_COMPOSITE_SRC_ATOP;
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
return GIMP_LAYER_COMPOSITE_SRC_ATOP;
case GIMP_LAYER_MODE_ERASE:
case GIMP_LAYER_MODE_REPLACE:
......@@ -685,14 +691,14 @@ gimp_layer_mode_get_for_group (GimpLayerMode old_mode,
{
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
-1
},
{
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
-1
},
......
......@@ -1781,8 +1781,10 @@ 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_LUMINANCE_DARKEN_ONLY: return blendfun_luminance_darken_only;
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY: return blendfun_luminance_lighten_only;
case GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY: return blendfun_luminance_darken_only;
case GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY: return blendfun_luminance_lighten_only;
case GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR:
case GIMP_LAYER_MODE_VIVID_LIGHT: return blendfun_vivid_light;
case GIMP_LAYER_MODE_PIN_LIGHT_LINEAR:
......
......@@ -334,14 +334,16 @@ gimp_layer_mode_combo_box_create_default_model (GimpLayerModeComboBox *combo)
GtkListStore *store;
store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
30,
32,
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_OVERLAY,
......@@ -419,14 +421,16 @@ gimp_layer_mode_combo_box_create_linear_model (GimpLayerModeComboBox *combo)
GtkListStore *store;
store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
22,
24,
GIMP_LAYER_MODE_NORMAL_LINEAR,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_SCREEN_LINEAR,
GIMP_LAYER_MODE_DODGE_LINEAR,
GIMP_LAYER_MODE_ADDITION_LINEAR,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_MULTIPLY_LINEAR,
GIMP_LAYER_MODE_BURN_LINEAR,
GIMP_LAYER_MODE_OVERLAY_LINEAR,
......@@ -487,14 +491,16 @@ gimp_layer_mode_combo_box_create_perceptual_model (GimpLayerModeComboBox *combo)
GtkListStore *store;
store = gimp_enum_store_new_with_values (GIMP_TYPE_LAYER_MODE,
30,
32,
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_OVERLAY,
......
......@@ -140,7 +140,9 @@ typedef enum
GIMP_LAYER_MODE_EXCLUSION_LINEAR,
GIMP_LAYER_MODE_LINEAR_BURN,
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR,
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY
} GimpLayerMode;
......
......@@ -761,7 +761,9 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_EXCLUSION_LINEAR
GIMP_LAYER_MODE_LINEAR_BURN
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY) ],
mapping => { GIMP_LAYER_MODE_NORMAL => '0',
GIMP_LAYER_MODE_DISSOLVE => '1',
......@@ -834,8 +836,10 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_EXCLUSION_LINEAR => '68',
GIMP_LAYER_MODE_LINEAR_BURN => '69',
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR => '70',
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY => '71',
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY => '72' }
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY => '71',
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY => '72',
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY => '73',
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY => '74' }
},
GimpBrushApplicationMode =>
{ 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