app: rename GimpOperationPointLayerMode to GimpOperationLayerMode

and formatting cleanup.
This commit is contained in:
Michael Natterer
2017-01-21 21:35:52 +01:00
parent 0c35baecca
commit 05f3d38acb
105 changed files with 1191 additions and 1083 deletions

View File

@ -18,8 +18,8 @@ noinst_LIBRARIES = \
libapplayermodes.a
libapplayermodes_generic_a_sources = \
gimpoperationpointlayermode.c \
gimpoperationpointlayermode.h \
gimpoperationlayermode.c \
gimpoperationlayermode.h \
gimplayermodefunctions.c \
gimplayermodefunctions.h \
gimpblendcomposite.h \

View File

@ -211,12 +211,11 @@ gimp_composite_blend (gpointer op,
glong samples,
GimpBlendFunc blend_func)
{
GimpOperationPointLayerMode *layer_mode = op;
gfloat opacity = layer_mode->opacity;
GimpLayerColorSpace blend_trc = layer_mode->blend_trc;
GimpLayerColorSpace composite_trc = layer_mode->composite_trc;
GimpLayerCompositeMode composite_mode = layer_mode->composite_mode;
GimpOperationLayerMode *layer_mode = op;
gfloat opacity = layer_mode->opacity;
GimpLayerColorSpace blend_trc = layer_mode->blend_trc;
GimpLayerColorSpace composite_trc = layer_mode->composite_trc;
GimpLayerCompositeMode composite_mode = layer_mode->composite_mode;
gfloat *blend_in = in;
gfloat *blend_layer = layer;

View File

@ -29,8 +29,9 @@
#include "gimpoperationaddition.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationAddition, gimp_operation_addition,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -65,6 +66,8 @@ gimp_operation_addition_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_addition);
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_addition);
return TRUE;
}

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_ADDITION_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_ADDITION (gimp_operation_addition_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationAdditionClass GimpOperationAdditionClass;
struct _GimpOperationAddition
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationAdditionClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_addition_get_type (void) G_GNUC_CONST;
GType gimp_operation_addition_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_addition_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_addition_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_ADDITION_H__ */

View File

@ -27,8 +27,9 @@
#include "gimpoperationantierase.h"
G_DEFINE_TYPE (GimpOperationAntiErase, gimp_operation_anti_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -54,18 +55,22 @@ gimp_operation_anti_erase_init (GimpOperationAntiErase *self)
}
gboolean
gimp_operation_anti_erase_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_anti_erase_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
gfloat *out = out_p, *in = in_p, *layer = layer_p, *mask = mask_p;
gfloat opacity = ((GimpOperationPointLayerMode*)(op))->opacity;
const gboolean has_mask = mask != NULL;
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--)
{

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_ANTI_ERASE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_ANTI_ERASE (gimp_operation_anti_erase_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationAntiEraseClass GimpOperationAntiEraseClass;
struct _GimpOperationAntiErase
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationAntiEraseClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_anti_erase_get_type (void) G_GNUC_CONST;
GType gimp_operation_anti_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_anti_erase_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_anti_erase_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_ANTI_ERASE_H__ */

View File

@ -27,8 +27,9 @@
#include "gimpoperationbehind.h"
G_DEFINE_TYPE (GimpOperationBehind, gimp_operation_behind,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -63,9 +64,13 @@ gimp_operation_behind_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = ((GimpOperationPointLayerMode *)(op))->opacity;
gfloat *in = in_p, *layer = layer_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
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--)
{

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_BEHIND_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_BEHIND (gimp_operation_behind_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationBehindClass GimpOperationBehindClass;
struct _GimpOperationBehind
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationBehindClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_behind_get_type (void) G_GNUC_CONST;
GType gimp_operation_behind_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_behind_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_behind_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_BEHIND_H__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationburn.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationBurn, gimp_operation_burn,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -55,7 +56,6 @@ gimp_operation_burn_init (GimpOperationBurn *self)
{
}
gboolean
gimp_operation_burn_process (GeglOperation *operation,
void *in,

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_BURN_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_BURN (gimp_operation_burn_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationBurnClass GimpOperationBurnClass;
struct _GimpOperationBurn
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationBurnClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_burn_get_type (void) G_GNUC_CONST;
GType gimp_operation_burn_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_burn_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_burn_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_BURN_H__ */

View File

@ -31,8 +31,9 @@
#include "gimpoperationcolorerase.h"
G_DEFINE_TYPE (GimpOperationColorErase, gimp_operation_color_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -67,10 +68,13 @@ gimp_operation_color_erase_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *layer = layer_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
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--)
{

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_COLOR_ERASE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_COLOR_ERASE (gimp_operation_color_erase_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationColorEraseClass GimpOperationColorEraseClass;
struct _GimpOperationColorErase
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationColorEraseClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_color_erase_get_type (void) G_GNUC_CONST;
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);
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__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationdarkenonly.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationDarkenOnly, gimp_operation_darken_only,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -56,14 +57,14 @@ gimp_operation_darken_only_init (GimpOperationDarkenOnly *self)
}
gboolean
gimp_operation_darken_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_darken_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_darken_only);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_DARKEN_ONLY_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_DARKEN_ONLY (gimp_operation_darken_only_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationDarkenOnlyClass GimpOperationDarkenOnlyClass;
struct _GimpOperationDarkenOnly
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationDarkenOnlyClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_darken_only_get_type (void) G_GNUC_CONST;
GType gimp_operation_darken_only_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_darken_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_darken_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DARKEN_ONLY_H__ */

View File

@ -31,7 +31,7 @@
G_DEFINE_TYPE (GimpOperationDifference, gimp_operation_difference,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -57,14 +57,14 @@ gimp_operation_difference_init (GimpOperationDifference *self)
}
gboolean
gimp_operation_difference_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_difference_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_difference);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_DIFFERENCE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_DIFFERENCE (gimp_operation_difference_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationDifferenceClass GimpOperationDifferenceClass;
struct _GimpOperationDifference
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationDifferenceClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_difference_get_type (void) G_GNUC_CONST;
GType gimp_operation_difference_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_difference_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_difference_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DIFFERENCE_H__ */

View File

@ -33,7 +33,8 @@
G_DEFINE_TYPE (GimpOperationDissolve, gimp_operation_dissolve,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static gint32 random_table[RANDOM_TABLE_SIZE];
@ -71,20 +72,23 @@ gimp_operation_dissolve_init (GimpOperationDissolve *self)
}
gboolean
gimp_operation_dissolve_process (GeglOperation *op,
void *in_p,
void *aux_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *result,
gint level)
gimp_operation_dissolve_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *result,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *aux = aux_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
gint x, y;
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;
gint x, y;
for (y = result->y; y < result->y + result->height; y++)
{
@ -96,7 +100,7 @@ gimp_operation_dissolve_process (GeglOperation *op,
for (x = result->x; x < result->x + result->width; x++)
{
gfloat value = aux[ALPHA] * opacity * 255;
gfloat value = layer[ALPHA] * opacity * 255;
if (has_mask)
value *= *mask;
@ -110,19 +114,20 @@ gimp_operation_dissolve_process (GeglOperation *op,
}
else
{
out[0] = aux[0];
out[1] = aux[1];
out[2] = aux[2];
out[0] = layer[0];
out[1] = layer[1];
out[2] = layer[2];
out[3] = 1.0;
}
in += 4;
out += 4;
aux += 4;
in += 4;
layer += 4;
out += 4;
if (has_mask)
mask ++;
mask++;
}
g_rand_free (gr);
}

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_DISSOLVE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_DISSOLVE (gimp_operation_dissolve_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationDissolveClass GimpOperationDissolveClass;
struct _GimpOperationDissolveClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
struct _GimpOperationDissolve
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
GType gimp_operation_dissolve_get_type (void) G_GNUC_CONST;
GType gimp_operation_dissolve_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dissolve_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *result,
gint level);
gboolean gimp_operation_dissolve_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *result,
gint level);
#endif /* __GIMP_OPERATION_DISSOLVE_H__ */

View File

@ -31,7 +31,7 @@
G_DEFINE_TYPE (GimpOperationDivide, gimp_operation_divide,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -57,15 +57,16 @@ gimp_operation_divide_init (GimpOperationDivide *self)
}
gboolean
gimp_operation_divide_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_divide_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_divide);
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_divide);
return TRUE;
}

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_DIVIDE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_DIVIDE (gimp_operation_divide_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationDivideClass GimpOperationDivideClass;
struct _GimpOperationDivide
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationDivideClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_divide_get_type (void) G_GNUC_CONST;
GType gimp_operation_divide_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_divide_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_divide_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DIVIDE_H__ */

View File

@ -31,7 +31,7 @@
G_DEFINE_TYPE (GimpOperationDodge, gimp_operation_dodge,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -66,6 +66,7 @@ gimp_operation_dodge_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_dodge);
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_dodge);
return TRUE;
}

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_DODGE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_DODGE (gimp_operation_dodge_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationDodgeClass GimpOperationDodgeClass;
struct _GimpOperationDodge
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationDodgeClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
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 (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_dodge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DODGE_H__ */

View File

@ -27,8 +27,9 @@
#include "gimpoperationerase.h"
G_DEFINE_TYPE (GimpOperationErase, gimp_operation_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -54,19 +55,22 @@ gimp_operation_erase_init (GimpOperationErase *self)
}
gboolean
gimp_operation_erase_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_erase_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *layer = layer_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
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--)
{

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_ERASE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_ERASE (gimp_operation_erase_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationEraseClass GimpOperationEraseClass;
struct _GimpOperationErase
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationEraseClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_erase_get_type (void) G_GNUC_CONST;
GType gimp_operation_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_erase_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_erase_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_ERASE_MODE_H__ */

View File

@ -31,7 +31,7 @@
G_DEFINE_TYPE (GimpOperationGrainExtract, gimp_operation_grain_extract,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -57,14 +57,14 @@ gimp_operation_grain_extract_init (GimpOperationGrainExtract *self)
}
gboolean
gimp_operation_grain_extract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_grain_extract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_grain_extract);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_GRAIN_EXTRACT_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_GRAIN_EXTRACT (gimp_operation_grain_extract_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationGrainExtractClass GimpOperationGrainExtractClass;
struct _GimpOperationGrainExtract
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationGrainExtractClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_grain_extract_get_type (void) G_GNUC_CONST;
GType gimp_operation_grain_extract_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_extract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_grain_extract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_GRAIN_EXTRACT_H__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationgrainmerge.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationGrainMerge, gimp_operation_grain_merge,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -56,14 +57,14 @@ gimp_operation_grain_merge_init (GimpOperationGrainMerge *self)
}
gboolean
gimp_operation_grain_merge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_grain_merge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_grain_merge);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_GRAIN_MERGE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_GRAIN_MERGE (gimp_operation_grain_merge_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationGrainMergeClass GimpOperationGrainMergeClass;
struct _GimpOperationGrainMerge
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationGrainMergeClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_grain_merge_get_type (void) G_GNUC_CONST;
GType gimp_operation_grain_merge_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_merge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_grain_merge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_GRAIN_MERGE_H__ */

View File

@ -30,7 +30,7 @@
G_DEFINE_TYPE (GimpOperationHardlight, gimp_operation_hardlight,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -56,14 +56,14 @@ gimp_operation_hardlight_init (GimpOperationHardlight *self)
}
gboolean
gimp_operation_hardlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_hardlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hardlight);

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_HARDLIGHT_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_HARDLIGHT (gimp_operation_hardlight_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationHardlightClass GimpOperationHardlightClass;
struct _GimpOperationHardlight
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationHardlightClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_hardlight_get_type (void) G_GNUC_CONST;
GType gimp_operation_hardlight_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hardlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_hardlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HARDLIGHT_H__ */

View File

@ -35,7 +35,7 @@
G_DEFINE_TYPE (GimpOperationHsvColor, gimp_operation_hsv_color,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -61,14 +61,14 @@ gimp_operation_hsv_color_init (GimpOperationHsvColor *self)
}
gboolean
gimp_operation_hsv_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_hsv_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_color);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_HSV_COLOR_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_HSV_COLOR (gimp_operation_hsv_color_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationHsvColorClass GimpOperationHsvColorClass;
struct _GimpOperationHsvColor
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationHsvColorClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_hsv_color_get_type (void) G_GNUC_CONST;
GType gimp_operation_hsv_color_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_hsv_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_COLOR_H__ */

View File

@ -33,8 +33,9 @@
#include "gimpoperationhsvhue.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationHsvHue, gimp_operation_hsv_hue,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_HSV_HUE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_HSV_HUE (gimp_operation_hsv_hue_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationHsvHueClass GimpOperationHsvHueClass;
struct _GimpOperationHsvHue
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationHsvHueClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_hsv_hue_get_type (void) G_GNUC_CONST;
GType gimp_operation_hsv_hue_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_hsv_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_HUE_H__ */

View File

@ -33,8 +33,10 @@
#include "gimpoperationhsvsaturation.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationHsvSaturation, gimp_operation_hsv_saturation,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
gimp_operation_hsv_saturation_class_init (GimpOperationHsvSaturationClass *klass)
@ -59,14 +61,14 @@ gimp_operation_hsv_saturation_init (GimpOperationHsvSaturation *self)
}
gboolean
gimp_operation_hsv_saturation_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_hsv_saturation_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_saturation);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_HSV_SATURATION_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_HSV_SATURATION (gimp_operation_hsv_saturation_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationHsvSaturationClass GimpOperationHsvSaturationClass;
struct _GimpOperationHsvSaturation
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationHsvSaturationClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_hsv_saturation_get_type (void) G_GNUC_CONST;
GType gimp_operation_hsv_saturation_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_saturation_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_hsv_saturation_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_SATURATION_H__ */

View File

@ -35,7 +35,7 @@
G_DEFINE_TYPE (GimpOperationHsvValue, gimp_operation_hsv_value,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -61,14 +61,14 @@ gimp_operation_hsv_value_init (GimpOperationHsvValue *self)
}
gboolean
gimp_operation_hsv_value_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_hsv_value_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_value);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_HSV_VALUE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_HSV_VALUE (gimp_operation_hsv_value_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationHsvValueClass GimpOperationHsvValueClass;
struct _GimpOperationHsvValue
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationHsvValueClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_hsv_value_get_type (void) G_GNUC_CONST;
GType gimp_operation_hsv_value_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_value_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_hsv_value_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_VALUE_H__ */

View File

@ -1,7 +1,7 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationpointlayermode.c
* gimpoperationlayermode.c
* Copyright (C) 2008 Michael Natterer <mitch@gimp.org>
* Copyright (C) 2008 Martin Nordholts <martinn@svn.gnome.org>
*
@ -29,7 +29,7 @@
#include "../operations-types.h"
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
enum
@ -43,27 +43,27 @@ enum
};
static void gimp_operation_point_layer_mode_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_operation_point_layer_mode_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_operation_layer_mode_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_operation_layer_mode_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_operation_point_layer_mode_prepare (GeglOperation *operation);
static gboolean gimp_operation_point_layer_mode_process (GeglOperation *operation,
GeglOperationContext *context,
const gchar *output_prop,
const GeglRectangle *result,
gint level);
static void gimp_operation_layer_mode_prepare (GeglOperation *operation);
static gboolean gimp_operation_layer_mode_process (GeglOperation *operation,
GeglOperationContext *context,
const gchar *output_prop,
const GeglRectangle *result,
gint level);
G_DEFINE_TYPE (GimpOperationPointLayerMode, gimp_operation_point_layer_mode,
G_DEFINE_TYPE (GimpOperationLayerMode, gimp_operation_layer_mode,
GEGL_TYPE_OPERATION_POINT_COMPOSER3)
#define parent_class gimp_operation_point_layer_mode_parent_class
#define parent_class gimp_operation_layer_mode_parent_class
const Babl *_gimp_fish_rgba_to_perceptual = NULL;
@ -75,16 +75,16 @@ const Babl *_gimp_fish_laba_to_perceptual = NULL;
static void
gimp_operation_point_layer_mode_class_init (GimpOperationPointLayerModeClass *klass)
gimp_operation_layer_mode_class_init (GimpOperationLayerModeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
object_class->set_property = gimp_operation_point_layer_mode_set_property;
object_class->get_property = gimp_operation_point_layer_mode_get_property;
object_class->set_property = gimp_operation_layer_mode_set_property;
object_class->get_property = gimp_operation_layer_mode_get_property;
operation_class->prepare = gimp_operation_point_layer_mode_prepare;
operation_class->process = gimp_operation_point_layer_mode_process;
operation_class->prepare = gimp_operation_layer_mode_prepare;
operation_class->process = gimp_operation_layer_mode_process;
g_object_class_install_property (object_class, PROP_LINEAR,
g_param_spec_boolean ("linear",
@ -125,29 +125,27 @@ gimp_operation_point_layer_mode_class_init (GimpOperationPointLayerModeClass *kl
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
if (_gimp_fish_rgba_to_perceptual == NULL)
{
_gimp_fish_rgba_to_perceptual = babl_fish ("RGBA float", "R'G'B'A float");
_gimp_fish_perceptual_to_rgba = babl_fish ("R'G'B'A float", "RGBA float");
_gimp_fish_perceptual_to_laba = babl_fish ("R'G'B'A float", "CIE Lab alpha float");
_gimp_fish_rgba_to_laba = babl_fish ("RGBA float", "CIE Lab alpha float");
_gimp_fish_laba_to_rgba = babl_fish ("CIE Lab alpha float", "RGBA float");
_gimp_fish_laba_to_perceptual = babl_fish ("CIE Lab alpha float", "R'G'B'A float");
}
_gimp_fish_rgba_to_perceptual = babl_fish ("RGBA float", "R'G'B'A float");
_gimp_fish_perceptual_to_rgba = babl_fish ("R'G'B'A float", "RGBA float");
_gimp_fish_perceptual_to_laba = babl_fish ("R'G'B'A float", "CIE Lab alpha float");
_gimp_fish_rgba_to_laba = babl_fish ("RGBA float", "CIE Lab alpha float");
_gimp_fish_laba_to_rgba = babl_fish ("CIE Lab alpha float", "RGBA float");
_gimp_fish_laba_to_perceptual = babl_fish ("CIE Lab alpha float", "R'G'B'A float");
}
static void
gimp_operation_point_layer_mode_init (GimpOperationPointLayerMode *self)
gimp_operation_layer_mode_init (GimpOperationLayerMode *self)
{
}
static void
gimp_operation_point_layer_mode_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
gimp_operation_layer_mode_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpOperationPointLayerMode *self = GIMP_OPERATION_POINT_LAYER_MODE (object);
GimpOperationLayerMode *self = GIMP_OPERATION_LAYER_MODE (object);
switch (property_id)
{
@ -178,12 +176,12 @@ gimp_operation_point_layer_mode_set_property (GObject *object,
}
static void
gimp_operation_point_layer_mode_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
gimp_operation_layer_mode_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpOperationPointLayerMode *self = GIMP_OPERATION_POINT_LAYER_MODE (object);
GimpOperationLayerMode *self = GIMP_OPERATION_LAYER_MODE (object);
switch (property_id)
{
@ -214,10 +212,10 @@ gimp_operation_point_layer_mode_get_property (GObject *object,
}
static void
gimp_operation_point_layer_mode_prepare (GeglOperation *operation)
gimp_operation_layer_mode_prepare (GeglOperation *operation)
{
GimpOperationPointLayerMode *self = GIMP_OPERATION_POINT_LAYER_MODE (operation);
const Babl *format;
GimpOperationLayerMode *self = GIMP_OPERATION_LAYER_MODE (operation);
const Babl *format;
if (self->linear)
format = babl_format ("RGBA float");
@ -231,15 +229,13 @@ gimp_operation_point_layer_mode_prepare (GeglOperation *operation)
}
static gboolean
gimp_operation_point_layer_mode_process (GeglOperation *operation,
GeglOperationContext *context,
const gchar *output_prop,
const GeglRectangle *result,
gint level)
gimp_operation_layer_mode_process (GeglOperation *operation,
GeglOperationContext *context,
const gchar *output_prop,
const GeglRectangle *result,
gint level)
{
GimpOperationPointLayerMode *point;
point = GIMP_OPERATION_POINT_LAYER_MODE (operation);
GimpOperationLayerMode *point = GIMP_OPERATION_LAYER_MODE (operation);
if (point->opacity == 0.0 ||
! gegl_operation_context_get_object (context, "aux"))

View File

@ -0,0 +1,59 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationlayermode.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_LAYER_MODE_H__
#define __GIMP_OPERATION_LAYER_MODE_H__
#include <gegl-plugin.h>
#define GIMP_TYPE_OPERATION_LAYER_MODE (gimp_operation_layer_mode_get_type ())
#define GIMP_OPERATION_LAYER_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_LAYER_MODE, GimpOperationLayerMode))
#define GIMP_OPERATION_LAYER_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_LAYER_MODE, GimpOperationLayerModeClass))
#define GIMP_IS_OPERATION_LAYER_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_LAYER_MODE))
#define GIMP_IS_OPERATION_LAYER_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_LAYER_MODE))
#define GIMP_OPERATION_LAYER_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_LAYER_MODE, GimpOperationLayerModeClass))
typedef struct _GimpOperationLayerModeClass GimpOperationLayerModeClass;
struct _GimpOperationLayerModeClass
{
GeglOperationPointComposer3Class parent_class;
};
struct _GimpOperationLayerMode
{
GeglOperationPointComposer3 parent_instance;
gboolean linear;
gdouble opacity;
GimpLayerColorSpace blend_trc;
GimpLayerColorSpace composite_trc;
GimpLayerCompositeMode composite_mode;
GimpBlendFunc blend_func;
};
GType gimp_operation_layer_mode_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_OPERATION_LAYER_MODE_H__ */

View File

@ -30,10 +30,9 @@
#include "gimpoperationlchchroma.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationLchChroma, gimp_operation_lch_chroma,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define parent_class gimp_operation_lch_chroma_parent_class
G_DEFINE_TYPE (GimpOperationLchChroma, gimp_operation_lch_chroma,
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -61,14 +60,14 @@ gimp_operation_lch_chroma_init (GimpOperationLchChroma *self)
}
gboolean
gimp_operation_lch_chroma_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_lch_chroma_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_chroma);

View File

@ -24,7 +24,7 @@
#define __GIMP_OPERATION_LCH_CHROMA_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_LCH_CHROMA (gimp_operation_lch_chroma_get_type ())
@ -40,25 +40,25 @@ typedef struct _GimpOperationLchChromaClass GimpOperationLchChromaClass;
struct _GimpOperationLchChroma
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationLchChromaClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_lch_chroma_get_type (void) G_GNUC_CONST;
GType gimp_operation_lch_chroma_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_chroma_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_lch_chroma_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LCH_CHROMA_H__ */

View File

@ -30,10 +30,9 @@
#include "gimpoperationlchcolor.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationLchColor, gimp_operation_lch_color,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define parent_class gimp_operation_lch_color_parent_class
G_DEFINE_TYPE (GimpOperationLchColor, gimp_operation_lch_color,
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -61,14 +60,14 @@ gimp_operation_lch_color_init (GimpOperationLchColor *self)
}
gboolean
gimp_operation_lch_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_lch_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_color);

View File

@ -24,7 +24,7 @@
#define __GIMP_OPERATION_LCH_COLOR_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_LCH_COLOR (gimp_operation_lch_color_get_type ())
@ -40,25 +40,25 @@ typedef struct _GimpOperationLchColorClass GimpOperationLchColorClass;
struct _GimpOperationLchColor
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationLchColorClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_lch_color_get_type (void) G_GNUC_CONST;
GType gimp_operation_lch_color_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_lch_color_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LCH_COLOR_H__ */

View File

@ -30,10 +30,9 @@
#include "gimpoperationlchhue.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationLchHue, gimp_operation_lch_hue,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define parent_class gimp_operation_lch_hue_parent_class
G_DEFINE_TYPE (GimpOperationLchHue, gimp_operation_lch_hue,
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -24,7 +24,7 @@
#define __GIMP_OPERATION_LCH_HUE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_LCH_HUE (gimp_operation_lch_hue_get_type ())
@ -40,24 +40,25 @@ typedef struct _GimpOperationLchHueClass GimpOperationLchHueClass;
struct _GimpOperationLchHue
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationLchHueClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_lch_hue_get_type (void) G_GNUC_CONST;
GType gimp_operation_lch_hue_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_lch_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LCH_HUE_H__ */

View File

@ -30,10 +30,9 @@
#include "gimpoperationlchlightness.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationLchLightness, gimp_operation_lch_lightness,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define parent_class gimp_operation_lch_lightness_parent_class
G_DEFINE_TYPE (GimpOperationLchLightness, gimp_operation_lch_lightness,
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -61,14 +60,14 @@ gimp_operation_lch_lightness_init (GimpOperationLchLightness *self)
}
gboolean
gimp_operation_lch_lightness_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_lch_lightness_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_lightness);

View File

@ -24,7 +24,7 @@
#define __GIMP_OPERATION_LCH_LIGHTNESS_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_LCH_LIGHTNESS (gimp_operation_lch_lightness_get_type ())
@ -40,25 +40,25 @@ typedef struct _GimpOperationLchLightnessClass GimpOperationLchLightnessClass;
struct _GimpOperationLchLightness
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationLchLightnessClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_lch_lightness_get_type (void) G_GNUC_CONST;
GType gimp_operation_lch_lightness_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_lightness_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_lch_lightness_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LCH_LIGHTNESS_H__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationlightenonly.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationLightenOnly, gimp_operation_lighten_only,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_LIGHTEN_ONLY_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_LIGHTEN_ONLY (gimp_operation_lighten_only_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationLightenOnlyClass GimpOperationLightenOnlyClass;
struct _GimpOperationLightenOnly
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationLightenOnlyClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_lighten_only_get_type (void) G_GNUC_CONST;
GType gimp_operation_lighten_only_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lighten_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_lighten_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LIGHTEN_ONLY_H__ */

View File

@ -24,13 +24,15 @@
#include <gegl-plugin.h>
#include "operations/operations-types.h"
#include "../operations-types.h"
#include "gimpoperationmultiply.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationMultiply, gimp_operation_multiply,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
gimp_operation_multiply_class_init (GimpOperationMultiplyClass *klass)
@ -55,14 +57,14 @@ gimp_operation_multiply_init (GimpOperationMultiply *self)
}
gboolean
gimp_operation_multiply_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_multiply_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_multiply);

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_MULTIPLY_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_MULTIPLY (gimp_operation_multiply_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationMultiplyClass GimpOperationMultiplyClass;
struct _GimpOperationMultiply
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationMultiplyClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
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 (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_multiply_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_MULTIPLY_H__ */

View File

@ -28,18 +28,19 @@
#if COMPILE_SSE2_INTRINISICS
/* SSE2 */
#include <emmintrin.h>
gboolean
gimp_operation_normal_process_sse2 (GeglOperation *operation,
void *in,
void *aux,
void *mask_p,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_sse2 (GeglOperation *operation,
void *in,
void *aux,
void *mask_p,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
/* check alignment */
if ((((uintptr_t)in) | ((uintptr_t)aux) | ((uintptr_t)out)) & 0x0F)
@ -50,7 +51,7 @@ gimp_operation_normal_process_sse2 (GeglOperation *operation,
}
else
{
gfloat opacity = ((GimpOperationPointLayerMode*)(operation))->opacity;
gfloat opacity = ((GimpOperationLayerMode *)(operation))->opacity;
gfloat *mask = mask_p;
const __v4sf *v_in = (const __v4sf*) in;
const __v4sf *v_aux = (const __v4sf*) aux;
@ -116,4 +117,5 @@ gimp_operation_normal_process_sse2 (GeglOperation *operation,
return TRUE;
}
#endif /* COMPILE_SSE2_INTRINISICS */

View File

@ -28,18 +28,19 @@
#if COMPILE_SSE4_1_INTRINISICS
/* SSE4 */
#include <smmintrin.h>
gboolean
gimp_operation_normal_process_sse4 (GeglOperation *operation,
void *in,
void *aux,
void *mask_p,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_sse4 (GeglOperation *operation,
void *in,
void *aux,
void *mask_p,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
/* check alignment */
if ((((uintptr_t)in) | ((uintptr_t)aux) | ((uintptr_t)out)) & 0x0F)
@ -51,7 +52,7 @@ gimp_operation_normal_process_sse4 (GeglOperation *operation,
}
else
{
gfloat opacity = ((GimpOperationPointLayerMode*)(operation))->opacity;
gfloat opacity = ((GimpOperationLayerMode *)(operation))->opacity;
gfloat *mask = mask_p;
const __v4sf *v_in = (const __v4sf*) in;
const __v4sf *v_aux = (const __v4sf*) aux;
@ -116,4 +117,5 @@ gimp_operation_normal_process_sse4 (GeglOperation *operation,
return TRUE;
}
#endif /* COMPILE_SSE4_1_INTRINISICS */

View File

@ -25,7 +25,7 @@
#include "libgimpbase/gimpbase.h"
#include "operations/operations-types.h"
#include "../operations-types.h"
#include "gimpoperationnormal.h"
@ -37,7 +37,7 @@ static gboolean gimp_operation_normal_parent_process (GeglOperation *oper
gint level);
G_DEFINE_TYPE (GimpOperationNormal, gimp_operation_normal,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
#define parent_class gimp_operation_normal_parent_class
@ -107,11 +107,9 @@ gimp_operation_normal_parent_process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
GimpOperationPointLayerMode *point;
GimpOperationLayerMode *layer_mode = GIMP_OPERATION_LAYER_MODE (operation);
point = GIMP_OPERATION_POINT_LAYER_MODE (operation);
if (point->opacity == 1.0 &&
if (layer_mode->opacity == 1.0 &&
! gegl_operation_context_get_object (context, "aux2"))
{
const GeglRectangle *in_extent = NULL;
@ -156,39 +154,42 @@ gimp_operation_normal_parent_process (GeglOperation *operation,
}
gboolean
gimp_operation_normal_process_core (GeglOperation *operation,
void *in_p,
void *aux_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
gimp_operation_normal_process_core (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer)operation;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *aux = aux_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
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 aux_alpha;
gfloat layer_alpha;
aux_alpha = aux[ALPHA] * opacity;
layer_alpha = layer[ALPHA] * opacity;
if (has_mask)
aux_alpha *= *mask;
layer_alpha *= *mask;
out[ALPHA] = aux_alpha + in[ALPHA] - aux_alpha * in[ALPHA];
out[ALPHA] = layer_alpha + in[ALPHA] - layer_alpha * in[ALPHA];
if (out[ALPHA])
{
gfloat aux_weight = aux_alpha / out[ALPHA];
gfloat in_weight = 1.0f - aux_weight;
gfloat layer_weight = layer_alpha / out[ALPHA];
gfloat in_weight = 1.0f - layer_weight;
gint b;
for (b = RED; b < ALPHA; b++)
{
out[b] = aux[b] * aux_weight + in[b] * in_weight;
out[b] = layer[b] * layer_weight + in[b] * in_weight;
}
}
else
@ -201,9 +202,9 @@ gimp_operation_normal_process_core (GeglOperation *operation,
}
}
in += 4;
aux += 4;
out += 4;
in += 4;
layer += 4;
out += 4;
if (has_mask)
mask++;

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_NORMAL_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_NORMAL (gimp_operation_normal_get_type ())
@ -38,45 +38,45 @@ typedef struct _GimpOperationNormalClass GimpOperationNormalClass;
struct _GimpOperationNormal
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationNormalClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_normal_get_type (void) G_GNUC_CONST;
GType gimp_operation_normal_get_type (void) G_GNUC_CONST;
extern GimpLayerModeFunc gimp_operation_normal_process;
gboolean gimp_operation_normal_process_core (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_core (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_sse2 (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_sse2 (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_sse4 (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_normal_process_sse4 (GeglOperation *op,
void *in,
void *aux,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_NORMAL_H__ */

View File

@ -28,8 +28,9 @@
#include "gimpoperationoverlay.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationOverlay, gimp_operation_overlay,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_OVERLAY_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_OVERLAY (gimp_operation_overlay_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationOverlayClass GimpOperationOverlayClass;
struct _GimpOperationOverlay
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationOverlayClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_overlay_get_type (void) G_GNUC_CONST;
GType gimp_operation_overlay_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_overlay_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_overlay_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_OVERLAY_H__ */

View File

@ -1,59 +0,0 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpoperationpointlayermode.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_POINT_LAYER_MODE_H__
#define __GIMP_OPERATION_POINT_LAYER_MODE_H__
#include <gegl-plugin.h>
#define GIMP_TYPE_OPERATION_POINT_LAYER_MODE (gimp_operation_point_layer_mode_get_type ())
#define GIMP_OPERATION_POINT_LAYER_MODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_OPERATION_POINT_LAYER_MODE, GimpOperationPointLayerMode))
#define GIMP_OPERATION_POINT_LAYER_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_OPERATION_POINT_LAYER_MODE, GimpOperationPointLayerModeClass))
#define GIMP_IS_OPERATION_POINT_LAYER_MODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_OPERATION_POINT_LAYER_MODE))
#define GIMP_IS_OPERATION_POINT_LAYER_MODE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_OPERATION_POINT_LAYER_MODE))
#define GIMP_OPERATION_POINT_LAYER_MODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_OPERATION_POINT_LAYER_MODE, GimpOperationPointLayerModeClass))
typedef struct _GimpOperationPointLayerModeClass GimpOperationPointLayerModeClass;
struct _GimpOperationPointLayerModeClass
{
GeglOperationPointComposer3Class parent_class;
};
struct _GimpOperationPointLayerMode
{
GeglOperationPointComposer3 parent_instance;
gboolean linear;
gdouble opacity;
GimpLayerColorSpace blend_trc;
GimpLayerColorSpace composite_trc;
GimpLayerCompositeMode composite_mode;
GimpBlendFunc blend_func;
};
GType gimp_operation_point_layer_mode_get_type (void) G_GNUC_CONST;
#endif /* __GIMP_OPERATION_POINT_LAYER_MODE_H__ */

View File

@ -26,8 +26,9 @@
#include "gimpoperationreplace.h"
G_DEFINE_TYPE (GimpOperationReplace, gimp_operation_replace,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void
@ -62,10 +63,13 @@ gimp_operation_replace_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *layer = layer_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
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--)
{

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_REPLACE_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_REPLACE (gimp_operation_replace_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationReplaceClass GimpOperationReplaceClass;
struct _GimpOperationReplace
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationReplaceClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_replace_get_type (void) G_GNUC_CONST;
GType gimp_operation_replace_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_replace_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_replace_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_REPLACE_H__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationscreen.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationScreen, gimp_operation_screen,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_SCREEN_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_SCREEN (gimp_operation_screen_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationScreenClass GimpOperationScreenClass;
struct _GimpOperationScreen
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationScreenClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_screen_get_type (void) G_GNUC_CONST;
GType gimp_operation_screen_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_screen_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_screen_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SCREEN_H__ */

View File

@ -28,8 +28,10 @@
#include "gimpoperationsoftlight.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationSoftlight, gimp_operation_softlight,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static const gchar* reference_xml = "<?xml version='1.0' encoding='UTF-8'?>"
"<gegl>"
@ -72,7 +74,6 @@ gimp_operation_softlight_init (GimpOperationSoftlight *self)
{
}
gboolean
gimp_operation_softlight_process (GeglOperation *op,
void *in,

View File

@ -22,7 +22,7 @@
#define __GIMP_OPERATION_SOFTLIGHT_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_SOFTLIGHT (gimp_operation_softlight_get_type ())
@ -38,25 +38,25 @@ typedef struct _GimpOperationSoftlightClass GimpOperationSoftlightClass;
struct _GimpOperationSoftlight
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationSoftlightClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_softlight_get_type (void) G_GNUC_CONST;
GType gimp_operation_softlight_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_softlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_softlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SOFTLIGHT_H__ */

View File

@ -29,8 +29,9 @@
#include "gimpoperationsubtract.h"
#include "gimpblendcomposite.h"
G_DEFINE_TYPE (GimpOperationSubtract, gimp_operation_subtract,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
GIMP_TYPE_OPERATION_LAYER_MODE)
static void

View File

@ -23,7 +23,7 @@
#define __GIMP_OPERATION_SUBTRACT_H__
#include "gimpoperationpointlayermode.h"
#include "gimpoperationlayermode.h"
#define GIMP_TYPE_OPERATION_SUBTRACT (gimp_operation_subtract_get_type ())
@ -39,25 +39,25 @@ typedef struct _GimpOperationSubtractClass GimpOperationSubtractClass;
struct _GimpOperationSubtract
{
GimpOperationPointLayerMode parent_instance;
GimpOperationLayerMode parent_instance;
};
struct _GimpOperationSubtractClass
{
GimpOperationPointLayerModeClass parent_class;
GimpOperationLayerModeClass parent_class;
};
GType gimp_operation_subtract_get_type (void) G_GNUC_CONST;
GType gimp_operation_subtract_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_subtract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
gboolean gimp_operation_subtract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SUBTRACT_H__ */