Commit b22c09e7 authored by Ell's avatar Ell

app: implement color-erase mode as a GimpOperationLayerMode blendfun

... and get rid of the dedicated op.  This gives us support for all
the blend/composite options for this mode.

Rename COLOR_ERASE to COLOR_ERASE_LEGACY, with perceptual blending/
compositing and immutable everything, and add a new COLOR_ERASE
mode, defaulting to linear blending/compositing, with mutable
everything.  Modify affected code.
parent 398a7b02
......@@ -2419,7 +2419,7 @@ gimp_image_get_xcf_version (GimpImage *image,
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
case GIMP_LAYER_MODE_COLOR_ERASE:
case GIMP_LAYER_MODE_COLOR_ERASE_LEGACY:
version = MAX (2, version);
break;
......@@ -2462,6 +2462,7 @@ gimp_image_get_xcf_version (GimpImage *image,
case GIMP_LAYER_MODE_LUMA_DARKEN_ONLY:
case GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LUMINANCE:
case GIMP_LAYER_MODE_COLOR_ERASE:
version = MAX (10, version);
break;
......
......@@ -87,7 +87,6 @@
#include "layer-modes/gimpoperationantierase.h"
#include "layer-modes/gimpoperationbehind.h"
#include "layer-modes/gimpoperationerase.h"
#include "layer-modes/gimpoperationcolorerase.h"
#include "layer-modes/gimpoperationdissolve.h"
#include "layer-modes/gimpoperationnormal.h"
#include "layer-modes/gimpoperationreplace.h"
......@@ -147,7 +146,6 @@ gimp_operations_init (void)
g_type_class_ref (GIMP_TYPE_OPERATION_SOFTLIGHT_LEGACY);
g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_EXTRACT_LEGACY);
g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_MERGE_LEGACY);
g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_ERASE);
g_type_class_ref (GIMP_TYPE_OPERATION_ERASE);
g_type_class_ref (GIMP_TYPE_OPERATION_REPLACE);
g_type_class_ref (GIMP_TYPE_OPERATION_ANTI_ERASE);
......
......@@ -29,8 +29,6 @@ libapplayermodes_generic_a_sources = \
gimpoperationantierase.h \
gimpoperationbehind.c \
gimpoperationbehind.h \
gimpoperationcolorerase.c \
gimpoperationcolorerase.h \
gimpoperationdissolve.c \
gimpoperationdissolve.h \
gimpoperationerase.c \
......
......@@ -46,7 +46,6 @@
#include "gimpoperationantierase.h"
#include "gimpoperationbehind.h"
#include "gimpoperationcolorerase.h"
#include "gimpoperationdissolve.h"
#include "gimpoperationerase.h"
#include "gimpoperationnormal.h"
......@@ -399,11 +398,12 @@ static const GimpLayerModeInfo layer_mode_infos[] =
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL
},
{ GIMP_LAYER_MODE_COLOR_ERASE,
{ GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
.op_name = "gimp:color-erase",
.function = gimp_operation_color_erase_process,
.flags = GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
.op_name = "gimp:layer-mode",
.function = gimp_operation_layer_mode_process_pixels,
.flags = GIMP_LAYER_MODE_FLAG_LEGACY |
GIMP_LAYER_MODE_FLAG_BLEND_SPACE_IMMUTABLE |
GIMP_LAYER_MODE_FLAG_COMPOSITE_SPACE_IMMUTABLE |
GIMP_LAYER_MODE_FLAG_COMPOSITE_MODE_IMMUTABLE |
GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
......@@ -801,6 +801,19 @@ static const GimpLayerModeInfo layer_mode_infos[] =
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
},
{ GIMP_LAYER_MODE_COLOR_ERASE,
.op_name = "gimp:layer-mode",
.function = gimp_operation_layer_mode_process_pixels,
.flags = GIMP_LAYER_MODE_FLAG_SUBTRACTIVE,
.context = GIMP_LAYER_MODE_CONTEXT_PAINT |
GIMP_LAYER_MODE_CONTEXT_FADE,
.paint_composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
.composite_mode = GIMP_LAYER_COMPOSITE_SRC_ATOP,
.composite_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
.blend_space = GIMP_LAYER_COLOR_SPACE_RGB_LINEAR
},
{ GIMP_LAYER_MODE_ERASE,
.op_name = "gimp:erase",
......@@ -905,6 +918,7 @@ static const GimpLayerMode layer_mode_group_legacy[] =
GIMP_LAYER_MODE_NORMAL_LEGACY,
GIMP_LAYER_MODE_DISSOLVE,
GIMP_LAYER_MODE_BEHIND_LEGACY,
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
GIMP_LAYER_MODE_SEPARATOR,
......@@ -1032,7 +1046,7 @@ static const GimpLayerMode layer_mode_groups[][2] =
},
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_COLOR_ERASE,
[GIMP_LAYER_MODE_GROUP_LEGACY ] = -1,
[GIMP_LAYER_MODE_GROUP_LEGACY ] = GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
},
{ [GIMP_LAYER_MODE_GROUP_DEFAULT] = GIMP_LAYER_MODE_VIVID_LIGHT,
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationcolorerase.c
* Copyright (C) 2008 Michael Natterer <mitch@gimp.org>
* 2012 Ville Sokk <ville.sokk@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <cairo.h>
#include <gegl-plugin.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpcolor/gimpcolor.h"
#include "../operations-types.h"
#include "gimpoperationcolorerase.h"
G_DEFINE_TYPE (GimpOperationColorErase, gimp_operation_color_erase,
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
gimp_operation_color_erase_class_init (GimpOperationColorEraseClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposer3Class *point_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_class = GEGL_OPERATION_POINT_COMPOSER3_CLASS (klass);
gegl_operation_class_set_keys (operation_class,
"name", "gimp:color-erase",
"description", "GIMP color erase mode operation",
NULL);
point_class->process = gimp_operation_color_erase_process;
}
static void
gimp_operation_color_erase_init (GimpOperationColorErase *self)
{
}
gboolean
gimp_operation_color_erase_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationLayerMode *layer_mode = (gpointer) op;
gfloat *in = in_p;
gfloat *out = out_p;
gfloat *layer = layer_p;
gfloat *mask = mask_p;
gfloat opacity = layer_mode->opacity;
const gboolean has_mask = mask != NULL;
while (samples--)
{
gfloat layer_alpha;
GimpRGB bgcolor, color, alpha;
layer_alpha = layer[ALPHA] * opacity;
if (has_mask)
layer_alpha *= *mask;
gimp_rgba_set (&color, in[0], in[1], in[2], in[3]);
gimp_rgba_set (&bgcolor, layer[0], layer[1], layer[2], layer_alpha);
/* start of helper function copied from legacy 8-bit blending code */
alpha.a = color.a;
if (bgcolor.r < 0.0001)
alpha.r = color.r;
else if (GEGL_FLOAT_EQUAL (color.r, bgcolor.r))
alpha.r = 0.0;
else if (color.r > bgcolor.r)
alpha.r = (color.r - bgcolor.r) / (1.0 - bgcolor.r);
else
alpha.r = (bgcolor.r - color.r) / bgcolor.r;
if (bgcolor.g < 0.0001)
alpha.g = color.g;
else if (GEGL_FLOAT_EQUAL (color.g, bgcolor.g))
alpha.g = 0.0;
else if ( color.g > bgcolor.g )
alpha.g = (color.g - bgcolor.g) / (1.0 - bgcolor.g);
else
alpha.g = (bgcolor.g - color.g) / (bgcolor.g);
if (bgcolor.b < 0.0001)
alpha.b = color.b;
else if (GEGL_FLOAT_EQUAL (color.b, bgcolor.b))
alpha.b = 0.0;
else if ( color.b > bgcolor.b )
alpha.b = (color.b - bgcolor.b) / (1.0 - bgcolor.b);
else
alpha.b = (bgcolor.b - color.b) / (bgcolor.b);
if (alpha.r > alpha.g)
{
if (alpha.r > alpha.b)
{
color.a = alpha.r;
}
else
{
color.a = alpha.b;
}
}
else if (alpha.g > alpha.b)
{
color.a = alpha.g;
}
else
{
color.a = alpha.b;
}
color.a = (1.0 - bgcolor.a) + (color.a * bgcolor.a);
if (color.a > 0.0001)
{
color.r = (color.r - bgcolor.r) / color.a + bgcolor.r;
color.g = (color.g - bgcolor.g) / color.a + bgcolor.g;
color.b = (color.b - bgcolor.b) / color.a + bgcolor.b;
color.a *= alpha.a;
}
/* end of helper function */
out[0] = color.r;
out[1] = color.g;
out[2] = color.b;
out[3] = color.a;
in += 4;
layer += 4;
out += 4;
if (has_mask)
mask++;
}
return TRUE;
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationcolorerase.h
* Copyright (C) 2008 Michael Natterer <mitch@gimp.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_OPERATION_COLOR_ERASE_H__
#define __GIMP_OPERATION_COLOR_ERASE_H__
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_COLOR_ERASE (gimp_operation_color_erase_get_type ())
#define GIMP_OPERATION_COLOR_ERASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_COLOR_ERASE, GimpOperationColorErase))
#define GIMP_OPERATION_COLOR_ERASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_COLOR_ERASE, GimpOperationColorEraseClass))
#define GIMP_IS_OPERATION_COLOR_ERASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_COLOR_ERASE))
#define GIMP_IS_OPERATION_COLOR_ERASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_COLOR_ERASE))
#define GIMP_OPERATION_COLOR_ERASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_COLOR_ERASE, GimpOperationColorEraseClass))
typedef struct _GimpOperationColorErase GimpOperationColorErase;
typedef struct _GimpOperationColorEraseClass GimpOperationColorEraseClass;
struct _GimpOperationColorErase
{
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationColorEraseClass
{
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_color_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_color_erase_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_COLOR_ERASE_H__ */
......@@ -2148,6 +2148,64 @@ blendfun_exclusion (const float *dest,
}
}
static inline void
blendfun_color_erase (const float *dest,
const float *src,
float *out,
int samples)
{
while (samples--)
{
if (dest[ALPHA] != 0.0f && src[ALPHA] != 0.0f)
{
const float *color = dest;
const float *bgcolor = src;
gfloat alpha;
gint c;
alpha = 0.0f;
for (c = 0; c < 3; c++)
{
gfloat col = CLAMP (color[c], 0.0f, 1.0f);
gfloat bgcol = CLAMP (bgcolor[c], 0.0f, 1.0f);
if (col != bgcol)
{
gfloat a;
if (col > bgcol)
a = (col - bgcol) / (1.0f - bgcol);
else
a = (bgcol - col) / bgcol;
alpha = MAX (alpha, a);
}
}
if (alpha > 0.0f)
{
gfloat alpha_inv = 1.0f / alpha;
for (c = 0; c < 3; c++)
out[c] = (color[c] - bgcolor[c]) * alpha_inv + bgcolor[c];
}
else
{
out[RED] = out[GREEN] = out[BLUE] = 0.0f;
}
out[ALPHA] = alpha;
}
else
out[ALPHA] = 0.0f;
out += 4;
src += 4;
dest += 4;
}
}
static inline void
blendfun_dummy (const float *dest,
const float *src,
......@@ -2195,6 +2253,8 @@ gimp_layer_mode_get_blend_fun (GimpLayerMode mode)
case GIMP_LAYER_MODE_HARD_MIX: return blendfun_hard_mix;
case GIMP_LAYER_MODE_EXCLUSION: return blendfun_exclusion;
case GIMP_LAYER_MODE_LINEAR_BURN: return blendfun_linear_burn;
case GIMP_LAYER_MODE_COLOR_ERASE_LEGACY:
case GIMP_LAYER_MODE_COLOR_ERASE: return blendfun_color_erase;
case GIMP_LAYER_MODE_DISSOLVE:
case GIMP_LAYER_MODE_BEHIND_LEGACY:
......@@ -2218,7 +2278,6 @@ gimp_layer_mode_get_blend_fun (GimpLayerMode mode)
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
case GIMP_LAYER_MODE_COLOR_ERASE:
case GIMP_LAYER_MODE_ERASE:
case GIMP_LAYER_MODE_REPLACE:
case GIMP_LAYER_MODE_ANTI_ERASE:
......
......@@ -103,7 +103,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_SOFTLIGHT_LEGACY, "GIMP_LAYER_MODE_SOFTLIGHT_LEGACY", "softlight-legacy" },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY, "GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY", "grain-extract-legacy" },
{ GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY, "GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY", "grain-merge-legacy" },
{ GIMP_LAYER_MODE_COLOR_ERASE, "GIMP_LAYER_MODE_COLOR_ERASE", "color-erase" },
{ GIMP_LAYER_MODE_COLOR_ERASE_LEGACY, "GIMP_LAYER_MODE_COLOR_ERASE_LEGACY", "color-erase-legacy" },
{ GIMP_LAYER_MODE_OVERLAY, "GIMP_LAYER_MODE_OVERLAY", "overlay" },
{ GIMP_LAYER_MODE_LCH_HUE, "GIMP_LAYER_MODE_LCH_HUE", "lch-hue" },
{ GIMP_LAYER_MODE_LCH_CHROMA, "GIMP_LAYER_MODE_LCH_CHROMA", "lch-chroma" },
......@@ -138,6 +138,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_LUMA_DARKEN_ONLY, "GIMP_LAYER_MODE_LUMA_DARKEN_ONLY", "luma-darken-only" },
{ GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, "GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY", "luma-lighten-only" },
{ GIMP_LAYER_MODE_LUMINANCE, "GIMP_LAYER_MODE_LUMINANCE", "luminance" },
{ GIMP_LAYER_MODE_COLOR_ERASE, "GIMP_LAYER_MODE_COLOR_ERASE", "color-erase" },
{ 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" },
......@@ -168,7 +169,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_SOFTLIGHT_LEGACY, NC_("layer-mode", "Soft light (legacy)"), NULL },
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY, NC_("layer-mode", "Grain extract (legacy)"), NULL },
{ GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY, NC_("layer-mode", "Grain merge (legacy)"), NULL },
{ GIMP_LAYER_MODE_COLOR_ERASE, NC_("layer-mode", "Color erase"), NULL },
{ GIMP_LAYER_MODE_COLOR_ERASE_LEGACY, NC_("layer-mode", "Color erase (legacy)"), NULL },
{ GIMP_LAYER_MODE_OVERLAY, NC_("layer-mode", "Overlay"), NULL },
{ GIMP_LAYER_MODE_LCH_HUE, NC_("layer-mode", "Hue (LCH)"), NULL },
{ GIMP_LAYER_MODE_LCH_CHROMA, NC_("layer-mode", "Chroma (LCH)"), NULL },
......@@ -203,6 +204,7 @@ gimp_layer_mode_get_type (void)
{ GIMP_LAYER_MODE_LUMA_DARKEN_ONLY, NC_("layer-mode", "Luma/Luminance darken only"), NULL },
{ GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, NC_("layer-mode", "Luma/Luminance lighten only"), NULL },
{ GIMP_LAYER_MODE_LUMINANCE, NC_("layer-mode", "Luminance"), NULL },
{ GIMP_LAYER_MODE_COLOR_ERASE, NC_("layer-mode", "Color erase"), 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 },
......
......@@ -77,7 +77,7 @@ typedef enum
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY, /*< desc="Soft light (legacy)" >*/
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY, /*< desc="Grain extract (legacy)" >*/
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY, /*< desc="Grain merge (legacy)" >*/
GIMP_LAYER_MODE_COLOR_ERASE, /*< desc="Color erase" >*/
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY, /*< desc="Color erase (legacy)" >*/
/* Since 2.8 */
GIMP_LAYER_MODE_OVERLAY, /*< desc="Overlay" >*/
......@@ -116,6 +116,7 @@ typedef enum
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY, /*< desc="Luma/Luminance darken only" >*/
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY, /*< desc="Luma/Luminance lighten only" >*/
GIMP_LAYER_MODE_LUMINANCE, /*< desc="Luminance" >*/
GIMP_LAYER_MODE_COLOR_ERASE, /*< desc="Color erase" >*/
/* Internal modes, not available to the PDB, must be kept at the end */
GIMP_LAYER_MODE_ERASE, /*< pdb-skip, desc="Erase" >*/
......
......@@ -117,7 +117,7 @@ typedef enum
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
GIMP_LAYER_MODE_COLOR_ERASE,
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY,
GIMP_LAYER_MODE_OVERLAY,
GIMP_LAYER_MODE_LCH_HUE,
GIMP_LAYER_MODE_LCH_CHROMA,
......@@ -151,7 +151,8 @@ typedef enum
GIMP_LAYER_MODE_LINEAR_BURN,
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY,
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY,
GIMP_LAYER_MODE_LUMINANCE
GIMP_LAYER_MODE_LUMINANCE,
GIMP_LAYER_MODE_COLOR_ERASE
} GimpLayerMode;
......
......@@ -68,7 +68,7 @@ typedef GimpLayerMode GimpLayerModeEffects;
#define GIMP_SOFTLIGHT_MODE GIMP_LAYER_MODE_SOFTLIGHT_LEGACY
#define GIMP_GRAIN_EXTRACT_MODE GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY
#define GIMP_GRAIN_MERGE_MODE GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY
#define GIMP_COLOR_ERASE_MODE GIMP_LAYER_MODE_COLOR_ERASE
#define GIMP_COLOR_ERASE_MODE GIMP_LAYER_MODE_COLOR_ERASE_LEGACY
#define GIMP_NO_DITHER GIMP_CONVERT_DITHER_NONE
#define GIMP_FS_DITHER GIMP_CONVERT_DITHER_FS
......
......@@ -933,6 +933,7 @@ gimp_to_psd_blend_mode (GimpLayerMode layer_mode,
break;
case GIMP_LAYER_MODE_COLOR_ERASE:
case GIMP_LAYER_MODE_COLOR_ERASE_LEGACY:
if (CONVERSION_WARNINGS)
g_message ("Unsupported blend mode: %s. Mode reverts to normal",
gimp_layer_mode_effects_name (layer_mode));
......@@ -985,7 +986,7 @@ gimp_layer_mode_effects_name (GimpLayerMode mode)
"COLOR ERASE"
};
static gchar *err_name = NULL;
if (mode >= 0 && mode <= GIMP_LAYER_MODE_COLOR_ERASE)
if (mode >= 0 && mode <= GIMP_LAYER_MODE_COLOR_ERASE_LEGACY)
return layer_mode_effects_names[mode];
g_free (err_name);
......
......@@ -719,7 +719,7 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY
GIMP_LAYER_MODE_COLOR_ERASE
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY
GIMP_LAYER_MODE_OVERLAY GIMP_LAYER_MODE_LCH_HUE
GIMP_LAYER_MODE_LCH_CHROMA
GIMP_LAYER_MODE_LCH_COLOR
......@@ -746,7 +746,8 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_LINEAR_BURN
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY
GIMP_LAYER_MODE_LUMINANCE) ],
GIMP_LAYER_MODE_LUMINANCE
GIMP_LAYER_MODE_COLOR_ERASE) ],
mapping => { GIMP_LAYER_MODE_NORMAL_LEGACY => '0',
GIMP_LAYER_MODE_DISSOLVE => '1',
GIMP_LAYER_MODE_BEHIND_LEGACY => '2',
......@@ -769,7 +770,7 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_SOFTLIGHT_LEGACY => '19',
GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY => '20',
GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY => '21',
GIMP_LAYER_MODE_COLOR_ERASE => '22',
GIMP_LAYER_MODE_COLOR_ERASE_LEGACY => '22',
GIMP_LAYER_MODE_OVERLAY => '23',
GIMP_LAYER_MODE_LCH_HUE => '24',
GIMP_LAYER_MODE_LCH_CHROMA => '25',
......@@ -803,7 +804,8 @@ package Gimp::CodeGen::enums;
GIMP_LAYER_MODE_LINEAR_BURN => '53',
GIMP_LAYER_MODE_LUMA_DARKEN_ONLY => '54',
GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY => '55',
GIMP_LAYER_MODE_LUMINANCE => '56' }
GIMP_LAYER_MODE_LUMINANCE => '56',
GIMP_LAYER_MODE_COLOR_ERASE => '57' }
},
GimpConvertDitherType =>
{ 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