Commit 9f6827be authored by Michael Natterer's avatar Michael Natterer 😴

app: add back individual operation classes for the layer modes

They are derived from GimpOperationPointLayerMode and are completely
empty and unused, but can be filled with code and enabled one-by-one
now.
parent a58e7ee9
......@@ -65,4 +65,54 @@ libappgegl_a_SOURCES = \
gimpoperationthreshold.h \
\
gimpoperationpointlayermode.c \
gimpoperationpointlayermode.h
gimpoperationpointlayermode.h \
gimpoperationdissolvemode.c \
gimpoperationdissolvemode.h \
gimpoperationbehindmode.c \
gimpoperationbehindmode.h \
gimpoperationmultiplymode.c \
gimpoperationmultiplymode.h \
gimpoperationscreenmode.c \
gimpoperationscreenmode.h \
gimpoperationoverlaymode.c \
gimpoperationoverlaymode.h \
gimpoperationdifferencemode.c \
gimpoperationdifferencemode.h \
gimpoperationadditionmode.c \
gimpoperationadditionmode.h \
gimpoperationsubtractmode.c \
gimpoperationsubtractmode.h \
gimpoperationdarkenonlymode.c \
gimpoperationdarkenonlymode.h \
gimpoperationlightenonlymode.c \
gimpoperationlightenonlymode.h \
gimpoperationhuemode.c \
gimpoperationhuemode.h \
gimpoperationsaturationmode.c \
gimpoperationsaturationmode.h \
gimpoperationcolormode.c \
gimpoperationcolormode.h \
gimpoperationvaluemode.c \
gimpoperationvaluemode.h \
gimpoperationdividemode.c \
gimpoperationdividemode.h \
gimpoperationdodgemode.c \
gimpoperationdodgemode.h \
gimpoperationburnmode.c \
gimpoperationburnmode.h \
gimpoperationhardlightmode.c \
gimpoperationhardlightmode.h \
gimpoperationsoftlightmode.c \
gimpoperationsoftlightmode.h \
gimpoperationgrainextractmode.c \
gimpoperationgrainextractmode.h \
gimpoperationgrainmergemode.c \
gimpoperationgrainmergemode.h \
gimpoperationcolorerasemode.c \
gimpoperationcolorerasemode.h \
gimpoperationerasemode.c \
gimpoperationerasemode.h \
gimpoperationreplacemode.c \
gimpoperationreplacemode.h \
gimpoperationantierasemode.c \
gimpoperationantierasemode.h
......@@ -39,6 +39,31 @@ typedef struct _GimpOperationPosterize GimpOperationPosterize;
typedef struct _GimpOperationThreshold GimpOperationThreshold;
typedef struct _GimpOperationPointLayerMode GimpOperationPointLayerMode;
typedef struct _GimpOperationDissolveMode GimpOperationDissolveMode;
typedef struct _GimpOperationBehindMode GimpOperationBehindMode;
typedef struct _GimpOperationMultiplyMode GimpOperationMultiplyMode;
typedef struct _GimpOperationScreenMode GimpOperationScreenMode;
typedef struct _GimpOperationOverlayMode GimpOperationOverlayMode;
typedef struct _GimpOperationDifferenceMode GimpOperationDifferenceMode;
typedef struct _GimpOperationAdditionMode GimpOperationAdditionMode;
typedef struct _GimpOperationSubtractMode GimpOperationSubtractMode;
typedef struct _GimpOperationDarkenOnlyMode GimpOperationDarkenOnlyMode;
typedef struct _GimpOperationLightenOnlyMode GimpOperationLightenOnlyMode;
typedef struct _GimpOperationHueMode GimpOperationHueMode;
typedef struct _GimpOperationSaturationMode GimpOperationSaturationMode;
typedef struct _GimpOperationColorMode GimpOperationColorMode;
typedef struct _GimpOperationValueMode GimpOperationValueMode;
typedef struct _GimpOperationDivideMode GimpOperationDivideMode;
typedef struct _GimpOperationDodgeMode GimpOperationDodgeMode;
typedef struct _GimpOperationBurnMode GimpOperationBurnMode;
typedef struct _GimpOperationHardlightMode GimpOperationHardlightMode;
typedef struct _GimpOperationSoftlightMode GimpOperationSoftlightMode;
typedef struct _GimpOperationGrainExtractMode GimpOperationGrainExtractMode;
typedef struct _GimpOperationGrainMergeMode GimpOperationGrainMergeMode;
typedef struct _GimpOperationColorEraseMode GimpOperationColorEraseMode;
typedef struct _GimpOperationEraseMode GimpOperationEraseMode;
typedef struct _GimpOperationReplaceMode GimpOperationReplaceMode;
typedef struct _GimpOperationAntiEraseMode GimpOperationAntiEraseMode;
/* operation config objects */
......
......@@ -114,3 +114,41 @@ gimp_buffer_to_tiles (GeglBuffer *buffer)
return new_tiles;
}
const gchar *
gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode)
{
switch (mode)
{
case GIMP_NORMAL_MODE: return "gegl:over";
case GIMP_DISSOLVE_MODE: return "gimp:dissolve-mode";
case GIMP_BEHIND_MODE: return "gimp:behind-mode";
case GIMP_MULTIPLY_MODE: return "gimp:multiply-mode";
case GIMP_SCREEN_MODE: return "gimp:screen-mode";
case GIMP_OVERLAY_MODE: return "gimp:overlay-mode";
case GIMP_DIFFERENCE_MODE: return "gimp:difference-mode";
case GIMP_ADDITION_MODE: return "gimp:addition-mode";
case GIMP_SUBTRACT_MODE: return "gimp:subtract-mode";
case GIMP_DARKEN_ONLY_MODE: return "gimp:darken-mode";
case GIMP_LIGHTEN_ONLY_MODE: return "gimp:lighten-mode";
case GIMP_HUE_MODE: return "gimp:hue-mode";
case GIMP_SATURATION_MODE: return "gimp:saturation-mode";
case GIMP_COLOR_MODE: return "gimp:color-mode";
case GIMP_VALUE_MODE: return "gimp:value-mode";
case GIMP_DIVIDE_MODE: return "gimp:divide-mode";
case GIMP_DODGE_MODE: return "gimp:dodge-mode";
case GIMP_BURN_MODE: return "gimp:burn-mode";
case GIMP_HARDLIGHT_MODE: return "gimp:hardlight-mode";
case GIMP_SOFTLIGHT_MODE: return "gimp:softlight-mode";
case GIMP_GRAIN_EXTRACT_MODE: return "gimp:grain-extract-mode";
case GIMP_GRAIN_MERGE_MODE: return "gimp:grain-merge-mode";
case GIMP_COLOR_ERASE_MODE: return "gimp:color-erase-mode";
case GIMP_ERASE_MODE: return "gimp:erase-mode";
case GIMP_REPLACE_MODE: return "gimp:replace-mode";
case GIMP_ANTI_ERASE_MODE: return "gimp:anti-erase-mode";
default:
break;
}
return "gegl:over";
}
......@@ -27,5 +27,7 @@ const Babl * gimp_bpp_to_babl_format (guint bpp,
TileManager * gimp_buffer_to_tiles (GeglBuffer *buffer);
const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode) G_GNUC_CONST;
#endif /* __GIMP_GEGL_UTILS_H__ */
......@@ -43,6 +43,31 @@
#include "gimpoperationtilesource.h"
#include "gimpoperationpointlayermode.h"
#include "gimpoperationdissolvemode.h"
#include "gimpoperationbehindmode.h"
#include "gimpoperationmultiplymode.h"
#include "gimpoperationscreenmode.h"
#include "gimpoperationoverlaymode.h"
#include "gimpoperationdifferencemode.h"
#include "gimpoperationadditionmode.h"
#include "gimpoperationsubtractmode.h"
#include "gimpoperationdarkenonlymode.h"
#include "gimpoperationlightenonlymode.h"
#include "gimpoperationhuemode.h"
#include "gimpoperationsaturationmode.h"
#include "gimpoperationcolormode.h"
#include "gimpoperationvaluemode.h"
#include "gimpoperationdividemode.h"
#include "gimpoperationdodgemode.h"
#include "gimpoperationburnmode.h"
#include "gimpoperationhardlightmode.h"
#include "gimpoperationsoftlightmode.h"
#include "gimpoperationgrainextractmode.h"
#include "gimpoperationgrainmergemode.h"
#include "gimpoperationcolorerasemode.h"
#include "gimpoperationerasemode.h"
#include "gimpoperationreplacemode.h"
#include "gimpoperationantierasemode.h"
static void gimp_gegl_notify_tile_cache_size (GimpBaseConfig *config);
......@@ -80,6 +105,31 @@ gimp_gegl_init (Gimp *gimp)
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_DISSOLVE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_BEHIND_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_MULTIPLY_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_SCREEN_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_OVERLAY_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_DIFFERENCE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_ADDITION_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_SUBTRACT_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_DARKEN_ONLY_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_LIGHTEN_ONLY_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_HUE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_SATURATION_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_VALUE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_DIVIDE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_DODGE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_BURN_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_HARDLIGHT_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_SOFTLIGHT_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_EXTRACT_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_GRAIN_MERGE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_COLOR_ERASE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_ERASE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_REPLACE_MODE);
g_type_class_ref (GIMP_TYPE_OPERATION_ANTI_ERASE_MODE);
}
static void
......
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationadditionmode.c
* 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 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.
*/
#include "config.h"
#include <gegl-plugin.h>
#include "gimp-gegl-types.h"
#include "gimpoperationadditionmode.h"
static gboolean gimp_operation_addition_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationAdditionMode, gimp_operation_addition_mode,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_addition_mode_class_init (GimpOperationAdditionModeClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
operation_class->name = "gimp:addition-mode";
operation_class->description = "GIMP addition mode operation";
point_class->process = gimp_operation_addition_mode_process;
}
static void
gimp_operation_addition_mode_init (GimpOperationAdditionMode *self)
{
}
static gboolean
gimp_operation_addition_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi)
{
gfloat *in = in_buf;
gfloat *layer = aux_buf;
gfloat *out = out_buf;
while (samples--)
{
out[RED] = in[RED];
out[GREEN] = in[GREEN];
out[BLUE] = in[BLUE];
out[ALPHA] = in[ALPHA];
in += 4;
layer += 4;
out += 4;
}
return TRUE;
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationadditionmode.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 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.
*/
#ifndef __GIMP_OPERATION_ADDITION_MODE_H__
#define __GIMP_OPERATION_ADDITION_MODE_H__
#include "gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_ADDITION_MODE (gimp_operation_addition_mode_get_type ())
#define GIMP_OPERATION_ADDITION_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_ADDITION_MODE, GimpOperationAdditionMode))
#define GIMP_OPERATION_ADDITION_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_ADDITION_MODE, GimpOperationAdditionModeClass))
#define GIMP_IS_OPERATION_ADDITION_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_ADDITION_MODE))
#define GIMP_IS_OPERATION_ADDITION_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_ADDITION_MODE))
#define GIMP_OPERATION_ADDITION_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_ADDITION_MODE, GimpOperationAdditionModeClass))
typedef struct _GimpOperationAdditionModeClass GimpOperationAdditionModeClass;
struct _GimpOperationAdditionMode
{
GimpOperationPointLayerMode parent_instance;
};
struct _GimpOperationAdditionModeClass
{
GimpOperationPointLayerModeClass parent_class;
};
GType gimp_operation_addition_mode_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_OPERATION_ADDITION_MODE_H__ */
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationantierasemode.c
* 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 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.
*/
#include "config.h"
#include <gegl-plugin.h>
#include "gimp-gegl-types.h"
#include "gimpoperationantierasemode.h"
static gboolean gimp_operation_anti_erase_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationAntiEraseMode, gimp_operation_anti_erase_mode,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_anti_erase_mode_class_init (GimpOperationAntiEraseModeClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
operation_class->name = "gimp:anti-erase-mode";
operation_class->description = "GIMP anti erase mode operation";
point_class->process = gimp_operation_anti_erase_mode_process;
}
static void
gimp_operation_anti_erase_mode_init (GimpOperationAntiEraseMode *self)
{
}
static gboolean
gimp_operation_anti_erase_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi)
{
gfloat *in = in_buf;
gfloat *layer = aux_buf;
gfloat *out = out_buf;
while (samples--)
{
out[RED] = in[RED];
out[GREEN] = in[GREEN];
out[BLUE] = in[BLUE];
out[ALPHA] = in[ALPHA];
in += 4;
layer += 4;
out += 4;
}
return TRUE;
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationanti_erasemode.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 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.
*/
#ifndef __GIMP_OPERATION_ANTI_ERASE_MODE_H__
#define __GIMP_OPERATION_ANTI_ERASE_MODE_H__
#include "gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_ANTI_ERASE_MODE (gimp_operation_anti_erase_mode_get_type ())
#define GIMP_OPERATION_ANTI_ERASE_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_ANTI_ERASE_MODE, GimpOperationAntiEraseMode))
#define GIMP_OPERATION_ANTI_ERASE_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_ANTI_ERASE_MODE, GimpOperationAntiEraseModeClass))
#define GIMP_IS_OPERATION_ANTI_ERASE_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_ANTI_ERASE_MODE))
#define GIMP_IS_OPERATION_ANTI_ERASE_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_ANTI_ERASE_MODE))
#define GIMP_OPERATION_ANTI_ERASE_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_ANTI_ERASE_MODE, GimpOperationAntiEraseModeClass))
typedef struct _GimpOperationAntiEraseModeClass GimpOperationAntiEraseModeClass;
struct _GimpOperationAntiEraseMode
{
GimpOperationPointLayerMode parent_instance;
};
struct _GimpOperationAntiEraseModeClass
{
GimpOperationPointLayerModeClass parent_class;
};
GType gimp_operation_anti_erase_mode_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_OPERATION_ANTI_ERASE_MODE_H__ */
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationbehindmode.c
* 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 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.
*/
#include "config.h"
#include <gegl-plugin.h>
#include "gimp-gegl-types.h"
#include "gimpoperationbehindmode.h"
static gboolean gimp_operation_behind_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationBehindMode, gimp_operation_behind_mode,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_behind_mode_class_init (GimpOperationBehindModeClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
operation_class->name = "gimp:behind-mode";
operation_class->description = "GIMP behind mode operation";
point_class->process = gimp_operation_behind_mode_process;
}
static void
gimp_operation_behind_mode_init (GimpOperationBehindMode *self)
{
}
static gboolean
gimp_operation_behind_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi)
{
gfloat *in = in_buf;
gfloat *layer = aux_buf;
gfloat *out = out_buf;
while (samples--)
{
out[RED] = in[RED];
out[GREEN] = in[GREEN];
out[BLUE] = in[BLUE];
out[ALPHA] = in[ALPHA];
in += 4;
layer += 4;
out += 4;
}
return TRUE;
}
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationbehindmode.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 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.
*/
#ifndef __GIMP_OPERATION_BEHIND_MODE_H__
#define __GIMP_OPERATION_BEHIND_MODE_H__
#include "gimpoperationpointlayermode.h"
#define GIMP_TYPE_OPERATION_BEHIND_MODE (gimp_operation_behind_mode_get_type ())
#define GIMP_OPERATION_BEHIND_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_BEHIND_MODE, GimpOperationBehindMode))
#define GIMP_OPERATION_BEHIND_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_BEHIND_MODE, GimpOperationBehindModeClass))
#define GIMP_IS_OPERATION_BEHIND_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_BEHIND_MODE))
#define GIMP_IS_OPERATION_BEHIND_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_BEHIND_MODE))
#define GIMP_OPERATION_BEHIND_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_BEHIND_MODE, GimpOperationBehindModeClass))
typedef struct _GimpOperationBehindModeClass GimpOperationBehindModeClass;
struct _GimpOperationBehindMode
{
GimpOperationPointLayerMode parent_instance;
};
struct _GimpOperationBehindModeClass
{
GimpOperationPointLayerModeClass parent_class;
};
GType gimp_operation_behind_mode_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_OPERATION_BEHIND_MODE_H__ */
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationburnmode.c
* 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 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.
*/
#include "config.h"
#include <gegl-plugin.h>
#include "gimp-gegl-types.h"
#include "gimpoperationburnmode.h"
static gboolean gimp_operation_burn_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi);
G_DEFINE_TYPE (GimpOperationBurnMode, gimp_operation_burn_mode,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_burn_mode_class_init (GimpOperationBurnModeClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointComposerClass *point_class;
operation_class = GEGL_OPERATION_CLASS (klass);
point_class = GEGL_OPERATION_POINT_COMPOSER_CLASS (klass);
operation_class->name = "gimp:burn-mode";
operation_class->description = "GIMP burn mode operation";
point_class->process = gimp_operation_burn_mode_process;
}
static void
gimp_operation_burn_mode_init (GimpOperationBurnMode *self)
{
}
static gboolean
gimp_operation_burn_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi)
{
gfloat *in = in_buf;
gfloat *layer = aux_buf;
gfloat *out = out_buf;
while (samples--)