Commit 6bf9e47b authored by Michael Natterer's avatar Michael Natterer 😴

app, libgimp: add linear variants of most layer modes

and reorder gimp_gegl_mode_node_set_mode() and friends.
parent 5951d399
......@@ -323,21 +323,31 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_MULTIPLY_LINEAR, "GIMP_LAYER_MODE_MULTIPLY_LINEAR", "multiply-linear" },
{ GIMP_LAYER_MODE_SCREEN, "GIMP_LAYER_MODE_SCREEN", "screen" },
{ GIMP_LAYER_MODE_DIFFERENCE, "GIMP_LAYER_MODE_DIFFERENCE", "difference" },
{ GIMP_LAYER_MODE_DIFFERENCE_LINEAR, "GIMP_LAYER_MODE_DIFFERENCE_LINEAR", "difference-linear" },
{ GIMP_LAYER_MODE_ADDITION, "GIMP_LAYER_MODE_ADDITION", "addition" },
{ GIMP_LAYER_MODE_ADDITION_LINEAR, "GIMP_LAYER_MODE_ADDITION_LINEAR", "addition-linear" },
{ GIMP_LAYER_MODE_SUBTRACT, "GIMP_LAYER_MODE_SUBTRACT", "subtract" },
{ GIMP_LAYER_MODE_SUBTRACT_LINEAR, "GIMP_LAYER_MODE_SUBTRACT_LINEAR", "subtract-linear" },
{ GIMP_LAYER_MODE_DARKEN_ONLY, "GIMP_LAYER_MODE_DARKEN_ONLY", "darken-only" },
{ GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR, "GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR", "darken-only-linear" },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY, "GIMP_LAYER_MODE_LIGHTEN_ONLY", "lighten-only" },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR, "GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR", "lighten-only-linear" },
{ GIMP_LAYER_MODE_HSV_HUE, "GIMP_LAYER_MODE_HSV_HUE", "hsv-hue" },
{ GIMP_LAYER_MODE_HSV_SATURATION, "GIMP_LAYER_MODE_HSV_SATURATION", "hsv-saturation" },
{ GIMP_LAYER_MODE_HSV_COLOR, "GIMP_LAYER_MODE_HSV_COLOR", "hsv-color" },
{ GIMP_LAYER_MODE_HSV_VALUE, "GIMP_LAYER_MODE_HSV_VALUE", "hsv-value" },
{ GIMP_LAYER_MODE_DIVIDE, "GIMP_LAYER_MODE_DIVIDE", "divide" },
{ GIMP_LAYER_MODE_DIVIDE_LINEAR, "GIMP_LAYER_MODE_DIVIDE_LINEAR", "divide-linear" },
{ GIMP_LAYER_MODE_DODGE, "GIMP_LAYER_MODE_DODGE", "dodge" },
{ GIMP_LAYER_MODE_DODGE_LINEAR, "GIMP_LAYER_MODE_DODGE_LINEAR", "dodge-linear" },
{ GIMP_LAYER_MODE_BURN, "GIMP_LAYER_MODE_BURN", "burn" },
{ GIMP_LAYER_MODE_BURN_LINEAR, "GIMP_LAYER_MODE_BURN_LINEAR", "burn-linear" },
{ GIMP_LAYER_MODE_HARDLIGHT, "GIMP_LAYER_MODE_HARDLIGHT", "hardlight" },
{ GIMP_LAYER_MODE_SOFTLIGHT, "GIMP_LAYER_MODE_SOFTLIGHT", "softlight" },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT, "GIMP_LAYER_MODE_GRAIN_EXTRACT", "grain-extract" },
{ 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_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" },
......@@ -380,21 +390,31 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_MULTIPLY_LINEAR, NC_("layer-mode", "Multiply (linear)"), NULL },
{ GIMP_LAYER_MODE_SCREEN, NC_("layer-mode", "Screen"), NULL },
{ GIMP_LAYER_MODE_DIFFERENCE, NC_("layer-mode", "Difference"), NULL },
{ GIMP_LAYER_MODE_DIFFERENCE_LINEAR, NC_("layer-mode", "Difference (linear)"), NULL },
{ GIMP_LAYER_MODE_ADDITION, NC_("layer-mode", "Addition"), NULL },
{ GIMP_LAYER_MODE_ADDITION_LINEAR, NC_("layer-mode", "Addition (linear)"), NULL },
{ GIMP_LAYER_MODE_SUBTRACT, NC_("layer-mode", "Subtract"), NULL },
{ GIMP_LAYER_MODE_SUBTRACT_LINEAR, NC_("layer-mode", "Subtract (linear)"), NULL },
{ GIMP_LAYER_MODE_DARKEN_ONLY, NC_("layer-mode", "Darken only"), NULL },
{ GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR, NC_("layer-mode", "Darken only (linear)"), NULL },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY, NC_("layer-mode", "Lighten only"), NULL },
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR, NC_("layer-mode", "Lighten only (linear)"), NULL },
{ GIMP_LAYER_MODE_HSV_HUE, NC_("layer-mode", "Hue (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_SATURATION, NC_("layer-mode", "Saturation (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_COLOR, NC_("layer-mode", "Color (HSV)"), NULL },
{ GIMP_LAYER_MODE_HSV_VALUE, NC_("layer-mode", "Value (HSV)"), NULL },
{ GIMP_LAYER_MODE_DIVIDE, NC_("layer-mode", "Divide"), NULL },
{ GIMP_LAYER_MODE_DIVIDE_LINEAR, NC_("layer-mode", "Divide (linear)"), NULL },
{ GIMP_LAYER_MODE_DODGE, NC_("layer-mode", "Dodge"), NULL },
{ GIMP_LAYER_MODE_DODGE_LINEAR, NC_("layer-mode", "Dodge (linear)"), NULL },
{ GIMP_LAYER_MODE_BURN, NC_("layer-mode", "Burn"), NULL },
{ GIMP_LAYER_MODE_BURN_LINEAR, NC_("layer-mode", "Burn (linear)"), NULL },
{ GIMP_LAYER_MODE_HARDLIGHT, NC_("layer-mode", "Hard light"), NULL },
{ GIMP_LAYER_MODE_SOFTLIGHT, NC_("layer-mode", "Soft light"), NULL },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT, NC_("layer-mode", "Grain extract"), NULL },
{ 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_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 },
......
......@@ -180,39 +180,49 @@ typedef enum
GIMP_LAYER_MODE_COLOR_ERASE, /*< desc="Color erase" >*/
/* Since 2.8 */
GIMP_LAYER_MODE_OVERLAY, /*< desc="Overlay" >*/
GIMP_LAYER_MODE_LCH_HUE, /*< desc="Hue (LCH)" >*/
GIMP_LAYER_MODE_LCH_CHROMA, /*< desc="Chroma (LCH)" >*/
GIMP_LAYER_MODE_LCH_COLOR, /*< desc="Color (LCH)" >*/
GIMP_LAYER_MODE_LCH_LIGHTNESS, /*< desc="Lightness (LCH)" >*/
GIMP_LAYER_MODE_OVERLAY, /*< desc="Overlay" >*/
GIMP_LAYER_MODE_LCH_HUE, /*< desc="Hue (LCH)" >*/
GIMP_LAYER_MODE_LCH_CHROMA, /*< desc="Chroma (LCH)" >*/
GIMP_LAYER_MODE_LCH_COLOR, /*< desc="Color (LCH)" >*/
GIMP_LAYER_MODE_LCH_LIGHTNESS, /*< desc="Lightness (LCH)" >*/
/* Since 2.10 */
GIMP_LAYER_MODE_NORMAL, /*< desc="Normal" >*/
GIMP_LAYER_MODE_BEHIND, /*< desc="Behind" >*/
GIMP_LAYER_MODE_MULTIPLY, /*< desc="Multiply" >*/
GIMP_LAYER_MODE_MULTIPLY_LINEAR, /*< desc="Multiply (linear)" >*/
GIMP_LAYER_MODE_SCREEN, /*< desc="Screen" >*/
GIMP_LAYER_MODE_DIFFERENCE, /*< desc="Difference" >*/
GIMP_LAYER_MODE_ADDITION, /*< desc="Addition" >*/
GIMP_LAYER_MODE_SUBTRACT, /*< desc="Subtract" >*/
GIMP_LAYER_MODE_DARKEN_ONLY, /*< desc="Darken only" >*/
GIMP_LAYER_MODE_LIGHTEN_ONLY, /*< desc="Lighten only" >*/
GIMP_LAYER_MODE_HSV_HUE, /*< desc="Hue (HSV)" >*/
GIMP_LAYER_MODE_HSV_SATURATION, /*< desc="Saturation (HSV)" >*/
GIMP_LAYER_MODE_HSV_COLOR, /*< desc="Color (HSV)" >*/
GIMP_LAYER_MODE_HSV_VALUE, /*< desc="Value (HSV)" >*/
GIMP_LAYER_MODE_DIVIDE, /*< desc="Divide" >*/
GIMP_LAYER_MODE_DODGE, /*< desc="Dodge" >*/
GIMP_LAYER_MODE_BURN, /*< desc="Burn" >*/
GIMP_LAYER_MODE_HARDLIGHT, /*< desc="Hard light" >*/
GIMP_LAYER_MODE_SOFTLIGHT, /*< desc="Soft light" >*/
GIMP_LAYER_MODE_GRAIN_EXTRACT, /*< desc="Grain extract" >*/
GIMP_LAYER_MODE_GRAIN_MERGE, /*< desc="Grain merge" >*/
GIMP_LAYER_MODE_NORMAL, /*< desc="Normal" >*/
GIMP_LAYER_MODE_BEHIND, /*< desc="Behind" >*/
GIMP_LAYER_MODE_MULTIPLY, /*< desc="Multiply" >*/
GIMP_LAYER_MODE_MULTIPLY_LINEAR, /*< desc="Multiply (linear)" >*/
GIMP_LAYER_MODE_SCREEN, /*< desc="Screen" >*/
GIMP_LAYER_MODE_DIFFERENCE, /*< desc="Difference" >*/
GIMP_LAYER_MODE_DIFFERENCE_LINEAR, /*< desc="Difference (linear)" >*/
GIMP_LAYER_MODE_ADDITION, /*< desc="Addition" >*/
GIMP_LAYER_MODE_ADDITION_LINEAR, /*< desc="Addition (linear)" >*/
GIMP_LAYER_MODE_SUBTRACT, /*< desc="Subtract" >*/
GIMP_LAYER_MODE_SUBTRACT_LINEAR, /*< desc="Subtract (linear)" >*/
GIMP_LAYER_MODE_DARKEN_ONLY, /*< desc="Darken only" >*/
GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR, /*< desc="Darken only (linear)" >*/
GIMP_LAYER_MODE_LIGHTEN_ONLY, /*< desc="Lighten only" >*/
GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR, /*< desc="Lighten only (linear)" >*/
GIMP_LAYER_MODE_HSV_HUE, /*< desc="Hue (HSV)" >*/
GIMP_LAYER_MODE_HSV_SATURATION, /*< desc="Saturation (HSV)" >*/
GIMP_LAYER_MODE_HSV_COLOR, /*< desc="Color (HSV)" >*/
GIMP_LAYER_MODE_HSV_VALUE, /*< desc="Value (HSV)" >*/
GIMP_LAYER_MODE_DIVIDE, /*< desc="Divide" >*/
GIMP_LAYER_MODE_DIVIDE_LINEAR, /*< desc="Divide (linear)" >*/
GIMP_LAYER_MODE_DODGE, /*< desc="Dodge" >*/
GIMP_LAYER_MODE_DODGE_LINEAR, /*< desc="Dodge (linear)" >*/
GIMP_LAYER_MODE_BURN, /*< desc="Burn" >*/
GIMP_LAYER_MODE_BURN_LINEAR, /*< desc="Burn (linear)" >*/
GIMP_LAYER_MODE_HARDLIGHT, /*< desc="Hard light" >*/
GIMP_LAYER_MODE_SOFTLIGHT, /*< desc="Soft light" >*/
GIMP_LAYER_MODE_GRAIN_EXTRACT, /*< desc="Grain extract" >*/
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)" >*/
/* Internal modes, not available to the PDB */
GIMP_LAYER_MODE_ERASE = 1000, /*< pdb-skip, desc="Erase" >*/
GIMP_LAYER_MODE_REPLACE = 1001, /*< pdb-skip, desc="Replace" >*/
GIMP_LAYER_MODE_ANTI_ERASE = 1002 /*< pdb-skip, desc="Anti erase" >*/
GIMP_LAYER_MODE_ERASE = 1000, /*< pdb-skip, desc="Erase" >*/
GIMP_LAYER_MODE_REPLACE = 1001, /*< pdb-skip, desc="Replace" >*/
GIMP_LAYER_MODE_ANTI_ERASE = 1002 /*< pdb-skip, desc="Anti erase" >*/
} GimpLayerMode;
......
......@@ -138,66 +138,129 @@ gimp_gegl_add_buffer_source (GeglNode *parent,
return buffer_source;
}
gboolean
gimp_gegl_mode_is_legacy (GimpLayerMode mode)
{
switch (mode)
{
case GIMP_LAYER_MODE_MULTIPLY_LEGACY:
case GIMP_LAYER_MODE_SCREEN_LEGACY:
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
case GIMP_LAYER_MODE_ADDITION_LEGACY:
case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY:
case GIMP_LAYER_MODE_HSV_HUE_LEGACY:
case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
case GIMP_LAYER_MODE_HSV_COLOR_LEGACY:
case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
case GIMP_LAYER_MODE_DIVIDE_LEGACY:
case GIMP_LAYER_MODE_DODGE_LEGACY:
case GIMP_LAYER_MODE_BURN_LEGACY:
case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
return TRUE;
default:
break;
}
return FALSE;
}
gboolean
gimp_gegl_mode_is_linear (GimpLayerMode mode)
{
switch (mode)
{
case GIMP_LAYER_MODE_NORMAL:
case GIMP_LAYER_MODE_NORMAL_NON_LINEAR:
return FALSE;
case GIMP_LAYER_MODE_DISSOLVE:
case GIMP_LAYER_MODE_MULTIPLY_LINEAR:
case GIMP_LAYER_MODE_BEHIND:
return TRUE;
case GIMP_LAYER_MODE_BEHIND_NON_LINEAR:
case GIMP_LAYER_MODE_MULTIPLY:
return TRUE;
case GIMP_LAYER_MODE_MULTIPLY_LEGACY:
case GIMP_LAYER_MODE_SCREEN:
case GIMP_LAYER_MODE_SCREEN_LEGACY:
case GIMP_LAYER_MODE_ADDITION:
case GIMP_LAYER_MODE_SUBTRACT:
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
case GIMP_LAYER_MODE_ADDITION_LEGACY:
case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY:
case GIMP_LAYER_MODE_NORMAL_NON_LINEAR:
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
case GIMP_LAYER_MODE_DIFFERENCE:
case GIMP_LAYER_MODE_HSV_HUE:
case GIMP_LAYER_MODE_HSV_SATURATION:
case GIMP_LAYER_MODE_HSV_COLOR:
case GIMP_LAYER_MODE_HSV_VALUE:
case GIMP_LAYER_MODE_HSV_HUE_LEGACY:
case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
case GIMP_LAYER_MODE_HSV_COLOR_LEGACY:
case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
case GIMP_LAYER_MODE_DIVIDE:
case GIMP_LAYER_MODE_DIVIDE_LEGACY:
case GIMP_LAYER_MODE_DODGE:
case GIMP_LAYER_MODE_DODGE_LEGACY:
case GIMP_LAYER_MODE_BURN:
case GIMP_LAYER_MODE_BURN_LEGACY:
case GIMP_LAYER_MODE_HARDLIGHT:
case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
case GIMP_LAYER_MODE_SOFTLIGHT:
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_MERGE:
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
return FALSE;
case GIMP_LAYER_MODE_COLOR_ERASE:
case GIMP_LAYER_MODE_OVERLAY:
case GIMP_LAYER_MODE_ERASE:
case GIMP_LAYER_MODE_REPLACE:
case GIMP_LAYER_MODE_ANTI_ERASE:
case GIMP_LAYER_MODE_LCH_HUE:
case GIMP_LAYER_MODE_LCH_CHROMA:
case GIMP_LAYER_MODE_LCH_COLOR:
case GIMP_LAYER_MODE_LCH_LIGHTNESS:
return FALSE;
case GIMP_LAYER_MODE_NORMAL:
case GIMP_LAYER_MODE_BEHIND:
return TRUE;
case GIMP_LAYER_MODE_MULTIPLY:
case GIMP_LAYER_MODE_SCREEN:
case GIMP_LAYER_MODE_DIFFERENCE:
case GIMP_LAYER_MODE_ADDITION:
case GIMP_LAYER_MODE_SUBTRACT:
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_HSV_HUE:
case GIMP_LAYER_MODE_HSV_SATURATION:
case GIMP_LAYER_MODE_HSV_COLOR:
case GIMP_LAYER_MODE_HSV_VALUE:
case GIMP_LAYER_MODE_DIVIDE:
case GIMP_LAYER_MODE_DODGE:
case GIMP_LAYER_MODE_BURN:
case GIMP_LAYER_MODE_HARDLIGHT:
case GIMP_LAYER_MODE_SOFTLIGHT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_MERGE:
return FALSE;
case GIMP_LAYER_MODE_MULTIPLY_LINEAR:
case GIMP_LAYER_MODE_DIFFERENCE_LINEAR:
case GIMP_LAYER_MODE_ADDITION_LINEAR:
case GIMP_LAYER_MODE_SUBTRACT_LINEAR:
case GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR:
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR:
case GIMP_LAYER_MODE_DIVIDE_LINEAR:
case GIMP_LAYER_MODE_DODGE_LINEAR:
case GIMP_LAYER_MODE_BURN_LINEAR:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
return TRUE;
case GIMP_LAYER_MODE_ERASE:
return TRUE;
case GIMP_LAYER_MODE_REPLACE:
return FALSE;
case GIMP_LAYER_MODE_ANTI_ERASE:
return TRUE;
}
return FALSE;
}
......@@ -206,13 +269,14 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
GimpLayerMode mode,
gboolean linear)
{
const gchar *operation = "gimp:normal";
const gchar *operation;
gdouble opacity;
g_return_if_fail (GEGL_IS_NODE (node));
switch (mode)
{
case GIMP_LAYER_MODE_NORMAL_NON_LINEAR:
case GIMP_LAYER_MODE_NORMAL:
operation = "gimp:normal";
break;
......@@ -221,6 +285,7 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
operation = "gimp:dissolve";
break;
case GIMP_LAYER_MODE_BEHIND_NON_LINEAR:
case GIMP_LAYER_MODE_BEHIND:
operation = "gimp:behind";
break;
......@@ -234,146 +299,156 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
operation = "gimp:multiply";
break;
case GIMP_LAYER_MODE_SCREEN:
operation = "gimp:screen";
break;
case GIMP_LAYER_MODE_SCREEN_LEGACY:
operation = "gimp:screen-legacy";
break;
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
operation = "gimp:softlight-legacy";
case GIMP_LAYER_MODE_SCREEN:
operation = "gimp:screen";
break;
case GIMP_LAYER_MODE_DIFFERENCE:
operation = "gimp:difference";
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
operation = "gimp:softlight-legacy";
break;
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
operation = "gimp:difference-legacy";
break;
case GIMP_LAYER_MODE_ADDITION:
operation = "gimp:addition";
case GIMP_LAYER_MODE_DIFFERENCE:
case GIMP_LAYER_MODE_DIFFERENCE_LINEAR:
operation = "gimp:difference";
break;
case GIMP_LAYER_MODE_ADDITION_LEGACY:
operation = "gimp:addition-legacy";
break;
case GIMP_LAYER_MODE_SUBTRACT:
operation = "gimp:subtract";
case GIMP_LAYER_MODE_ADDITION:
case GIMP_LAYER_MODE_ADDITION_LINEAR:
operation = "gimp:addition";
break;
case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
operation = "gimp:subtract-legacy";
break;
case GIMP_LAYER_MODE_DARKEN_ONLY:
operation = "gimp:darken-only";
case GIMP_LAYER_MODE_SUBTRACT:
case GIMP_LAYER_MODE_SUBTRACT_LINEAR:
operation = "gimp:subtract";
break;
case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
operation = "gimp:darken-only-legacy";
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
operation = "gimp:lighten-only";
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR:
operation = "gimp:darken-only";
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY:
operation = "gimp:lighten-only-legacy";
break;
case GIMP_LAYER_MODE_HSV_HUE:
operation = "gimp:hsv-hue";
break;
case GIMP_LAYER_MODE_HSV_SATURATION:
operation = "gimp:hsv-saturation";
break;
case GIMP_LAYER_MODE_HSV_COLOR:
operation = "gimp:hsv-color";
break;
case GIMP_LAYER_MODE_HSV_VALUE:
operation = "gimp:hsv-value";
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR:
operation = "gimp:lighten-only";
break;
case GIMP_LAYER_MODE_HSV_HUE_LEGACY:
operation = "gimp:hsv-hue-legacy";
break;
case GIMP_LAYER_MODE_HSV_HUE:
operation = "gimp:hsv-hue";
break;
case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
operation = "gimp:hsv-saturation-legacy";
break;
case GIMP_LAYER_MODE_HSV_SATURATION:
operation = "gimp:hsv-saturation";
break;
case GIMP_LAYER_MODE_HSV_COLOR_LEGACY:
operation = "gimp:hsv-color-legacy";
break;
case GIMP_LAYER_MODE_HSV_COLOR:
operation = "gimp:hsv-color";
break;
case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
operation = "gimp:hsv-value-legacy";
break;
case GIMP_LAYER_MODE_DIVIDE:
operation = "gimp:divide";
case GIMP_LAYER_MODE_HSV_VALUE:
operation = "gimp:hsv-value";
break;
case GIMP_LAYER_MODE_DIVIDE_LEGACY:
operation = "gimp:divide-legacy";
break;
case GIMP_LAYER_MODE_DODGE:
operation = "gimp:dodge";
case GIMP_LAYER_MODE_DIVIDE:
case GIMP_LAYER_MODE_DIVIDE_LINEAR:
operation = "gimp:divide";
break;
case GIMP_LAYER_MODE_DODGE_LEGACY:
operation = "gimp:dodge-legacy";
break;
case GIMP_LAYER_MODE_BURN:
operation = "gimp:burn";
case GIMP_LAYER_MODE_DODGE:
case GIMP_LAYER_MODE_DODGE_LINEAR:
operation = "gimp:dodge";
break;
case GIMP_LAYER_MODE_BURN_LEGACY:
operation = "gimp:burn-legacy";
break;
case GIMP_LAYER_MODE_HARDLIGHT:
operation = "gimp:hardlight";
case GIMP_LAYER_MODE_BURN:
case GIMP_LAYER_MODE_BURN_LINEAR:
operation = "gimp:burn";
break;
case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
operation = "gimp:hardlight-legacy";
break;
case GIMP_LAYER_MODE_SOFTLIGHT:
operation = "gimp:softlight";
case GIMP_LAYER_MODE_HARDLIGHT:
operation = "gimp:hardlight";
break;
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
operation = "gimp:softlight-legacy";
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
operation = "gimp:grain-extract";
case GIMP_LAYER_MODE_SOFTLIGHT:
operation = "gimp:softlight";
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
operation = "gimp:grain-extract-legacy";
break;
case GIMP_LAYER_MODE_GRAIN_MERGE:
operation = "gimp:grain-merge";
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
operation = "gimp:grain-extract";
break;
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
operation = "gimp:grain-merge-legacy";
break;
case GIMP_LAYER_MODE_GRAIN_MERGE:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
operation = "gimp:grain-merge";
break;
case GIMP_LAYER_MODE_COLOR_ERASE:
operation = "gimp:color-erase";
break;
......@@ -409,9 +484,6 @@ gimp_gegl_mode_node_set_mode (GeglNode *node,
case GIMP_LAYER_MODE_ANTI_ERASE:
operation = "gimp:anti-erase";
break;
default:
break;
}
gegl_node_get (node,
......
......@@ -41,6 +41,8 @@ void gimp_gegl_node_set_matrix (GeglNode *node,
const GimpMatrix3 *matrix);
void gimp_gegl_node_set_color (GeglNode *node,
const GimpRGB *color);
gboolean gimp_gegl_mode_is_legacy (GimpLayerMode mode);
gboolean gimp_gegl_mode_is_linear (GimpLayerMode mode);
......
......@@ -103,21 +103,31 @@ typedef enum
GIMP_LAYER_MODE_MULTIPLY_LINEAR,
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LINEAR,
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_ADDITION_LINEAR,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LINEAR,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR,
GIMP_LAYER_MODE_HSV_HUE,
GIMP_LAYER_MODE_HSV_SATURATION,
GIMP_LAYER_MODE_HSV_COLOR,
GIMP_LAYER_MODE_HSV_VALUE,
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_DIVIDE_LINEAR,
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_DODGE_LINEAR,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LINEAR,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_MERGE
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR,
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR
} GimpLayerMode;
......
......@@ -726,18 +726,28 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_MULTIPLY
GIMP_LAYER_MODE_MULTIPLY_LINEAR
GIMP_LAYER_MODE_SCREEN GIMP_LAYER_MODE_DIFFERENCE
GIMP_LAYER_MODE_ADDITION GIMP_LAYER_MODE_SUBTRACT
GIMP_LAYER_MODE_DIFFERENCE_LINEAR
GIMP_LAYER_MODE_ADDITION
GIMP_LAYER_MODE_ADDITION_LINEAR
GIMP_LAYER_MODE_SUBTRACT
GIMP_LAYER_MODE_SUBTRACT_LINEAR
GIMP_LAYER_MODE_DARKEN_ONLY
GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR
GIMP_LAYER_MODE_LIGHTEN_ONLY
GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR
GIMP_LAYER_MODE_HSV_HUE
GIMP_LAYER_MODE_HSV_SATURATION
GIMP_LAYER_MODE_HSV_COLOR
GIMP_LAYER_MODE_HSV_VALUE GIMP_LAYER_MODE_DIVIDE
GIMP_LAYER_MODE_DODGE GIMP_LAYER_MODE_BURN
GIMP_LAYER_MODE_DIVIDE_LINEAR
GIMP_LAYER_MODE_DODGE GIMP_LAYER_MODE_DODGE_LINEAR
GIMP_LAYER_MODE_BURN GIMP_LAYER_MODE_BURN_LINEAR
GIMP_LAYER_MODE_HARDLIGHT
GIMP_LAYER_MODE_SOFTLIGHT
GIMP_LAYER_MODE_GRAIN_EXTRACT
GIMP_LAYER_MODE_GRAIN_MERGE) ],
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR
GIMP_LAYER_MODE_GRAIN_MERGE
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR) ],
mapping => { GIMP_LAYER_MODE_NORMAL_NON_LINEAR => '0',
GIMP_LAYER_MODE_DISSOLVE => '1',
GIMP_LAYER_MODE_BEHIND_NON_LINEAR => '2',
......@@ -772,21 +782,31 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_MULTIPLY_LINEAR => '31',
GIMP_LAYER_MODE_SCREEN => '32',
GIMP_LAYER_MODE_DIFFERENCE => '33',
GIMP_LAYER_MODE_ADDITION => '34',
GIMP_LAYER_MODE_SUBTRACT => '35',
GIMP_LAYER_MODE_DARKEN_ONLY => '36',
GIMP_LAYER_MODE_LIGHTEN_ONLY => '37',
GIMP_LAYER_MODE_HSV_HUE => '38',
GIMP_LAYER_MODE_HSV_SATURATION => '39',
GIMP_LAYER_MODE_HSV_COLOR => '40',
GIMP_LAYER_MODE_HSV_VALUE => '41',
GIMP_LAYER_MODE_DIVIDE => '42',
GIMP_LAYER_MODE_DODGE => '43',
GIMP_LAYER_MODE_BURN => '44',
GIMP_LAYER_MODE_HARDLIGHT => '45',
GIMP_LAYER_MODE_SOFTLIGHT => '46',
GIMP_LAYER_MODE_GRAIN_EXTRACT => '47',
GIMP_LAYER_MODE_GRAIN_MERGE => '48' }
GIMP_LAYER_MODE_DIFFERENCE_LINEAR => '34',
GIMP_LAYER_MODE_ADDITION => '35',
GIMP_LAYER_MODE_ADDITION_LINEAR => '36',
GIMP_LAYER_MODE_SUBTRACT => '37',
GIMP_LAYER_MODE_SUBTRACT_LINEAR => '38',
GIMP_LAYER_MODE_DARKEN_ONLY => '39',
GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR => '40',
GIMP_LAYER_MODE_LIGHTEN_ONLY => '41',
GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR => '42',
GIMP_LAYER_MODE_HSV_HUE => '43',
GIMP_LAYER_MODE_HSV_SATURATION => '44',
GIMP_LAYER_MODE_HSV_COLOR => '45',
GIMP_LAYER_MODE_HSV_VALUE => '46',
GIMP_LAYER_MODE_DIVIDE => '47',
GIMP_LAYER_MODE_DIVIDE_LINEAR => '48',
GIMP_LAYER_MODE_DODGE => '49',
GIMP_LAYER_MODE_DODGE_LINEAR => '50',
GIMP_LAYER_MODE_BURN => '51',
GIMP_LAYER_MODE_BURN_LINEAR => '52',
GIMP_LAYER_MODE_HARDLIGHT => '53',
GIMP_LAYER_MODE_SOFTLIGHT => '54',
GIMP_LAYER_MODE_GRAIN_EXTRACT => '55',
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR => '56',
GIMP_LAYER_MODE_GRAIN_MERGE => '57',
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR => '58' }
},
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