Commit e986310e authored by Rupert Weber's avatar Rupert Weber Committed by Martin Nordholts

Bug 630201 - remove unused layer-modes.c in app/paint-funcs

The compositing functions in layer-modes.c have been obsolete
for seven years now, since gimp-composite was made default
by 1b33a15e in 2003.
parent 08a3a1dc
......@@ -153,7 +153,7 @@ struct GimpCompositeOperationEffects gimp_composite_operation_effects[] =
struct GimpCompositeOptions gimp_composite_options =
{
GIMP_COMPOSITE_OPTION_USE
0
};
const gchar * gimp_composite_function_name[GIMP_COMPOSITE_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N];
......@@ -338,9 +338,7 @@ gimp_composite_init (gboolean be_verbose,
gimp_composite_options.bits |= GIMP_COMPOSITE_OPTION_NOEXTENSIONS;
if (be_verbose)
g_printerr ("gimp_composite: use=%s, verbose=%s\n",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE) ?
"yes" : "no",
g_printerr ("gimp_composite: verbose=%s\n",
(gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_VERBOSE) ?
"yes" : "no");
......
......@@ -148,7 +148,6 @@ struct GimpCompositeOptions
gulong bits;
};
#define GIMP_COMPOSITE_OPTION_USE 0x1
#define GIMP_COMPOSITE_OPTION_NOEXTENSIONS 0x2
#define GIMP_COMPOSITE_OPTION_VERBOSE 0x4
......
......@@ -19,8 +19,6 @@ INCLUDES = \
noinst_LIBRARIES = libapppaint-funcs.a
libapppaint_funcs_a_SOURCES = \
layer-modes.c \
layer-modes.h \
paint-funcs.c \
paint-funcs.h \
paint-funcs-generic.h \
......
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
* Copyright (C); 1995 Spencer Kimball and Peter Mattis
*
* 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 __LAYER_MODES_H__
#define __LAYER_MODES_H__
/* FIXME: This function should not be called directly but
* through layer_dissolve_mode function
*/
void dissolve_pixels (const guchar *src,
const guchar *mask,
guchar *dest,
gint x,
gint y,
gint opacity,
gint length,
gint sb,
gint db,
gboolean has_alpha);
struct apply_layer_mode_struct
{
guint bytes1 : 3;
guint bytes2 : 3;
guchar *src1;
guchar *src2;
const guchar *mask;
guchar **dest;
gint x;
gint y;
guint opacity;
guint length;
CombinationMode combine;
};
void layer_modes_setup (void);
void layer_normal_mode (struct apply_layer_mode_struct *alms);
void layer_dissolve_mode (struct apply_layer_mode_struct *alms);
void layer_multiply_mode (struct apply_layer_mode_struct *alms);
void layer_divide_mode (struct apply_layer_mode_struct *alms);
void layer_screen_mode (struct apply_layer_mode_struct *alms);
void layer_overlay_mode (struct apply_layer_mode_struct *alms);
void layer_difference_mode (struct apply_layer_mode_struct *alms);
void layer_addition_mode (struct apply_layer_mode_struct *alms);
void layer_subtract_mode (struct apply_layer_mode_struct *alms);
void layer_darken_only_mode (struct apply_layer_mode_struct *alms);
void layer_lighten_only_mode (struct apply_layer_mode_struct *alms);
void layer_hue_mode (struct apply_layer_mode_struct *alms);
void layer_saturation_mode (struct apply_layer_mode_struct *alms);
void layer_value_mode (struct apply_layer_mode_struct *alms);
void layer_color_mode (struct apply_layer_mode_struct *alms);
void layer_behind_mode (struct apply_layer_mode_struct *alms);
void layer_replace_mode (struct apply_layer_mode_struct *alms);
void layer_erase_mode (struct apply_layer_mode_struct *alms);
void layer_anti_erase_mode (struct apply_layer_mode_struct *alms);
void layer_color_erase_mode (struct apply_layer_mode_struct *alms);
void layer_dodge_mode (struct apply_layer_mode_struct *alms);
void layer_burn_mode (struct apply_layer_mode_struct *alms);
void layer_hardlight_mode (struct apply_layer_mode_struct *alms);
void layer_softlight_mode (struct apply_layer_mode_struct *alms);
void layer_grain_extract_mode (struct apply_layer_mode_struct *alms);
void layer_grain_merge_mode (struct apply_layer_mode_struct *alms);
#endif
......@@ -36,7 +36,6 @@
#include "composite/gimp-composite.h"
#include "paint-funcs.h"
#include "layer-modes.h"
#include "paint-funcs-utils.h"
#include "paint-funcs-generic.h"
......@@ -90,39 +89,6 @@ static const LayerMode layer_modes[] =
};
typedef void (* LayerModeFunc) (struct apply_layer_mode_struct *);
static const LayerModeFunc layer_mode_funcs[] =
{
layer_normal_mode,
layer_dissolve_mode,
layer_behind_mode,
layer_multiply_mode,
layer_screen_mode,
layer_overlay_mode,
layer_difference_mode,
layer_addition_mode,
layer_subtract_mode,
layer_darken_only_mode,
layer_lighten_only_mode,
layer_hue_mode,
layer_saturation_mode,
layer_color_mode,
layer_value_mode,
layer_divide_mode,
layer_dodge_mode,
layer_burn_mode,
layer_hardlight_mode,
layer_softlight_mode,
layer_grain_extract_mode,
layer_grain_merge_mode,
layer_color_erase_mode,
layer_erase_mode,
layer_replace_mode,
layer_anti_erase_mode
};
static const guchar no_mask = OPAQUE_OPACITY;
......@@ -248,7 +214,6 @@ cubic (gdouble dx,
void
paint_funcs_setup (void)
{
layer_modes_setup ();
}
void
......@@ -3984,38 +3949,28 @@ initial_sub_region (struct initial_regions_struct *st,
case INITIAL_INTENSITY:
if (mode == GIMP_DISSOLVE_MODE)
{
if (gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE)
{
GimpCompositeContext ctx;
ctx.A = NULL;
ctx.pixelformat_A = GIMP_PIXELFORMAT_RGBA8;
ctx.B = s;
ctx.pixelformat_B = (src->bytes == 1 ? GIMP_PIXELFORMAT_V8
: src->bytes == 2 ? GIMP_PIXELFORMAT_VA8
: src->bytes == 3 ? GIMP_PIXELFORMAT_RGB8
: src->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8
: GIMP_PIXELFORMAT_ANY);
ctx.D = buf;
ctx.pixelformat_D = ctx.pixelformat_B;
ctx.M = m;
ctx.n_pixels = src->w;
ctx.op = GIMP_COMPOSITE_DISSOLVE;
ctx.dissolve.x = src->x;
ctx.dissolve.y = src->y + h;
ctx.dissolve.opacity = opacity;
gimp_composite_dispatch (&ctx);
}
else
{
dissolve_pixels (s, m, buf, src->x, src->y + h,
opacity, src->w,
src->bytes, src->bytes + 1,
FALSE);
}
GimpCompositeContext ctx;
ctx.A = NULL;
ctx.pixelformat_A = GIMP_PIXELFORMAT_RGBA8;
ctx.B = s;
ctx.pixelformat_B = (src->bytes == 1 ? GIMP_PIXELFORMAT_V8
: src->bytes == 2 ? GIMP_PIXELFORMAT_VA8
: src->bytes == 3 ? GIMP_PIXELFORMAT_RGB8
: src->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8
: GIMP_PIXELFORMAT_ANY);
ctx.D = buf;
ctx.pixelformat_D = ctx.pixelformat_B;
ctx.M = m;
ctx.n_pixels = src->w;
ctx.op = GIMP_COMPOSITE_DISSOLVE;
ctx.dissolve.x = src->x;
ctx.dissolve.y = src->y + h;
ctx.dissolve.opacity = opacity;
gimp_composite_dispatch (&ctx);
initial_inten_a_pixels (buf, d, NULL, OPAQUE_OPACITY, affect,
src->w, src->bytes + 1);
......@@ -4030,38 +3985,28 @@ initial_sub_region (struct initial_regions_struct *st,
case INITIAL_INTENSITY_ALPHA:
if (mode == GIMP_DISSOLVE_MODE)
{
if (gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE)
{
GimpCompositeContext ctx;
ctx.A = NULL;
ctx.pixelformat_A = GIMP_PIXELFORMAT_RGBA8;
ctx.B = s;
ctx.pixelformat_B = (src->bytes == 1 ? GIMP_PIXELFORMAT_V8
: src->bytes == 2 ? GIMP_PIXELFORMAT_VA8
: src->bytes == 3 ? GIMP_PIXELFORMAT_RGB8
: src->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8
: GIMP_PIXELFORMAT_ANY);
ctx.D = buf;
ctx.pixelformat_D = ctx.pixelformat_B;
ctx.M = m;
ctx.n_pixels = src->w;
ctx.op = GIMP_COMPOSITE_DISSOLVE;
ctx.dissolve.x = src->x;
ctx.dissolve.y = src->y + h;
ctx.dissolve.opacity = opacity;
gimp_composite_dispatch (&ctx);
}
else
{
dissolve_pixels (s, m, buf, src->x, src->y + h,
opacity, src->w,
src->bytes, src->bytes,
TRUE);
}
GimpCompositeContext ctx;
ctx.A = NULL;
ctx.pixelformat_A = GIMP_PIXELFORMAT_RGBA8;
ctx.B = s;
ctx.pixelformat_B = (src->bytes == 1 ? GIMP_PIXELFORMAT_V8
: src->bytes == 2 ? GIMP_PIXELFORMAT_VA8
: src->bytes == 3 ? GIMP_PIXELFORMAT_RGB8
: src->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8
: GIMP_PIXELFORMAT_ANY);
ctx.D = buf;
ctx.pixelformat_D = ctx.pixelformat_B;
ctx.M = m;
ctx.n_pixels = src->w;
ctx.op = GIMP_COMPOSITE_DISSOLVE;
ctx.dissolve.x = src->x;
ctx.dissolve.y = src->y + h;
ctx.dissolve.opacity = opacity;
gimp_composite_dispatch (&ctx);
initial_inten_a_pixels (buf, d, NULL, OPAQUE_OPACITY, affect,
src->w, src->bytes);
......@@ -4270,73 +4215,44 @@ combine_sub_region (struct combine_regions_struct *st,
{
/* Now, apply the paint mode */
if (gimp_composite_options.bits & GIMP_COMPOSITE_OPTION_USE)
{
GimpCompositeContext ctx;
ctx.A = s1;
ctx.pixelformat_A = (src1->bytes == 1 ? GIMP_PIXELFORMAT_V8 :
src1->bytes == 2 ? GIMP_PIXELFORMAT_VA8 :
src1->bytes == 3 ? GIMP_PIXELFORMAT_RGB8 :
src1->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8 :
GIMP_PIXELFORMAT_ANY);
ctx.B = s2;
ctx.pixelformat_B = (src2->bytes == 1 ? GIMP_PIXELFORMAT_V8 :
src2->bytes == 2 ? GIMP_PIXELFORMAT_VA8 :
src2->bytes == 3 ? GIMP_PIXELFORMAT_RGB8 :
src2->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8 :
GIMP_PIXELFORMAT_ANY);
ctx.D = s;
ctx.pixelformat_D = ctx.pixelformat_A;
ctx.M = layer_mode_mask;
ctx.pixelformat_M = GIMP_PIXELFORMAT_ANY;
ctx.n_pixels = src1->w;
ctx.combine = combine;
ctx.op = mode;
ctx.dissolve.x = src1->x;
ctx.dissolve.y = src1->y + h;
ctx.dissolve.opacity = layer_mode_opacity;
mode_affect =
gimp_composite_operation_effects[mode].affect_opacity;
gimp_composite_dispatch (&ctx);
s = ctx.D;
combine = (ctx.combine == NO_COMBINATION) ? type : ctx.combine;
}
else
{
struct apply_layer_mode_struct alms;
alms.src1 = s1;
alms.src2 = s2;
alms.mask = layer_mode_mask;
alms.dest = &s;
alms.x = src1->x;
alms.y = src1->y + h;
alms.opacity = layer_mode_opacity;
alms.combine = combine;
alms.length = src1->w;
alms.bytes1 = src1->bytes;
alms.bytes2 = src2->bytes;
/* Determine whether the alpha channel of the destination
* can be affected by the specified mode. -- This keeps
* consistency with varying opacities.
*/
mode_affect = layer_modes[mode].affect_alpha;
layer_mode_funcs[mode] (&alms);
combine = (alms.combine == NO_COMBINATION ?
type : alms.combine);
}
GimpCompositeContext ctx;
ctx.A = s1;
ctx.pixelformat_A = (src1->bytes == 1 ? GIMP_PIXELFORMAT_V8 :
src1->bytes == 2 ? GIMP_PIXELFORMAT_VA8 :
src1->bytes == 3 ? GIMP_PIXELFORMAT_RGB8 :
src1->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8 :
GIMP_PIXELFORMAT_ANY);
ctx.B = s2;
ctx.pixelformat_B = (src2->bytes == 1 ? GIMP_PIXELFORMAT_V8 :
src2->bytes == 2 ? GIMP_PIXELFORMAT_VA8 :
src2->bytes == 3 ? GIMP_PIXELFORMAT_RGB8 :
src2->bytes == 4 ? GIMP_PIXELFORMAT_RGBA8 :
GIMP_PIXELFORMAT_ANY);
ctx.D = s;
ctx.pixelformat_D = ctx.pixelformat_A;
ctx.M = layer_mode_mask;
ctx.pixelformat_M = GIMP_PIXELFORMAT_ANY;
ctx.n_pixels = src1->w;
ctx.combine = combine;
ctx.op = mode;
ctx.dissolve.x = src1->x;
ctx.dissolve.y = src1->y + h;
ctx.dissolve.opacity = layer_mode_opacity;
mode_affect =
gimp_composite_operation_effects[mode].affect_opacity;
gimp_composite_dispatch (&ctx);
s = ctx.D;
combine = (ctx.combine == NO_COMBINATION) ? type : ctx.combine;
}
break;
......
......@@ -8873,7 +8873,6 @@ gimp_composite_pixelformat_astext
gimp_composite_mode_astext
gimp_composite_use_cpu_accel
GIMP_COMPOSITE_OPTION_NOEXTENSIONS
GIMP_COMPOSITE_OPTION_USE
GIMP_COMPOSITE_OPTION_VERBOSE
</SECTION>
......
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