Commit 8771361c authored by Michael Natterer's avatar Michael Natterer 😴

app: move arrays of magic GimpLayerMode knowledge to gimp-layer-modes.c

and provide API to access them.
parent 4ff7f23d
......@@ -28,6 +28,388 @@
#include "gimp-layer-modes.h"
/* static variables */
static const GimpLayerMode layer_mode_group_default[] =
{
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,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_VIVID_LIGHT,
GIMP_LAYER_MODE_PIN_LIGHT,
GIMP_LAYER_MODE_LINEAR_LIGHT,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_LCH_HUE,
GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LAYER_MODE_LCH_LIGHTNESS,
GIMP_LAYER_MODE_EXCLUSION,
GIMP_LAYER_MODE_LINEAR_BURN
};
static const GimpLayerMode layer_mode_group_linear[] =
{
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,
GIMP_LAYER_MODE_SOFTLIGHT_LINEAR,
GIMP_LAYER_MODE_HARDLIGHT_LINEAR,
GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR,
GIMP_LAYER_MODE_PIN_LIGHT_LINEAR,
GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR,
GIMP_LAYER_MODE_DIFFERENCE_LINEAR,
GIMP_LAYER_MODE_SUBTRACT_LINEAR,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR,
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR,
GIMP_LAYER_MODE_DIVIDE_LINEAR,
GIMP_LAYER_MODE_EXCLUSION_LINEAR,
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR
};
static const GimpLayerMode layer_mode_group_perceptual[] =
{
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,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_VIVID_LIGHT,
GIMP_LAYER_MODE_PIN_LIGHT,
GIMP_LAYER_MODE_LINEAR_LIGHT,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_HSV_HUE,
GIMP_LAYER_MODE_HSV_SATURATION,
GIMP_LAYER_MODE_HSV_COLOR,
GIMP_LAYER_MODE_HSV_VALUE,
GIMP_LAYER_MODE_LCH_HUE,
GIMP_LAYER_MODE_LCH_CHROMA,
GIMP_LAYER_MODE_LCH_COLOR,
GIMP_LAYER_MODE_LCH_LIGHTNESS,
GIMP_LAYER_MODE_EXCLUSION,
GIMP_LAYER_MODE_LINEAR_BURN
};
static const GimpLayerMode layer_mode_group_legacy[] =
{
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,
GIMP_LAYER_MODE_SCREEN_LEGACY,
GIMP_LAYER_MODE_DODGE_LEGACY,
GIMP_LAYER_MODE_ADDITION_LEGACY,
GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
GIMP_LAYER_MODE_MULTIPLY_LEGACY,
GIMP_LAYER_MODE_BURN_LEGACY,
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
GIMP_LAYER_MODE_SUBTRACT_LEGACY,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
GIMP_LAYER_MODE_DIVIDE_LEGACY,
GIMP_LAYER_MODE_HSV_HUE_LEGACY,
GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,
GIMP_LAYER_MODE_HSV_COLOR_LEGACY,
GIMP_LAYER_MODE_HSV_VALUE_LEGACY
};
static const GimpLayerMode layer_mode_groups[][4] =
{
{
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_NORMAL_LINEAR,
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_NORMAL
},
{
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE
},
{
GIMP_LAYER_MODE_BEHIND,
GIMP_LAYER_MODE_BEHIND_LINEAR,
GIMP_LAYER_MODE_BEHIND,
GIMP_LAYER_MODE_BEHIND
},
{
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_MULTIPLY_LINEAR,
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_MULTIPLY_LEGACY
},
{
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_SCREEN_LINEAR,
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_SCREEN_LEGACY
},
{
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_OVERLAY_LINEAR,
GIMP_LAYER_MODE_OVERLAY,
-1
},
{
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LINEAR,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LEGACY
},
{
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_ADDITION_LINEAR,
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_ADDITION_LEGACY
},
{
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LINEAR,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LEGACY
},
{
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY
},
{
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_HUE,
GIMP_LAYER_MODE_HSV_HUE_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_SATURATION,
GIMP_LAYER_MODE_HSV_SATURATION_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_COLOR,
GIMP_LAYER_MODE_HSV_COLOR_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_VALUE,
GIMP_LAYER_MODE_HSV_VALUE_LEGACY
},
{
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_DIVIDE_LINEAR,
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_DIVIDE_LEGACY
},
{
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_DODGE_LINEAR,
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_DODGE_LEGACY
},
{
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LINEAR,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LEGACY
},
{
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_HARDLIGHT_LINEAR,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_HARDLIGHT_LEGACY
},
{
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT_LINEAR,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY
},
{
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY
},
{
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR,
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY
},
{
GIMP_LAYER_MODE_COLOR_ERASE,
-1,
GIMP_LAYER_MODE_COLOR_ERASE,
-1,
},
{
GIMP_LAYER_MODE_VIVID_LIGHT,
GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR,
GIMP_LAYER_MODE_VIVID_LIGHT,
-1
},
{
GIMP_LAYER_MODE_PIN_LIGHT,
GIMP_LAYER_MODE_PIN_LIGHT_LINEAR,
GIMP_LAYER_MODE_PIN_LIGHT,
-1
},
{
GIMP_LAYER_MODE_LINEAR_LIGHT,
GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR,
GIMP_LAYER_MODE_LINEAR_LIGHT,
-1
},
{
GIMP_LAYER_MODE_EXCLUSION,
GIMP_LAYER_MODE_EXCLUSION_LINEAR,
GIMP_LAYER_MODE_EXCLUSION,
-1
},
{
GIMP_LAYER_MODE_LINEAR_BURN,
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR,
GIMP_LAYER_MODE_LINEAR_BURN,
-1
},
{
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_LUMA_LIGHTEN_ONLY,
-1
},
{
GIMP_LAYER_MODE_ERASE,
GIMP_LAYER_MODE_ERASE,
-1,
-1
},
{
GIMP_LAYER_MODE_REPLACE,
GIMP_LAYER_MODE_REPLACE,
-1,
-1
},
{
GIMP_LAYER_MODE_ANTI_ERASE,
GIMP_LAYER_MODE_ANTI_ERASE,
-1,
-1
},
};
/* public functions */
gboolean
gimp_layer_mode_is_legacy (GimpLayerMode mode)
{
......@@ -469,280 +851,95 @@ gimp_layer_mode_get_operation (GimpLayerMode mode)
return "gimp:layer-mode";
}
static gboolean
is_mode_in_array (const GimpLayerMode *modes,
gint n_modes,
GimpLayerMode mode)
{
gint i;
for (i = 0; i < n_modes; i++)
if (modes[i] == mode)
return TRUE;
return FALSE;
}
GimpLayerModeGroup
gimp_layer_mode_get_group (GimpLayerMode mode)
{
if (gimp_layer_mode_is_legacy (mode))
if (is_mode_in_array (layer_mode_group_default,
G_N_ELEMENTS (layer_mode_group_default), mode))
{
return GIMP_LAYER_MODE_GROUP_LEGACY;
return GIMP_LAYER_MODE_GROUP_DEFAULT;
}
else if (gimp_layer_mode_get_blend_space (mode) ==
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL)
else if (is_mode_in_array (layer_mode_group_linear,
G_N_ELEMENTS (layer_mode_group_linear), mode))
{
return GIMP_LAYER_MODE_GROUP_LINEAR;
}
else if (is_mode_in_array (layer_mode_group_perceptual,
G_N_ELEMENTS (layer_mode_group_perceptual), mode))
{
return GIMP_LAYER_MODE_GROUP_PERCEPTUAL;
}
else if (is_mode_in_array (layer_mode_group_legacy,
G_N_ELEMENTS (layer_mode_group_legacy), mode))
{
return GIMP_LAYER_MODE_GROUP_LEGACY;
}
return GIMP_LAYER_MODE_GROUP_LINEAR;
return GIMP_LAYER_MODE_GROUP_DEFAULT;
}
gboolean
gimp_layer_mode_get_for_group (GimpLayerMode old_mode,
GimpLayerModeGroup new_group,
GimpLayerMode *new_mode)
const GimpLayerMode *
gimp_layer_mode_get_group_array (GimpLayerModeGroup group,
gint *n_modes)
{
static GimpLayerMode mode_groups[][4] =
{
{
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_NORMAL_LINEAR,
GIMP_LAYER_MODE_NORMAL,
GIMP_LAYER_MODE_NORMAL
},
{
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_DISSOLVE
},
{
GIMP_LAYER_MODE_BEHIND,
GIMP_LAYER_MODE_BEHIND_LINEAR,
GIMP_LAYER_MODE_BEHIND,
GIMP_LAYER_MODE_BEHIND
},
{
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_MULTIPLY_LINEAR,
GIMP_LAYER_MODE_MULTIPLY,
GIMP_LAYER_MODE_MULTIPLY_LEGACY
},
{
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_SCREEN_LINEAR,
GIMP_LAYER_MODE_SCREEN,
GIMP_LAYER_MODE_SCREEN_LEGACY
},
{
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_OVERLAY_LINEAR,
GIMP_LAYER_MODE_OVERLAY,
-1
},
{
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LINEAR,
GIMP_LAYER_MODE_DIFFERENCE,
GIMP_LAYER_MODE_DIFFERENCE_LEGACY
},
{
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_ADDITION_LINEAR,
GIMP_LAYER_MODE_ADDITION,
GIMP_LAYER_MODE_ADDITION_LEGACY
},
{
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LINEAR,
GIMP_LAYER_MODE_SUBTRACT,
GIMP_LAYER_MODE_SUBTRACT_LEGACY
},
{
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY,
GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY
},
{
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_HUE,
GIMP_LAYER_MODE_HSV_HUE_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_SATURATION,
GIMP_LAYER_MODE_HSV_SATURATION_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_COLOR,
GIMP_LAYER_MODE_HSV_COLOR_LEGACY
},
{
-1,
-1,
GIMP_LAYER_MODE_HSV_VALUE,
GIMP_LAYER_MODE_HSV_VALUE_LEGACY
},
{
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_DIVIDE_LINEAR,
GIMP_LAYER_MODE_DIVIDE,
GIMP_LAYER_MODE_DIVIDE_LEGACY
},
{
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_DODGE_LINEAR,
GIMP_LAYER_MODE_DODGE,
GIMP_LAYER_MODE_DODGE_LEGACY
},
{
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LINEAR,
GIMP_LAYER_MODE_BURN,
GIMP_LAYER_MODE_BURN_LEGACY
},
{
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_HARDLIGHT_LINEAR,
GIMP_LAYER_MODE_HARDLIGHT,
GIMP_LAYER_MODE_HARDLIGHT_LEGACY
},
{
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT_LINEAR,
GIMP_LAYER_MODE_SOFTLIGHT,
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY
},
{
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR,
GIMP_LAYER_MODE_GRAIN_EXTRACT,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY
},
{
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR,
GIMP_LAYER_MODE_GRAIN_MERGE,
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY
},
{
GIMP_LAYER_MODE_COLOR_ERASE,
-1,
GIMP_LAYER_MODE_COLOR_ERASE,
-1,
},
{
GIMP_LAYER_MODE_VIVID_LIGHT,
GIMP_LAYER_MODE_VIVID_LIGHT_LINEAR,
GIMP_LAYER_MODE_VIVID_LIGHT,
-1
},
{
GIMP_LAYER_MODE_PIN_LIGHT,
GIMP_LAYER_MODE_PIN_LIGHT_LINEAR,
GIMP_LAYER_MODE_PIN_LIGHT,
-1
},
{
GIMP_LAYER_MODE_LINEAR_LIGHT,
GIMP_LAYER_MODE_LINEAR_LIGHT_LINEAR,
GIMP_LAYER_MODE_LINEAR_LIGHT,
-1
},
{
GIMP_LAYER_MODE_EXCLUSION,
GIMP_LAYER_MODE_EXCLUSION_LINEAR,
GIMP_LAYER_MODE_EXCLUSION,
-1
},
g_return_val_if_fail (n_modes != NULL, NULL);
switch (group)
{
GIMP_LAYER_MODE_LINEAR_BURN,
GIMP_LAYER_MODE_LINEAR_BURN_LINEAR,
GIMP_LAYER_MODE_LINEAR_BURN,
-1
},
case GIMP_LAYER_MODE_GROUP_DEFAULT:
*n_modes = G_N_ELEMENTS (layer_mode_group_default);
return layer_mode_group_default;
{
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
-1
},
case GIMP_LAYER_MODE_GROUP_LINEAR:
*n_modes = G_N_ELEMENTS (layer_mode_group_linear);
return layer_mode_group_linear;
{
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
-1
},
case GIMP_LAYER_MODE_GROUP_PERCEPTUAL:
*n_modes = G_N_ELEMENTS (layer_mode_group_perceptual);
return layer_mode_group_perceptual;
{
GIMP_LAYER_MODE_ERASE,
GIMP_LAYER_MODE_ERASE,
-1,
-1
},
{
GIMP_LAYER_MODE_REPLACE,
GIMP_LAYER_MODE_REPLACE,
-1,
-1
},
case GIMP_LAYER_MODE_GROUP_LEGACY:
*n_modes = G_N_ELEMENTS (layer_mode_group_legacy);
return layer_mode_group_legacy;
{
GIMP_LAYER_MODE_ANTI_ERASE,
GIMP_LAYER_MODE_ANTI_ERASE,
-1,
-1
},
};
default:
g_return_val_if_reached (NULL);
}
}
gboolean
gimp_layer_mode_get_for_group (GimpLayerMode old_mode,
GimpLayerModeGroup new_group,
GimpLayerMode *new_mode)
{
gint i;
g_return_val_if_fail (new_mode != NULL, FALSE);
for (i = 0; i < G_N_ELEMENTS (mode_groups); i++)
for (i = 0; i < G_N_ELEMENTS (layer_mode_groups); i++)
{
gint j;
for (j = 0; j < 4; j++)
if (is_mode_in_array (layer_mode_groups[i], 4, old_mode))