app: implement gimp_layer_mode_get_blend_trc()

This commit is contained in:
Michael Natterer 2017-01-17 17:41:05 +01:00
parent 0bcb3068fe
commit b809613be0
1 changed files with 93 additions and 0 deletions

View File

@ -161,6 +161,99 @@ gimp_layer_mode_is_linear (GimpLayerMode mode)
GimpLayerBlendTRC
gimp_layer_mode_get_blend_trc (GimpLayerMode mode)
{
switch (mode)
{
case GIMP_LAYER_MODE_NORMAL_NON_LINEAR:
return GIMP_LAYER_BLEND_RGB_PERCEPTUAL;
case GIMP_LAYER_MODE_DISSOLVE:
return GIMP_LAYER_BLEND_RGB_LINEAR;
case GIMP_LAYER_MODE_BEHIND:
return GIMP_LAYER_BLEND_RGB_PERCEPTUAL;
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 FALSE;
case GIMP_LAYER_MODE_COLOR_ERASE:
case GIMP_LAYER_MODE_OVERLAY:
return GIMP_LAYER_BLEND_RGB_PERCEPTUAL;
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 GIMP_LAYER_BLEND_LAB;
case GIMP_LAYER_MODE_NORMAL:
return GIMP_LAYER_BLEND_RGB_LINEAR;
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 GIMP_LAYER_BLEND_RGB_PERCEPTUAL;
case GIMP_LAYER_MODE_BEHIND_LINEAR:
case GIMP_LAYER_MODE_MULTIPLY_LINEAR:
case GIMP_LAYER_MODE_SCREEN_LINEAR:
case GIMP_LAYER_MODE_OVERLAY_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_HARDLIGHT_LINEAR:
case GIMP_LAYER_MODE_SOFTLIGHT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
return GIMP_LAYER_BLEND_RGB_LINEAR;
case GIMP_LAYER_MODE_ERASE:
return GIMP_LAYER_BLEND_RGB_LINEAR;
case GIMP_LAYER_MODE_REPLACE:
return GIMP_LAYER_BLEND_RGB_PERCEPTUAL;
case GIMP_LAYER_MODE_ANTI_ERASE:
return GIMP_LAYER_BLEND_RGB_LINEAR;
}
return GIMP_LAYER_BLEND_RGB_LINEAR;
}