app: start moving layer modes into their own build directories

New directories:

operations/layer-modes/
operations/layer-modes-legacy/
This commit is contained in:
Michael Natterer 2017-01-09 21:57:15 +01:00
parent 67275dd1ff
commit fd070eeb25
24 changed files with 341 additions and 272 deletions

View file

@ -136,41 +136,43 @@ AM_LDFLAGS = \
-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_param_spec
gimpconsoleldadd = \
xcf/libappxcf.a \
pdb/libappinternal-procs.a \
pdb/libapppdb.a \
plug-in/libappplug-in.a \
vectors/libappvectors.a \
core/libappcore.a \
file/libappfile.a \
text/libapptext.a \
paint/libapppaint.a \
operations/libappoperations.a \
gegl/libappgegl.a \
config/libappconfig.a \
$(libgimpconfig) \
$(libgimpmath) \
$(libgimpthumb) \
$(libgimpcolor) \
$(libgimpmodule) \
$(libgimpbase) \
$(GDK_PIXBUF_LIBS) \
$(FREETYPE_LIBS) \
$(FONTCONFIG_LIBS) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(CAIRO_LIBS) \
$(GIO_UNIX_LIBS) \
$(GIO_WINDOWS_LIBS) \
$(GEGL_LIBS) \
$(GLIB_LIBS) \
$(LCMS_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBMYPAINT_LIBS) \
$(INTLLIBS) \
$(RT_LIBS) \
xcf/libappxcf.a \
pdb/libappinternal-procs.a \
pdb/libapppdb.a \
plug-in/libappplug-in.a \
vectors/libappvectors.a \
core/libappcore.a \
file/libappfile.a \
text/libapptext.a \
paint/libapppaint.a \
operations/libappoperations.a \
operations/layer-modes/libapplayermodes.a \
operations/layer-modes-legacy/libapplayermodeslegacy.a \
gegl/libappgegl.a \
config/libappconfig.a \
$(libgimpconfig) \
$(libgimpmath) \
$(libgimpthumb) \
$(libgimpcolor) \
$(libgimpmodule) \
$(libgimpbase) \
$(GDK_PIXBUF_LIBS) \
$(FREETYPE_LIBS) \
$(FONTCONFIG_LIBS) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(CAIRO_LIBS) \
$(GIO_UNIX_LIBS) \
$(GIO_WINDOWS_LIBS) \
$(GEGL_LIBS) \
$(GLIB_LIBS) \
$(LCMS_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBMYPAINT_LIBS) \
$(INTLLIBS) \
$(RT_LIBS) \
$(libm)
gimp_@GIMP_APP_VERSION@_LDFLAGS = \

View file

@ -92,35 +92,37 @@ test_config_LDFLAGS = \
-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_param_spec
test_config_LDADD = \
../xcf/libappxcf.a \
../pdb/libappinternal-procs.a \
../pdb/libapppdb.a \
../plug-in/libappplug-in.a \
../vectors/libappvectors.a \
../core/libappcore.a \
../file/libappfile.a \
../text/libapptext.a \
../paint/libapppaint.a \
../gegl/libappgegl.a \
../operations/libappoperations.a \
libappconfig.a \
../gimp-debug.o \
../gimp-log.o \
$(libgimpmodule) \
$(libgimpcolor) \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpbase) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GEGL_LIBS) \
$(GIO_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBMYPAINT_LIBS) \
../xcf/libappxcf.a \
../pdb/libappinternal-procs.a \
../pdb/libapppdb.a \
../plug-in/libappplug-in.a \
../vectors/libappvectors.a \
../core/libappcore.a \
../file/libappfile.a \
../text/libapptext.a \
../paint/libapppaint.a \
../gegl/libappgegl.a \
../operations/libappoperations.a \
../operations/layer-modes/libapplayermodes.a \
../operations/layer-modes-legacy/libapplayermodeslegacy.a \
libappconfig.a \
../gimp-debug.o \
../gimp-log.o \
$(libgimpmodule) \
$(libgimpcolor) \
$(libgimpthumb) \
$(libgimpmath) \
$(libgimpconfig) \
$(libgimpbase) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(GEGL_LIBS) \
$(GIO_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBMYPAINT_LIBS) \
$(libm)
CLEANFILES = $(EXTRA_PROGRAMS) foorc

View file

@ -1,5 +1,9 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = tests
SUBDIRS = \
layer-modes \
layer-modes-legacy \
tests
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Operations\" \
@ -13,12 +17,9 @@ AM_CPPFLAGS = \
-I$(includedir)
noinst_LIBRARIES = \
libappoperations-generic.a \
libappoperations-sse2.a \
libappoperations-sse4.a \
libappoperations.a
libappoperations_generic_a_sources = \
libappoperations_a_SOURCES = \
operations-types.h \
gimp-operations.c \
gimp-operations.h \
@ -96,16 +97,10 @@ libappoperations_generic_a_sources = \
\
gimpoperationpointlayermode.c \
gimpoperationpointlayermode.h \
gimpoperationnormalmode.c \
gimpoperationnormalmode.h \
gimpoperationdissolvemode.c \
gimpoperationdissolvemode.h \
gimpoperationbehindmode.c \
gimpoperationbehindmode.h \
gimpoperationmultiply.c \
gimpoperationmultiply.h \
gimpoperationmultiplylegacy.c \
gimpoperationmultiplylegacy.h \
gimpoperationscreenmode.c \
gimpoperationscreenmode.h \
gimpoperationoverlaymode.c \
@ -130,10 +125,6 @@ libappoperations_generic_a_sources = \
gimpoperationvaluemode.h \
gimpoperationdividemode.c \
gimpoperationdividemode.h \
gimpoperationdodge.c \
gimpoperationdodge.h \
gimpoperationdodgelegacy.c \
gimpoperationdodgelegacy.h \
gimpoperationburnmode.c \
gimpoperationburnmode.h \
gimpoperationhardlightmode.c \
@ -163,30 +154,3 @@ libappoperations_generic_a_sources = \
\
gimplayermodefunctions.c \
gimplayermodefunctions.h
libappoperations_sse2_a_sources = \
gimpoperationnormalmode-sse2.c
libappoperations_sse4_a_sources = \
gimpoperationnormalmode-sse4.c
libappoperations_sse2_a_SOURCES = $(libappoperations_sse2_a_sources)
libappoperations_sse2_a_CFLAGS = $(SSE2_EXTRA_CFLAGS)
libappoperations_sse4_a_SOURCES = $(libappoperations_sse4_a_sources)
libappoperations_sse4_a_CFLAGS = $(SSE4_1_EXTRA_CFLAGS)
libappoperations_generic_a_SOURCES = $(libappoperations_generic_a_sources)
libappoperations_a_SOURCES =
libappoperations.a: libappoperations-generic.a \
libappoperations-sse2.a \
libappoperations-sse4.a
$(AR) $(ARFLAGS) libappoperations.a \
$(libappoperations_generic_a_OBJECTS) \
$(libappoperations_sse2_a_OBJECTS) \
$(libappoperations_sse4_a_OBJECTS)
$(RANLIB) libappoperations.a

View file

@ -66,11 +66,11 @@
#include "gimplevelsconfig.h"
#include "gimpoperationpointlayermode.h"
#include "gimpoperationnormalmode.h"
#include "layer-modes/gimpoperationnormal.h"
#include "gimpoperationdissolvemode.h"
#include "gimpoperationbehindmode.h"
#include "gimpoperationmultiply.h"
#include "gimpoperationmultiplylegacy.h"
#include "layer-modes/gimpoperationmultiply.h"
#include "layer-modes-legacy/gimpoperationmultiplylegacy.h"
#include "gimpoperationscreenmode.h"
#include "gimpoperationoverlaymode.h"
#include "gimpoperationdifferencemode.h"
@ -83,8 +83,8 @@
#include "gimpoperationcolormode.h"
#include "gimpoperationvaluemode.h"
#include "gimpoperationdividemode.h"
#include "gimpoperationdodge.h"
#include "gimpoperationdodgelegacy.h"
#include "layer-modes/gimpoperationdodge.h"
#include "layer-modes-legacy/gimpoperationdodgelegacy.h"
#include "gimpoperationburnmode.h"
#include "gimpoperationhardlightmode.h"
#include "gimpoperationsoftlightmode.h"
@ -132,7 +132,7 @@ gimp_operations_init (void)
g_type_class_ref (GIMP_TYPE_OPERATION_THRESHOLD);
g_type_class_ref (GIMP_TYPE_OPERATION_POINT_LAYER_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_NORMAL_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_NORMAL);
g_type_class_ref (GIMP_TYPE_OPERATION_DISSOLVE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_BEHIND_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_MULTIPLY);

View file

@ -25,12 +25,12 @@
#include "operations-types.h"
#include "gimplayermodefunctions.h"
#include "gimpoperationpointlayermode.h"
#include "gimpoperationnormalmode.h"
#include "layer-modes/gimpoperationnormal.h"
#include "gimpoperationdissolvemode.h"
#include "gimpoperationbehindmode.h"
#include "gimpoperationmultiply.h"
#include "gimpoperationmultiplylegacy.h"
#include "layer-modes/gimpoperationmultiply.h"
#include "layer-modes-legacy/gimpoperationmultiplylegacy.h"
#include "gimpoperationscreenmode.h"
#include "gimpoperationoverlaymode.h"
#include "gimpoperationdifferencemode.h"
@ -43,8 +43,8 @@
#include "gimpoperationcolormode.h"
#include "gimpoperationvaluemode.h"
#include "gimpoperationdividemode.h"
#include "gimpoperationdodge.h"
#include "gimpoperationdodgelegacy.h"
#include "layer-modes/gimpoperationdodge.h"
#include "layer-modes-legacy/gimpoperationdodgelegacy.h"
#include "gimpoperationburnmode.h"
#include "gimpoperationhardlightmode.h"
#include "gimpoperationsoftlightmode.h"
@ -64,12 +64,12 @@ GimpLayerModeFunction
get_layer_mode_function (GimpLayerMode paint_mode,
gboolean linear_mode)
{
GimpLayerModeFunction func = gimp_operation_normal_mode_process_pixels;
GimpLayerModeFunction func = gimp_operation_normal_process_pixels;
switch (paint_mode)
{
case GIMP_LAYER_MODE_NORMAL:
func = gimp_operation_normal_mode_process_pixels;
func = gimp_operation_normal_process_pixels;
break;
case GIMP_LAYER_MODE_DISSOLVE:
@ -210,7 +210,7 @@ get_layer_mode_function (GimpLayerMode paint_mode,
default:
g_warning ("No direct function for layer mode (%d), using gimp:normal-mode", paint_mode);
func = gimp_operation_normal_mode_process_pixels;
func = gimp_operation_normal_process_pixels;
break;
}

View file

@ -1,81 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationnormalmode.h
* Copyright (C) 2012 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_NORMAL_MODE_H__
#define __GIMP_OPERATION_NORMAL_MODE_H__
#include "gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_NORMAL_MODE (gimp_operation_normal_mode_get_type ())
#define GIMP_OPERATION_NORMAL_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_NORMAL_MODE, GimpOperationNormalMode))
#define GIMP_OPERATION_NORMAL_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_NORMAL_MODE, GimpOperationNormalModeClass))
#define GIMP_IS_OPERATION_NORMAL_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_NORMAL_MODE))
#define GIMP_IS_OPERATION_NORMAL_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_NORMAL_MODE))
#define GIMP_OPERATION_NORMAL_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_NORMAL_MODE, GimpOperationNormalModeClass))
typedef struct _GimpOperationNormalMode GimpOperationNormalMode;
typedef struct _GimpOperationNormalModeClass GimpOperationNormalModeClass;
struct _GimpOperationNormalMode
{
GimpOperationPointLayerMode parent_instance;
};
struct _GimpOperationNormalModeClass
{
GimpOperationPointLayerModeClass parent_class;
};
GType gimp_operation_normal_mode_get_type (void) G_GNUC_CONST;
extern GimpLayerModeFunction gimp_operation_normal_mode_process_pixels;
gboolean gimp_operation_normal_mode_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_mode_process_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_mode_process_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_NORMAL_MODE_H__ */

View file

@ -0,0 +1,5 @@
/Makefile
/Makefile.in
/.deps
/.libs
/libapplayermodeslegacy.a

View file

@ -0,0 +1,21 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Layer-Modes-Legacy\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(CAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = \
libapplayermodeslegacy.a
libapplayermodeslegacy_a_SOURCES = \
gimpoperationmultiplylegacy.c \
gimpoperationmultiplylegacy.h \
gimpoperationdodgelegacy.c \
gimpoperationdodgelegacy.h

View file

@ -23,7 +23,7 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationdodgelegacy.h"

View file

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_DODGE_LEGACY_H__
#include "gimpoperationpointlayermode.h"
#include "operations/gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_DODGE_LEGACY (gimp_operation_dodge_legacy_get_type ())
@ -47,7 +47,7 @@ struct _GimpOperationDodgeLegacyClass
};
GType gimp_operation_dodge_legacy_get_type (void) G_GNUC_CONST;
GType gimp_operation_dodge_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dodge_legacy_process_pixels (gfloat *in,
gfloat *layer,
@ -58,4 +58,5 @@ gboolean gimp_operation_dodge_legacy_process_pixels (gfloat *in,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DODGE_LEGACY_H__ */

View file

@ -23,7 +23,7 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationmultiplylegacy.h"

View file

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_MULTIPLY_LEGACY_H__
#include "gimpoperationpointlayermode.h"
#include "operations/gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_MULTIPLY_LEGACY (gimp_operation_multiply_legacy_get_type ())
@ -47,7 +47,7 @@ struct _GimpOperationMultiplyLegacyClass
};
GType gimp_operation_multiply_legacy_get_type (void) G_GNUC_CONST;
GType gimp_operation_multiply_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_multiply_legacy_process_pixels (gfloat *in,
gfloat *layer,
@ -58,4 +58,5 @@ gboolean gimp_operation_multiply_legacy_process_pixels (gfloat *in,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_MULTIPLY_LEGACY_H__ */

8
app/operations/layer-modes/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
/Makefile
/Makefile.in
/.deps
/.libs
/libapplayermodes.a
/libapplayermodes-generic.a
/libapplayermodes-sse2.a
/libapplayermodes-sse4.a

View file

@ -0,0 +1,55 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Layer-Modes\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(CAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GDK_PIXBUF_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = \
libapplayermodes-generic.a \
libapplayermodes-sse2.a \
libapplayermodes-sse4.a \
libapplayermodes.a
libapplayermodes_generic_a_sources = \
gimpoperationnormal.c \
gimpoperationnormal.h \
gimpoperationdodge.c \
gimpoperationdodge.h \
gimpoperationmultiply.c \
gimpoperationmultiply.h
libapplayermodes_sse2_a_sources = \
gimpoperationnormal-sse2.c
libapplayermodes_sse4_a_sources = \
gimpoperationnormal-sse4.c
libapplayermodes_generic_a_SOURCES = $(libapplayermodes_generic_a_sources)
libapplayermodes_sse2_a_SOURCES = $(libapplayermodes_sse2_a_sources)
libapplayermodes_sse2_a_CFLAGS = $(SSE2_EXTRA_CFLAGS)
libapplayermodes_sse4_a_SOURCES = $(libapplayermodes_sse4_a_sources)
libapplayermodes_sse4_a_CFLAGS = $(SSE4_1_EXTRA_CFLAGS)
libapplayermodes_a_SOURCES =
libapplayermodes.a: libapplayermodes-generic.a \
libapplayermodes-sse2.a \
libapplayermodes-sse4.a
$(AR) $(ARFLAGS) libapplayermodes.a \
$(libapplayermodes_generic_a_OBJECTS) \
$(libapplayermodes_sse2_a_OBJECTS) \
$(libapplayermodes_sse4_a_OBJECTS)
$(RANLIB) libapplayermodes.a

View file

@ -24,7 +24,7 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationdodge.h"

View file

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_DODGE_H__
#include "gimpoperationpointlayermode.h"
#include "operations/gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_DODGE (gimp_operation_dodge_get_type ())
@ -48,7 +48,7 @@ struct _GimpOperationDodgeClass
};
GType gimp_operation_dodge_get_type (void) G_GNUC_CONST;
GType gimp_operation_dodge_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dodge_process_pixels (gfloat *in,
gfloat *layer,
@ -56,7 +56,8 @@ gboolean gimp_operation_dodge_process_pixels (gfloat *in,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DODGE_H__ */

View file

@ -24,7 +24,7 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationmultiply.h"

View file

@ -22,7 +22,9 @@
#ifndef __GIMP_OPERATION_MULTIPLY_H__
#define __GIMP_OPERATION_MULTIPLY_H__
#include "gimpoperationpointlayermode.h"
#include "operations/gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_MULTIPLY (gimp_operation_multiply_get_type ())
#define GIMP_OPERATION_MULTIPLY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_MULTIPLY, GimpOperationMultiply))
@ -46,7 +48,7 @@ struct _GimpOperationMultiplyClass
};
GType gimp_operation_multiply_get_type (void) G_GNUC_CONST;
GType gimp_operation_multiply_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_multiply_process_pixels (gfloat *in,
gfloat *layer,
@ -57,4 +59,5 @@ gboolean gimp_operation_multiply_process_pixels (gfloat *in,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_MULTIPLY_H__ */

View file

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationnormalmode-sse2.c
* gimpoperationnormal-sse2.c
* Copyright (C) 2013 Daniel Sabo
*
* This program is free software: you can redistribute it and/or modify
@ -22,30 +22,31 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationnormal.h"
#include "gimpoperationnormalmode.h"
#if COMPILE_SSE2_INTRINISICS
/* SSE2 */
#include <emmintrin.h>
gboolean
gimp_operation_normal_mode_process_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
{
/* check alignment */
if ((((uintptr_t)in) | ((uintptr_t)aux) | ((uintptr_t)out)) & 0x0F)
{
return gimp_operation_normal_mode_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level);
return gimp_operation_normal_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level);
}
else
{

View file

@ -22,30 +22,31 @@
#include <gegl-plugin.h>
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationnormal.h"
#include "gimpoperationnormalmode.h"
#if COMPILE_SSE4_1_INTRINISICS
/* SSE4 */
#include <smmintrin.h>
gboolean
gimp_operation_normal_mode_process_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
{
/* check alignment */
if ((((uintptr_t)in) | ((uintptr_t)aux) | ((uintptr_t)out)) & 0x0F)
{
return gimp_operation_normal_mode_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level);
return gimp_operation_normal_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level);
}
else
{

View file

@ -25,12 +25,12 @@
#include "libgimpbase/gimpbase.h"
#include "operations-types.h"
#include "operations/operations-types.h"
#include "gimpoperationnormalmode.h"
#include "gimpoperationnormal.h"
GimpLayerModeFunction gimp_operation_normal_mode_process_pixels = NULL;
GimpLayerModeFunction gimp_operation_normal_process_pixels = NULL;
static gboolean gimp_operation_normal_parent_process (GeglOperation *operation,
@ -38,7 +38,7 @@ static gboolean gimp_operation_normal_parent_process (GeglOperation *oper
const gchar *output_prop,
const GeglRectangle *result,
gint level);
static gboolean gimp_operation_normal_mode_process (GeglOperation *operation,
static gboolean gimp_operation_normal_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
@ -48,10 +48,10 @@ static gboolean gimp_operation_normal_mode_process (GeglOperation *oper
gint level);
G_DEFINE_TYPE (GimpOperationNormalMode, gimp_operation_normal_mode,
G_DEFINE_TYPE (GimpOperationNormal, gimp_operation_normal,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define parent_class gimp_operation_normal_mode_parent_class
#define parent_class gimp_operation_normal_parent_class
static const gchar* reference_xml = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
@ -71,7 +71,7 @@ static const gchar* reference_xml = "<?xml version='1.0' encoding='UTF-8'?>"
static void
gimp_operation_normal_mode_class_init (GimpOperationNormalModeClass *klass)
gimp_operation_normal_class_init (GimpOperationNormalClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposer3Class *point_class;
@ -88,23 +88,23 @@ gimp_operation_normal_mode_class_init (GimpOperationNormalModeClass *klass)
operation_class->process = gimp_operation_normal_parent_process;
point_class->process = gimp_operation_normal_mode_process;
point_class->process = gimp_operation_normal_process;
gimp_operation_normal_mode_process_pixels = gimp_operation_normal_mode_process_pixels_core;
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_core;
#if COMPILE_SSE2_INTRINISICS
if (gimp_cpu_accel_get_support() & GIMP_CPU_ACCEL_X86_SSE2)
gimp_operation_normal_mode_process_pixels = gimp_operation_normal_mode_process_pixels_sse2;
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_sse2;
#endif /* COMPILE_SSE2_INTRINISICS */
#if COMPILE_SSE4_1_INTRINISICS
if (gimp_cpu_accel_get_support() & GIMP_CPU_ACCEL_X86_SSE4_1)
gimp_operation_normal_mode_process_pixels = gimp_operation_normal_mode_process_pixels_sse4;
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_sse4;
#endif /* COMPILE_SSE4_1_INTRINISICS */
}
static void
gimp_operation_normal_mode_init (GimpOperationNormalMode *self)
gimp_operation_normal_init (GimpOperationNormal *self)
{
}
@ -164,29 +164,29 @@ gimp_operation_normal_parent_process (GeglOperation *operation,
}
static gboolean
gimp_operation_normal_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
return gimp_operation_normal_mode_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
return gimp_operation_normal_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
}
gboolean
gimp_operation_normal_mode_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;

View file

@ -0,0 +1,81 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationnormal.h
* Copyright (C) 2012 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_NORMAL_H__
#define __GIMP_OPERATION_NORMAL_H__
#include "operations/gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_NORMAL (gimp_operation_normal_get_type ())
#define GIMP_OPERATION_NORMAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_NORMAL, GimpOperationNormal))
#define GIMP_OPERATION_NORMAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_NORMAL, GimpOperationNormalClass))
#define GIMP_IS_OPERATION_NORMAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_NORMAL))
#define GIMP_IS_OPERATION_NORMAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_NORMAL))
#define GIMP_OPERATION_NORMAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_NORMAL, GimpOperationNormalClass))
typedef struct _GimpOperationNormal GimpOperationNormal;
typedef struct _GimpOperationNormalClass GimpOperationNormalClass;
struct _GimpOperationNormal
{
GimpOperationPointLayerMode parent_instance;
};
struct _GimpOperationNormalClass
{
GimpOperationPointLayerModeClass parent_class;
};
GType gimp_operation_normal_get_type (void) G_GNUC_CONST;
extern GimpLayerModeFunction gimp_operation_normal_process_pixels;
gboolean gimp_operation_normal_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_NORMAL_H__ */

View file

@ -102,6 +102,8 @@ LDADD = \
$(top_builddir)/app/libapp.a \
$(top_builddir)/app/gegl/libappgegl.a \
$(top_builddir)/app/operations/libappoperations.a \
$(top_builddir)/app/operations/layer-modes/libapplayermodes.a \
$(top_builddir)/app/operations/layer-modes-legacy/libapplayermodeslegacy.a \
libgimpapptestutils.a \
$(libgimpwidgets) \
$(libgimpconfig) \

View file

@ -2366,6 +2366,8 @@ app/actions/Makefile
app/config/Makefile
app/core/Makefile
app/operations/Makefile
app/operations/layer-modes/Makefile
app/operations/layer-modes-legacy/Makefile
app/operations/tests/Makefile
app/gegl/Makefile
app/dialogs/Makefile