app/composite/gimp-composite.h app/composite/gimp-composite-generic.h
* app/composite/gimp-composite.h
* app/composite/gimp-composite-generic.h
* app/composite/gimp-composite-regression.h: Reformatted to include
argument names in function prototypes.
* app/composite/gimp-composite.c
* app/composite/gimp-composite-generic.c
* app/composite/gimp-composite-regression.c: Added gtk-doc templates for functions.
* app/composite/make-install.py: migrated to new (trimmer) code and
removed dead code. Some beautification for generated code.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis,generic}.{c,h}:
All init() functions are also a run-time check and now expected to
return TRUE/FALSE if the particular set of compositing functions can
be used.
* app/composite/gimp-composite.c: No longer has to determine if
the particular set of compositing functions can be used.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-{install,test}.c:
Regenerated
* app/composite/test-composite.c: Deprecated, removed. All tests are automatically
generated and the code is in app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-test.c:
* app/composite/Makefile.am: removed unused references to test-composite.c
2003-10-12 00:10:21 +00:00
|
|
|
/* -*- mode: c; c-default-style: "gnu"; tab-width: 2; c-basic-indent: 2; indent-tabs-mode: nil -*-
|
migrated to new (trimmer) code and removed dead code. Some beautification
* app/composite/make-install.py: migrated to new (trimmer) code and
removed dead code. Some beautification for generated code.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis,generic}.{c,h}:
All init() functions are also a run-time check and now expected to
return TRUE/FALSE if the particular set of compositing functions can
be used.
* app/composite/gimp-composite.c: No longer has to determine if
the particular set of compositing functions can be used.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-{install,test}.c:
Regenerated
* app/composite/test-composite.c: Deprecated, removed. All tests are automatically
generated and the code is in app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-test.c:
* app/composite/Makefile.am: removed unused references to test-composite.c
2003-10-06 02:46:15 +00:00
|
|
|
* The GIMP -- an image manipulation program
|
2003-07-08 23:15:16 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* Gimp Image Compositing
|
|
|
|
* Copyright (C) 2003 Helvetix Victorinox, a pseudonym, <helvetix@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 2 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
#ifndef __GIMP_COMPOSITE_H__
|
|
|
|
#define __GIMP_COMPOSITE_H__
|
2003-07-08 23:15:16 +00:00
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2003-07-08 23:15:16 +00:00
|
|
|
GIMP_PIXELFORMAT_V8,
|
|
|
|
GIMP_PIXELFORMAT_VA8,
|
|
|
|
GIMP_PIXELFORMAT_RGB8,
|
|
|
|
GIMP_PIXELFORMAT_RGBA8,
|
app/composite/gimp-composite.h app/composite/gimp-composite-generic.h
* app/composite/gimp-composite.h
* app/composite/gimp-composite-generic.h
* app/composite/gimp-composite-regression.h: Reformatted to include
argument names in function prototypes.
* app/composite/gimp-composite.c
* app/composite/gimp-composite-generic.c
* app/composite/gimp-composite-regression.c: Added gtk-doc templates for functions.
* app/composite/make-install.py: migrated to new (trimmer) code and
removed dead code. Some beautification for generated code.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis,generic}.{c,h}:
All init() functions are also a run-time check and now expected to
return TRUE/FALSE if the particular set of compositing functions can
be used.
* app/composite/gimp-composite.c: No longer has to determine if
the particular set of compositing functions can be used.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-{install,test}.c:
Regenerated
* app/composite/test-composite.c: Deprecated, removed. All tests are automatically
generated and the code is in app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-test.c:
* app/composite/Makefile.am: removed unused references to test-composite.c
2003-10-12 00:10:21 +00:00
|
|
|
GIMP_PIXELFORMAT_ANY,
|
|
|
|
GIMP_PIXELFORMAT_N
|
|
|
|
} GimpPixelFormat;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gtk-doc is unhappy with these #ifdef's inside the enumeration.
|
|
|
|
*
|
|
|
|
#ifdef GIMP_COMPOSITE_16BIT
|
2003-07-08 23:15:16 +00:00
|
|
|
GIMP_PIXELFORMAT_V16,
|
|
|
|
GIMP_PIXELFORMAT_VA16,
|
|
|
|
GIMP_PIXELFORMAT_RGB16,
|
|
|
|
GIMP_PIXELFORMAT_RGBA16,
|
2003-07-18 07:36:55 +00:00
|
|
|
#endif
|
app/composite/gimp-composite.h app/composite/gimp-composite-generic.h
* app/composite/gimp-composite.h
* app/composite/gimp-composite-generic.h
* app/composite/gimp-composite-regression.h: Reformatted to include
argument names in function prototypes.
* app/composite/gimp-composite.c
* app/composite/gimp-composite-generic.c
* app/composite/gimp-composite-regression.c: Added gtk-doc templates for functions.
* app/composite/make-install.py: migrated to new (trimmer) code and
removed dead code. Some beautification for generated code.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis,generic}.{c,h}:
All init() functions are also a run-time check and now expected to
return TRUE/FALSE if the particular set of compositing functions can
be used.
* app/composite/gimp-composite.c: No longer has to determine if
the particular set of compositing functions can be used.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-{install,test}.c:
Regenerated
* app/composite/test-composite.c: Deprecated, removed. All tests are automatically
generated and the code is in app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-test.c:
* app/composite/Makefile.am: removed unused references to test-composite.c
2003-10-12 00:10:21 +00:00
|
|
|
#ifdef GIMP_COMPOSITE_32BIT
|
2003-07-18 07:36:55 +00:00
|
|
|
GIMP_PIXELFORMAT_V32,
|
|
|
|
GIMP_PIXELFORMAT_VA32,
|
|
|
|
GIMP_PIXELFORMAT_RGB32,
|
|
|
|
GIMP_PIXELFORMAT_RGBA32,
|
2003-07-08 23:15:16 +00:00
|
|
|
#endif
|
app/composite/gimp-composite.h app/composite/gimp-composite-generic.h
* app/composite/gimp-composite.h
* app/composite/gimp-composite-generic.h
* app/composite/gimp-composite-regression.h: Reformatted to include
argument names in function prototypes.
* app/composite/gimp-composite.c
* app/composite/gimp-composite-generic.c
* app/composite/gimp-composite-regression.c: Added gtk-doc templates for functions.
* app/composite/make-install.py: migrated to new (trimmer) code and
removed dead code. Some beautification for generated code.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis,generic}.{c,h}:
All init() functions are also a run-time check and now expected to
return TRUE/FALSE if the particular set of compositing functions can
be used.
* app/composite/gimp-composite.c: No longer has to determine if
the particular set of compositing functions can be used.
* app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-{install,test}.c:
Regenerated
* app/composite/test-composite.c: Deprecated, removed. All tests are automatically
generated and the code is in app/composite/gimp-composite-{mmx,sse,sse2,3dnow,altivec,vis}-test.c:
* app/composite/Makefile.am: removed unused references to test-composite.c
2003-10-12 00:10:21 +00:00
|
|
|
*
|
|
|
|
*/
|
2003-07-08 23:15:16 +00:00
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
/* bytes per-pixel for each of the pixel formats */
|
|
|
|
extern const guchar gimp_composite_pixel_bpp[];
|
|
|
|
|
|
|
|
/* does pixel format have alpha? */
|
|
|
|
extern const guchar gimp_composite_pixel_alphap[];
|
|
|
|
|
|
|
|
/* converter between alpha and non-alpha pixel formats */
|
|
|
|
extern const GimpPixelFormat gimp_composite_pixel_alpha[];
|
|
|
|
|
2003-07-08 23:15:16 +00:00
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
#define GIMP_COMPOSITE_ALPHA_OPAQUE (-1)
|
2003-07-08 23:15:16 +00:00
|
|
|
#define GIMP_COMPOSITE_ALPHA_TRANSPARENT (0)
|
2003-07-09 11:52:10 +00:00
|
|
|
|
2003-07-08 23:15:16 +00:00
|
|
|
/*
|
|
|
|
* This is the enumeration of all the supported compositing
|
|
|
|
* operations. Many of them are taken from the GimpLayerModeEffect
|
|
|
|
* enumeration, but there are (possibly more) implemented. Here is
|
|
|
|
* where they are all enumerated.
|
|
|
|
*
|
|
|
|
* Nota Bene: Unfortunately, the order here is important!
|
|
|
|
*/
|
2003-07-09 11:52:10 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2003-07-08 23:15:16 +00:00
|
|
|
GIMP_COMPOSITE_NORMAL = GIMP_NORMAL_MODE,
|
|
|
|
GIMP_COMPOSITE_DISSOLVE = GIMP_DISSOLVE_MODE,
|
|
|
|
GIMP_COMPOSITE_BEHIND = GIMP_BEHIND_MODE,
|
|
|
|
GIMP_COMPOSITE_MULTIPLY = GIMP_MULTIPLY_MODE,
|
|
|
|
GIMP_COMPOSITE_SCREEN = GIMP_SCREEN_MODE,
|
|
|
|
GIMP_COMPOSITE_OVERLAY = GIMP_OVERLAY_MODE,
|
|
|
|
GIMP_COMPOSITE_DIFFERENCE = GIMP_DIFFERENCE_MODE,
|
|
|
|
GIMP_COMPOSITE_ADDITION = GIMP_ADDITION_MODE,
|
|
|
|
GIMP_COMPOSITE_SUBTRACT = GIMP_SUBTRACT_MODE,
|
|
|
|
GIMP_COMPOSITE_DARKEN = GIMP_DARKEN_ONLY_MODE,
|
|
|
|
GIMP_COMPOSITE_LIGHTEN = GIMP_LIGHTEN_ONLY_MODE,
|
|
|
|
GIMP_COMPOSITE_HUE = GIMP_HUE_MODE,
|
|
|
|
GIMP_COMPOSITE_SATURATION = GIMP_SATURATION_MODE,
|
|
|
|
GIMP_COMPOSITE_COLOR_ONLY = GIMP_COLOR_MODE,
|
|
|
|
GIMP_COMPOSITE_VALUE = GIMP_VALUE_MODE,
|
|
|
|
GIMP_COMPOSITE_DIVIDE = GIMP_DIVIDE_MODE,
|
|
|
|
GIMP_COMPOSITE_DODGE = GIMP_DODGE_MODE,
|
|
|
|
GIMP_COMPOSITE_BURN = GIMP_BURN_MODE,
|
|
|
|
GIMP_COMPOSITE_HARDLIGHT = GIMP_HARDLIGHT_MODE,
|
|
|
|
GIMP_COMPOSITE_SOFTLIGHT = GIMP_SOFTLIGHT_MODE,
|
|
|
|
GIMP_COMPOSITE_GRAIN_EXTRACT = GIMP_GRAIN_EXTRACT_MODE,
|
|
|
|
GIMP_COMPOSITE_GRAIN_MERGE = GIMP_GRAIN_MERGE_MODE,
|
|
|
|
GIMP_COMPOSITE_COLOR_ERASE = GIMP_COLOR_ERASE_MODE,
|
|
|
|
GIMP_COMPOSITE_ERASE = GIMP_ERASE_MODE,
|
|
|
|
GIMP_COMPOSITE_REPLACE = GIMP_REPLACE_MODE,
|
|
|
|
GIMP_COMPOSITE_ANTI_ERASE = GIMP_ANTI_ERASE_MODE,
|
|
|
|
GIMP_COMPOSITE_BLEND,
|
|
|
|
GIMP_COMPOSITE_SHADE,
|
|
|
|
GIMP_COMPOSITE_SWAP,
|
|
|
|
GIMP_COMPOSITE_SCALE,
|
|
|
|
GIMP_COMPOSITE_CONVERT,
|
2003-07-24 08:00:12 +00:00
|
|
|
GIMP_COMPOSITE_XOR,
|
2003-07-08 23:15:16 +00:00
|
|
|
GIMP_COMPOSITE_N
|
|
|
|
} GimpCompositeOperation;
|
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
struct GimpCompositeOperationEffects
|
|
|
|
{
|
|
|
|
guchar affect_opacity;
|
|
|
|
guchar increase_opacity;
|
|
|
|
guchar decrease_opacity;
|
2003-07-08 23:15:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct GimpCompositeOperationEffects gimp_composite_operation_effects[];
|
|
|
|
|
2003-10-14 17:34:05 +00:00
|
|
|
/*
|
2003-07-08 23:15:16 +00:00
|
|
|
* This is structure for communicating all that is necessary to a
|
|
|
|
* compositing operation.
|
|
|
|
*/
|
2003-07-09 11:52:10 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
guchar *A; /* Source A */
|
|
|
|
guchar *B; /* Source B */
|
|
|
|
guchar *D; /* Destination */
|
|
|
|
guchar *M; /* Mask */
|
|
|
|
gulong n_pixels;
|
2003-07-08 23:15:16 +00:00
|
|
|
|
|
|
|
GimpPixelFormat pixelformat_A;
|
|
|
|
GimpPixelFormat pixelformat_B;
|
|
|
|
GimpPixelFormat pixelformat_D;
|
|
|
|
GimpPixelFormat pixelformat_M;
|
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
struct { gint opacity; gchar affect; } replace;
|
|
|
|
struct { gint scale; } scale;
|
|
|
|
struct { gint blend; } blend;
|
|
|
|
struct { gint x; gint y; gint opacity; } dissolve;
|
2003-07-08 23:15:16 +00:00
|
|
|
|
2003-07-09 11:52:10 +00:00
|
|
|
CombinationMode combine;
|
2003-07-08 23:15:16 +00:00
|
|
|
GimpCompositeOperation op;
|
|
|
|
} GimpCompositeContext;
|
|
|
|
|
|
|
|
|
2003-10-14 17:34:05 +00:00
|
|
|
struct GimpCompositeOptions
|
|
|
|
{
|
|
|
|
gulong bits;
|
2003-07-18 07:36:55 +00:00
|
|
|
};
|
2003-10-14 17:34:05 +00:00
|
|
|
|
2003-10-23 22:35:06 +00:00
|
|
|
#define GIMP_COMPOSITE_OPTION_USE 0x1
|
|
|
|
#define GIMP_COMPOSITE_OPTION_NOEXTENSIONS 0x2
|
|
|
|
#define GIMP_COMPOSITE_OPTION_VERBOSE 0x4
|
2003-08-14 07:43:34 +00:00
|
|
|
|
2003-07-18 07:36:55 +00:00
|
|
|
|
|
|
|
extern struct GimpCompositeOptions gimp_composite_options;
|
|
|
|
|
2004-07-20 14:33:22 +00:00
|
|
|
void gimp_composite_init (gboolean be_verbose,
|
|
|
|
gboolean use_cpu_accel);
|
2003-08-14 07:43:34 +00:00
|
|
|
|
2004-07-20 14:33:22 +00:00
|
|
|
void gimp_composite_dispatch (GimpCompositeContext *ctx);
|
|
|
|
|
|
|
|
void gimp_composite_context_print (GimpCompositeContext *ctx);
|
|
|
|
const gchar * gimp_composite_mode_astext (GimpCompositeOperation op);
|
|
|
|
const gchar * gimp_composite_pixelformat_astext (GimpPixelFormat format);
|
2003-08-14 07:43:34 +00:00
|
|
|
|
2004-06-12 19:23:45 +00:00
|
|
|
extern const gchar *gimp_composite_function_name[GIMP_COMPOSITE_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N];
|
2003-08-14 07:43:34 +00:00
|
|
|
extern void (*gimp_composite_function[GIMP_COMPOSITE_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N][GIMP_PIXELFORMAT_N])(GimpCompositeContext *);
|
2003-07-09 11:52:10 +00:00
|
|
|
|
|
|
|
#endif /* __GIMP_COMPOSITE_H__ */
|