app: remove a trampoline in layer/paint mode dispatch

Fully removes one trampoline level and passing fewer args through the remaining
trampoline.
This commit is contained in:
Øyvind Kolås 2017-01-21 01:37:37 +01:00
parent fb3b99553c
commit c993adf91e
103 changed files with 1000 additions and 2751 deletions

View File

@ -27,17 +27,6 @@
#include "gimpoperationadditionlegacy.h"
static gboolean gimp_operation_addition_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationAdditionLegacy, gimp_operation_addition_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,40 +53,19 @@ gimp_operation_addition_legacy_init (GimpOperationAdditionLegacy *self)
{
}
static gboolean
gimp_operation_addition_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_addition_legacy_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) operation;
return gimp_operation_addition_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_addition_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
const gboolean has_mask = mask != NULL;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationAdditionLegacyClass
GType gimp_operation_addition_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_addition_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_addition_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_ADDITION_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationburnlegacy.h"
static gboolean gimp_operation_burn_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationBurnLegacy, gimp_operation_burn_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +53,26 @@ gimp_operation_burn_legacy_init (GimpOperationBurnLegacy *self)
{
}
static gboolean
gimp_operation_burn_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_burn_legacy_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) operation;
return gimp_operation_burn_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_burn_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -142,7 +109,7 @@ gimp_operation_burn_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationBurnLegacyClass
GType gimp_operation_burn_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_burn_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_burn_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_BURN_LEGACY_H__ */

View File

@ -28,16 +28,6 @@
#include "gimpoperationdarkenonlylegacy.h"
static gboolean gimp_operation_darken_only_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDarkenOnlyLegacy, gimp_operation_darken_only_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +54,27 @@ gimp_operation_darken_only_legacy_init (GimpOperationDarkenOnlyLegacy *self)
{
}
static gboolean
gimp_operation_darken_only_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_darken_only_legacy_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) operation;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
return gimp_operation_darken_only_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_darken_only_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -138,7 +107,7 @@ gimp_operation_darken_only_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationDarkenOnlyLegacyClass
GType gimp_operation_darken_only_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_darken_only_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_darken_only_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DARKEN_ONLY_LEGACY_H__ */

View File

@ -27,21 +27,9 @@
#include "gimpoperationdifferencelegacy.h"
static gboolean gimp_operation_difference_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDifferenceLegacy, gimp_operation_difference_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_difference_legacy_class_init (GimpOperationDifferenceLegacyClass *klass)
{
@ -64,48 +52,27 @@ gimp_operation_difference_legacy_init (GimpOperationDifferenceLegacy *self)
{
}
static gboolean
gimp_operation_difference_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_difference_legacy_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) operation;
return gimp_operation_difference_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_difference_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -139,7 +106,7 @@ gimp_operation_difference_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationDifferenceLegacyClass
GType gimp_operation_difference_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_difference_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_difference_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DIFFERENCE_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationdividelegacy.h"
static gboolean gimp_operation_divide_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDivideLegacy, gimp_operation_divide_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +53,26 @@ gimp_operation_divide_legacy_init (GimpOperationDivideLegacy *self)
{
}
static gboolean
gimp_operation_divide_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_divide_legacy_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) operation;
return gimp_operation_divide_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_divide_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -139,7 +106,7 @@ gimp_operation_divide_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationDivideLegacyClass
GType gimp_operation_divide_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_divide_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_divide_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DIVIDE_LEGACY_H__ */

View File

@ -28,16 +28,6 @@
#include "gimpoperationdodgelegacy.h"
static gboolean gimp_operation_dodge_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDodgeLegacy, gimp_operation_dodge_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +54,26 @@ gimp_operation_dodge_legacy_init (GimpOperationDodgeLegacy *self)
{
}
static gboolean
gimp_operation_dodge_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_dodge_legacy_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) operation;
return gimp_operation_dodge_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_dodge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -139,7 +107,7 @@ gimp_operation_dodge_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationDodgeLegacyClass
GType gimp_operation_dodge_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dodge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_dodge_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_DODGE_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationgrainextractlegacy.h"
static gboolean gimp_operation_grain_extract_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationGrainExtractLegacy, gimp_operation_grain_extract_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +53,27 @@ gimp_operation_grain_extract_legacy_init (GimpOperationGrainExtractLegacy *self)
{
}
static gboolean
gimp_operation_grain_extract_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_grain_extract_legacy_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) operation;
return gimp_operation_grain_extract_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_grain_extract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_Trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -139,7 +107,7 @@ gimp_operation_grain_extract_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationGrainExtractLegacyClass
GType gimp_operation_grain_extract_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_extract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_grain_extract_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_GRAIN_EXTRACT_LEGACY_H__ */

View File

@ -27,21 +27,9 @@
#include "gimpoperationgrainmergelegacy.h"
static gboolean gimp_operation_grain_merge_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationGrainMergeLegacy, gimp_operation_grain_merge_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_grain_merge_legacy_class_init (GimpOperationGrainMergeLegacyClass *klass)
{
@ -64,48 +52,26 @@ gimp_operation_grain_merge_legacy_init (GimpOperationGrainMergeLegacy *self)
{
}
static gboolean
gimp_operation_grain_merge_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_grain_merge_legacy_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) operation;
return gimp_operation_grain_merge_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_grain_merge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -139,7 +105,7 @@ gimp_operation_grain_merge_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask ++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationGrainMergeLegacyClass
GType gimp_operation_grain_merge_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_merge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_grain_merge_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_GRAIN_MERGE_LEGACY_H__ */

View File

@ -28,16 +28,6 @@
#include "gimpoperationhardlightlegacy.h"
static gboolean gimp_operation_hardlight_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHardlightLegacy, gimp_operation_hardlight_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +54,26 @@ gimp_operation_hardlight_legacy_init (GimpOperationHardlightLegacy *self)
{
}
static gboolean
gimp_operation_hardlight_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hardlight_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hardlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_hardlight_legacy_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -149,7 +117,7 @@ gimp_operation_hardlight_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask ++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHardlightLegacyClass
GType gimp_operation_hardlight_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hardlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_hardlight_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HARDLIGHT_LEGACY_H__ */

View File

@ -31,17 +31,6 @@
#include "gimpoperationhsvcolorlegacy.h"
static gboolean gimp_operation_hsv_color_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvColorLegacy, gimp_operation_hsv_color_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -68,41 +57,19 @@ gimp_operation_hsv_color_legacy_init (GimpOperationHsvColorLegacy *self)
{
}
static gboolean
gimp_operation_hsv_color_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_color_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_color_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_hsv_color_legacy_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
@ -112,7 +79,7 @@ gimp_operation_hsv_color_legacy_process_pixels (gfloat *in,
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -155,7 +122,7 @@ gimp_operation_hsv_color_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHsvColorLegacyClass
GType gimp_operation_hsv_color_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_color_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_hsv_color_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_COLOR_LEGACY_H__ */

View File

@ -32,16 +32,6 @@
#include "gimpoperationhsvhuelegacy.h"
static gboolean gimp_operation_hsv_hue_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvHueLegacy, gimp_operation_hsv_hue_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -68,41 +58,19 @@ gimp_operation_hsv_hue_legacy_init (GimpOperationHsvHueLegacy *self)
{
}
static gboolean
gimp_operation_hsv_hue_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_hsv_hue_legacy_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) operation;
return gimp_operation_hsv_hue_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_hue_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
@ -112,7 +80,7 @@ gimp_operation_hsv_hue_legacy_process_pixels (gfloat *in,
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -160,7 +128,7 @@ gimp_operation_hsv_hue_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHsvHueLegacyClass
GType gimp_operation_hsv_hue_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_hue_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_hsv_hue_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_HUE_LEGACY_H__ */

View File

@ -32,16 +32,6 @@
#include "gimpoperationhsvsaturationlegacy.h"
static gboolean gimp_operation_hsv_saturation_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvSaturationLegacy, gimp_operation_hsv_saturation_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -68,41 +58,19 @@ gimp_operation_hsv_saturation_legacy_init (GimpOperationHsvSaturationLegacy *sel
{
}
static gboolean
gimp_operation_hsv_saturation_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_hsv_saturation_legacy_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) operation;
return gimp_operation_hsv_saturation_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_saturation_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
@ -112,7 +80,7 @@ gimp_operation_hsv_saturation_legacy_process_pixels (gfloat *in,
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -154,7 +122,7 @@ gimp_operation_hsv_saturation_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHsvSaturationLegacyClass
GType gimp_operation_hsv_saturation_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_saturation_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_hsv_saturation_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_SATURATION_LEGACY_H__ */

View File

@ -31,17 +31,6 @@
#include "gimpoperationhsvvaluelegacy.h"
static gboolean gimp_operation_hsv_value_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvValueLegacy, gimp_operation_hsv_value_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -68,41 +57,19 @@ gimp_operation_hsv_value_legacy_init (GimpOperationHsvValueLegacy *self)
{
}
static gboolean
gimp_operation_hsv_value_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_value_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_value_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_hsv_value_legacy_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
@ -112,7 +79,7 @@ gimp_operation_hsv_value_legacy_process_pixels (gfloat *in,
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -154,7 +121,7 @@ gimp_operation_hsv_value_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHsvValueLegacyClass
GType gimp_operation_hsv_value_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_value_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_hsv_value_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_HSV_VALUE_LEGACY_H__ */

View File

@ -28,16 +28,6 @@
#include "gimpoperationlightenonlylegacy.h"
static gboolean gimp_operation_lighten_only_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLightenOnlyLegacy, gimp_operation_lighten_only_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +54,26 @@ gimp_operation_lighten_only_legacy_init (GimpOperationLightenOnlyLegacy *self)
{
}
static gboolean
gimp_operation_lighten_only_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_lighten_only_legacy_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) operation;
return gimp_operation_lighten_only_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lighten_only_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -138,7 +106,7 @@ gimp_operation_lighten_only_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationLightenOnlyLegacyClass
GType gimp_operation_lighten_only_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lighten_only_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_lighten_only_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_LIGHTEN_ONLY_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationmultiplylegacy.h"
static gboolean gimp_operation_multiply_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationMultiplyLegacy, gimp_operation_multiply_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +53,27 @@ gimp_operation_multiply_legacy_init (GimpOperationMultiplyLegacy *self)
{
}
static gboolean
gimp_operation_multiply_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_multiply_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_multiply_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_multiply_legacy_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -138,7 +106,7 @@ gimp_operation_multiply_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationMultiplyLegacyClass
GType gimp_operation_multiply_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_multiply_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_multiply_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_MULTIPLY_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationscreenlegacy.h"
static gboolean gimp_operation_screen_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationScreenLegacy, gimp_operation_screen_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,48 +53,26 @@ gimp_operation_screen_legacy_init (GimpOperationScreenLegacy *self)
{
}
static gboolean
gimp_operation_screen_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_screen_legacy_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) operation;
return gimp_operation_screen_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_screen_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -138,7 +105,7 @@ gimp_operation_screen_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationScreenLegacyClass
GType gimp_operation_screen_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_screen_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_screen_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SCREEN_LEGACY_H__ */

View File

@ -27,17 +27,6 @@
#include "gimpoperationsoftlightlegacy.h"
static gboolean gimp_operation_softlight_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationSoftlightLegacy, gimp_operation_softlight_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -82,41 +71,26 @@ gimp_operation_softlight_legacy_init (GimpOperationSoftlightLegacy *self)
{
}
static gboolean
gimp_operation_softlight_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_softlight_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, layer_mode->opacity, samples, roi, level, layer_mode->blend_trc, layer_mode->composite_trc, layer_mode->composite_mode);
}
gboolean
gimp_operation_softlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_softlight_legacy_process (GeglOperation *op,
void *in_p,
void *layer_p,
void *mask_p,
void *out_p,
glong samples,
const GeglRectangle *roi,
gint level)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -163,7 +137,7 @@ gimp_operation_softlight_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask ++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationSoftlightLegacyClass
GType gimp_operation_softlight_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_softlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_softlight_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SOFTLIGHT_LEGACY_H__ */

View File

@ -27,21 +27,9 @@
#include "gimpoperationsubtractlegacy.h"
static gboolean gimp_operation_subtract_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationSubtractLegacy, gimp_operation_subtract_legacy,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_subtract_legacy_class_init (GimpOperationSubtractLegacyClass *klass)
{
@ -64,48 +52,27 @@ gimp_operation_subtract_legacy_init (GimpOperationSubtractLegacy *self)
{
}
static gboolean
gimp_operation_subtract_legacy_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_subtract_legacy_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) operation;
return gimp_operation_subtract_legacy_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_subtract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;
GimpOperationPointLayerMode *layer_mode = (gpointer)op;
gfloat opacity = layer_mode->opacity;
gfloat *in = in_p, *out = out_p, *layer = layer_p, *mask = mask_p;
while (samples--)
{
gfloat comp_alpha, new_alpha;
comp_alpha = MIN (in[ALPHA], layer[ALPHA]) * opacity;
if (has_mask)
if (mask)
comp_alpha *= *mask;
new_alpha = in[ALPHA] + (1.0 - in[ALPHA]) * comp_alpha;
@ -138,7 +105,7 @@ gimp_operation_subtract_legacy_process_pixels (gfloat *in,
layer += 4;
out += 4;
if (has_mask)
if (mask)
mask++;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationSubtractLegacyClass
GType gimp_operation_subtract_legacy_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_subtract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
gboolean gimp_operation_subtract_legacy_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level);
#endif /* __GIMP_OPERATION_SUBTRACT_LEGACY_H__ */

View File

@ -203,17 +203,15 @@ compfun_src_in (gfloat *in,
}
static inline void
gimp_composite_blend (gfloat *in,
gimp_composite_blend (gpointer op,
gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode,
GimpBlendFunc blend_func)
{
GimpOperationPointLayerMode *layer_mode = op;
gfloat *blend_in = in;
gfloat *blend_layer = layer;
gfloat *blend_out = out;
@ -225,6 +223,11 @@ gimp_composite_blend (gfloat *in,
const Babl *fish_to_composite = NULL;
const Babl *fish_from_composite = NULL;
float 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;
switch (blend_trc)
{
default:
@ -1073,4 +1076,26 @@ blendfun_lch_lightness (const float *dest,
}
}
static inline void
blendfun_copy (const float *dest,
const float *src,
float *out,
int samples)
{
while (samples--)
{
gint c;
for (c = 0; c < 4; c++)
out[c] = src[c];
out[ALPHA] = src[ALPHA];
out += 4;
src += 4;
dest += 4;
}
}
#endif /* __GIMP_BLEND_COMPOSITE_H__ */

View File

@ -86,217 +86,217 @@ gimp_get_layer_mode_function (GimpLayerMode paint_mode)
{
case GIMP_LAYER_MODE_NORMAL:
case GIMP_LAYER_MODE_NORMAL_NON_LINEAR:
func = gimp_operation_normal_process_pixels;
func = gimp_operation_normal_process;
break;
case GIMP_LAYER_MODE_DISSOLVE:
func = gimp_operation_dissolve_process_pixels;
func = gimp_operation_dissolve_process;
break;
case GIMP_LAYER_MODE_BEHIND:
case GIMP_LAYER_MODE_BEHIND_LINEAR:
func = gimp_operation_behind_process_pixels;
func = gimp_operation_behind_process;
break;
case GIMP_LAYER_MODE_MULTIPLY_LEGACY:
func = gimp_operation_multiply_legacy_process_pixels;
func = gimp_operation_multiply_legacy_process;
break;
case GIMP_LAYER_MODE_MULTIPLY:
case GIMP_LAYER_MODE_MULTIPLY_LINEAR:
func = gimp_operation_multiply_process_pixels;
func = gimp_operation_multiply_process;
break;
case GIMP_LAYER_MODE_SCREEN_LEGACY:
func = gimp_operation_screen_legacy_process_pixels;
func = gimp_operation_screen_legacy_process;
break;
case GIMP_LAYER_MODE_SCREEN:
func = gimp_operation_screen_process_pixels;
func = gimp_operation_screen_process;
break;
case GIMP_LAYER_MODE_OVERLAY_LEGACY:
func = gimp_operation_softlight_legacy_process_pixels;
func = gimp_operation_softlight_legacy_process;
break;
case GIMP_LAYER_MODE_DIFFERENCE_LEGACY:
func = gimp_operation_difference_legacy_process_pixels;
func = gimp_operation_difference_legacy_process;
break;
case GIMP_LAYER_MODE_DIFFERENCE:
case GIMP_LAYER_MODE_DIFFERENCE_LINEAR:
func = gimp_operation_difference_process_pixels;
func = gimp_operation_difference_process;
break;
case GIMP_LAYER_MODE_ADDITION_LEGACY:
func = gimp_operation_addition_legacy_process_pixels;
func = gimp_operation_addition_legacy_process;
break;
case GIMP_LAYER_MODE_ADDITION:
case GIMP_LAYER_MODE_ADDITION_LINEAR:
func = gimp_operation_addition_process_pixels;
func = gimp_operation_addition_process;
break;
case GIMP_LAYER_MODE_SUBTRACT_LEGACY:
func = gimp_operation_subtract_legacy_process_pixels;
func = gimp_operation_subtract_legacy_process;
break;
case GIMP_LAYER_MODE_SUBTRACT:
case GIMP_LAYER_MODE_SUBTRACT_LINEAR:
func = gimp_operation_subtract_process_pixels;
func = gimp_operation_subtract_process;
break;
case GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY:
func = gimp_operation_darken_only_legacy_process_pixels;
func = gimp_operation_darken_only_legacy_process;
break;
case GIMP_LAYER_MODE_DARKEN_ONLY:
case GIMP_LAYER_MODE_DARKEN_ONLY_LINEAR:
func = gimp_operation_darken_only_process_pixels;
func = gimp_operation_darken_only_process;
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY:
func = gimp_operation_lighten_only_legacy_process_pixels;
func = gimp_operation_lighten_only_legacy_process;
break;
case GIMP_LAYER_MODE_LIGHTEN_ONLY:
case GIMP_LAYER_MODE_LIGHTEN_ONLY_LINEAR:
func = gimp_operation_lighten_only_process_pixels;
func = gimp_operation_lighten_only_process;
break;
case GIMP_LAYER_MODE_HSV_HUE:
func = gimp_operation_hsv_hue_process_pixels;
func = gimp_operation_hsv_hue_process;
break;
case GIMP_LAYER_MODE_HSV_HUE_LEGACY:
func = gimp_operation_hsv_hue_legacy_process_pixels;
func = gimp_operation_hsv_hue_legacy_process;
break;
case GIMP_LAYER_MODE_HSV_SATURATION:
func = gimp_operation_hsv_saturation_process_pixels;
func = gimp_operation_hsv_saturation_process;
break;
case GIMP_LAYER_MODE_HSV_SATURATION_LEGACY:
func = gimp_operation_hsv_saturation_legacy_process_pixels;
func = gimp_operation_hsv_saturation_legacy_process;
break;
case GIMP_LAYER_MODE_HSV_COLOR:
func = gimp_operation_hsv_color_process_pixels;
func = gimp_operation_hsv_color_process;
break;
case GIMP_LAYER_MODE_HSV_COLOR_LEGACY:
func = gimp_operation_hsv_color_legacy_process_pixels;
func = gimp_operation_hsv_color_legacy_process;
break;
case GIMP_LAYER_MODE_HSV_VALUE:
func = gimp_operation_hsv_value_process_pixels;
func = gimp_operation_hsv_value_process;
break;
case GIMP_LAYER_MODE_HSV_VALUE_LEGACY:
func = gimp_operation_hsv_value_legacy_process_pixels;
func = gimp_operation_hsv_value_legacy_process;
break;
case GIMP_LAYER_MODE_DIVIDE_LEGACY:
func = gimp_operation_divide_legacy_process_pixels;
func = gimp_operation_divide_legacy_process;
break;
case GIMP_LAYER_MODE_DIVIDE:
case GIMP_LAYER_MODE_DIVIDE_LINEAR:
func = gimp_operation_divide_process_pixels;
func = gimp_operation_divide_process;
break;
case GIMP_LAYER_MODE_DODGE_LEGACY:
func = gimp_operation_dodge_legacy_process_pixels;
func = gimp_operation_dodge_legacy_process;
break;
case GIMP_LAYER_MODE_DODGE:
case GIMP_LAYER_MODE_DODGE_LINEAR:
func = gimp_operation_dodge_process_pixels;
func = gimp_operation_dodge_process;
break;
case GIMP_LAYER_MODE_BURN_LEGACY:
func = gimp_operation_burn_legacy_process_pixels;
func = gimp_operation_burn_legacy_process;
break;
case GIMP_LAYER_MODE_BURN:
case GIMP_LAYER_MODE_BURN_LINEAR:
func = gimp_operation_burn_process_pixels;
func = gimp_operation_burn_process;
break;
case GIMP_LAYER_MODE_HARDLIGHT_LEGACY:
func = gimp_operation_hardlight_legacy_process_pixels;
func = gimp_operation_hardlight_legacy_process;
break;
case GIMP_LAYER_MODE_HARDLIGHT:
func = gimp_operation_hardlight_process_pixels;
func = gimp_operation_hardlight_process;
break;
case GIMP_LAYER_MODE_SOFTLIGHT_LEGACY:
func = gimp_operation_softlight_legacy_process_pixels;
func = gimp_operation_softlight_legacy_process;
break;
case GIMP_LAYER_MODE_SOFTLIGHT:
func = gimp_operation_softlight_process_pixels;
func = gimp_operation_softlight_process;
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY:
func = gimp_operation_grain_extract_legacy_process_pixels;
func = gimp_operation_grain_extract_legacy_process;
break;
case GIMP_LAYER_MODE_GRAIN_EXTRACT:
case GIMP_LAYER_MODE_GRAIN_EXTRACT_LINEAR:
func = gimp_operation_grain_extract_process_pixels;
func = gimp_operation_grain_extract_process;
break;
case GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY:
func = gimp_operation_grain_merge_legacy_process_pixels;
func = gimp_operation_grain_merge_legacy_process;
break;
case GIMP_LAYER_MODE_GRAIN_MERGE:
case GIMP_LAYER_MODE_GRAIN_MERGE_LINEAR:
func = gimp_operation_grain_merge_process_pixels;
func = gimp_operation_grain_merge_process;
break;
case GIMP_LAYER_MODE_COLOR_ERASE:
func = gimp_operation_color_erase_process_pixels;
func = gimp_operation_color_erase_process;
break;
case GIMP_LAYER_MODE_OVERLAY:
func = gimp_operation_overlay_process_pixels;
func = gimp_operation_overlay_process;
break;
case GIMP_LAYER_MODE_LCH_HUE:
func = gimp_operation_lch_hue_process_pixels;
func = gimp_operation_lch_hue_process;
break;
case GIMP_LAYER_MODE_LCH_CHROMA:
func = gimp_operation_lch_chroma_process_pixels;
func = gimp_operation_lch_chroma_process;
break;
case GIMP_LAYER_MODE_LCH_COLOR:
func = gimp_operation_lch_color_process_pixels;
func = gimp_operation_lch_color_process;
break;
case GIMP_LAYER_MODE_LCH_LIGHTNESS:
func = gimp_operation_lch_lightness_process_pixels;
func = gimp_operation_lch_lightness_process;
break;
case GIMP_LAYER_MODE_ERASE:
func = gimp_operation_erase_process_pixels;
func = gimp_operation_erase_process;
break;
case GIMP_LAYER_MODE_REPLACE:
func = gimp_operation_replace_process_pixels;
func = gimp_operation_replace_process;
break;
case GIMP_LAYER_MODE_ANTI_ERASE:
func = gimp_operation_anti_erase_process_pixels;
func = gimp_operation_anti_erase_process;
break;
default:
g_warning ("No direct function for layer mode (%d), using gimp:normal",
paint_mode);
func = gimp_operation_normal_process_pixels;
func = gimp_operation_normal_process;
break;
}

View File

@ -29,17 +29,6 @@
#include "gimpoperationaddition.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_addition_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationAddition, gimp_operation_addition,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,16 @@ gimp_operation_addition_init (GimpOperationAddition *self)
{
}
static gboolean
gimp_operation_addition_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_addition_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_addition_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_addition_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
blendfun_addition);
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_addition);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationAdditionClass
GType gimp_operation_addition_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_addition_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +27,6 @@
#include "gimpoperationantierase.h"
static gboolean gimp_operation_anti_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationAntiErase, gimp_operation_anti_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,40 +53,18 @@ gimp_operation_anti_erase_init (GimpOperationAntiErase *self)
{
}
static gboolean
gimp_operation_anti_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_anti_erase_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_anti_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationAntiEraseClass
GType gimp_operation_anti_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_anti_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +27,6 @@
#include "gimpoperationbehind.h"
static gboolean gimp_operation_behind_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationBehind, gimp_operation_behind,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,40 +53,18 @@ gimp_operation_behind_init (GimpOperationBehind *self)
{
}
static gboolean
gimp_operation_behind_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_behind_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) operation;
return gimp_operation_behind_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_behind_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gfloat opacity = ((GimpOperationPointLayerMode *)(op))->opacity;
gfloat *in = in_p, *layer = layer_p, *mask = mask_p, *out = out_p;
const gboolean has_mask = mask != NULL;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationBehindClass
GType gimp_operation_behind_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_behind_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationburn.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_burn_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationBurn, gimp_operation_burn,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,18 @@ gimp_operation_burn_init (GimpOperationBurn *self)
{
}
static gboolean
gboolean
gimp_operation_burn_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_burn_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_mode,
layer_mode->composite_mode);
}
gboolean
gimp_operation_burn_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (operation, in, layer, mask, out, samples,
blendfun_burn);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationBurnClass
GType gimp_operation_burn_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_burn_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +31,6 @@
#include "gimpoperationcolorerase.h"
static gboolean gimp_operation_color_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationColorErase, gimp_operation_color_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -68,40 +57,19 @@ gimp_operation_color_erase_init (GimpOperationColorErase *self)
{
}
static gboolean
gimp_operation_color_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_color_erase_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_color_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_color_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;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationColorEraseClass
GType gimp_operation_color_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_color_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationdarkenonly.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_darken_only_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDarkenOnly, gimp_operation_darken_only,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,17 @@ gimp_operation_darken_only_init (GimpOperationDarkenOnly *self)
{
}
static gboolean
gimp_operation_darken_only_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_darken_only_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_darken_only_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_darken_only);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationDarkenOnlyClass
GType gimp_operation_darken_only_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_darken_only_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -30,16 +30,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_difference_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDifference, gimp_operation_difference,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +56,17 @@ gimp_operation_difference_init (GimpOperationDifference *self)
{
}
static gboolean
gimp_operation_difference_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_difference_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_difference_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_difference_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_difference);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationDifferenceClass
GType gimp_operation_difference_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_difference_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -32,16 +32,6 @@
#define RANDOM_TABLE_SIZE 4096
static gboolean gimp_operation_dissolve_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *result,
gint level);
G_DEFINE_TYPE (GimpOperationDissolve, gimp_operation_dissolve,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -80,40 +70,19 @@ gimp_operation_dissolve_init (GimpOperationDissolve *self)
{
}
static gboolean
gimp_operation_dissolve_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *result,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_dissolve_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, result, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_dissolve_process_pixels (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *result,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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)
{
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;

View File

@ -49,17 +49,14 @@ struct _GimpOperationDissolve
GType gimp_operation_dissolve_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dissolve_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *result,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -30,16 +30,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_divide_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDivide, gimp_operation_divide,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +56,16 @@ gimp_operation_divide_init (GimpOperationDivide *self)
{
}
static gboolean
gimp_operation_divide_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_divide_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_divide_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_divide_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
blendfun_divide);
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_divide);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationDivideClass
GType gimp_operation_divide_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_divide_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -30,16 +30,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_dodge_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationDodge, gimp_operation_dodge,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +56,16 @@ gimp_operation_dodge_init (GimpOperationDodge *self)
{
}
static gboolean
gimp_operation_dodge_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_dodge_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_dodge_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_dodge_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
blendfun_dodge);
gimp_composite_blend (op, in, layer, mask, out, samples, blendfun_dodge);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationDodgeClass
GType gimp_operation_dodge_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_dodge_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +27,6 @@
#include "gimpoperationerase.h"
static gboolean gimp_operation_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationErase, gimp_operation_erase,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -64,40 +53,19 @@ gimp_operation_erase_init (GimpOperationErase *self)
{
}
static gboolean
gimp_operation_erase_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_erase_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationEraseClass
GType gimp_operation_erase_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_erase_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -30,16 +30,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_grain_extract_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationGrainExtract, gimp_operation_grain_extract,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +56,17 @@ gimp_operation_grain_extract_init (GimpOperationGrainExtract *self)
{
}
static gboolean
gimp_operation_grain_extract_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_grain_extract_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_grain_extract_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_grain_extract);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationGrainExtractClass
GType gimp_operation_grain_extract_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_extract_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationgrainmerge.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_grain_merge_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationGrainMerge, gimp_operation_grain_merge,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,17 @@ gimp_operation_grain_merge_init (GimpOperationGrainMerge *self)
{
}
static gboolean
gimp_operation_grain_merge_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_grain_merge_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_grain_merge_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_grain_merge);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationGrainMergeClass
GType gimp_operation_grain_merge_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_grain_merge_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -29,16 +29,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_hardlight_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHardlight, gimp_operation_hardlight,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -65,42 +55,17 @@ gimp_operation_hardlight_init (GimpOperationHardlight *self)
{
}
static gboolean
gimp_operation_hardlight_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hardlight_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hardlight_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_hardlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hardlight);
return TRUE;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationHardlightClass
GType gimp_operation_hardlight_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hardlight_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -34,16 +34,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_hsv_color_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvColor, gimp_operation_hsv_color,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -70,42 +60,17 @@ gimp_operation_hsv_color_init (GimpOperationHsvColor *self)
{
}
static gboolean
gimp_operation_hsv_color_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_color_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_color_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_color);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationHsvColorClass
GType gimp_operation_hsv_color_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_color_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +33,6 @@
#include "gimpoperationhsvhue.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_hsv_hue_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvHue, gimp_operation_hsv_hue,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -70,42 +59,17 @@ gimp_operation_hsv_hue_init (GimpOperationHsvHue *self)
{
}
static gboolean
gimp_operation_hsv_hue_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_hsv_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_hue_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_hue_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_hue);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationHsvHueClass
GType gimp_operation_hsv_hue_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_hue_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,21 +33,9 @@
#include "gimpoperationhsvsaturation.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_hsv_saturation_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvSaturation, gimp_operation_hsv_saturation,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_hsv_saturation_class_init (GimpOperationHsvSaturationClass *klass)
{
@ -70,42 +58,17 @@ gimp_operation_hsv_saturation_init (GimpOperationHsvSaturation *self)
{
}
static gboolean
gimp_operation_hsv_saturation_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_saturation_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_saturation_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_saturation);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationHsvSaturationClass
GType gimp_operation_hsv_saturation_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_saturation_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -34,16 +34,6 @@
#include "gimpblendcomposite.h"
static gboolean gimp_operation_hsv_value_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationHsvValue, gimp_operation_hsv_value,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -70,42 +60,17 @@ gimp_operation_hsv_value_init (GimpOperationHsvValue *self)
{
}
static gboolean
gimp_operation_hsv_value_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_hsv_value_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_hsv_value_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_hsv_value);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationHsvValueClass
GType gimp_operation_hsv_value_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_hsv_value_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -30,17 +30,6 @@
#include "gimpoperationlchchroma.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_lch_chroma_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLchChroma, gimp_operation_lch_chroma,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -71,42 +60,17 @@ gimp_operation_lch_chroma_init (GimpOperationLchChroma *self)
{
}
static gboolean
gimp_operation_lch_chroma_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_lch_chroma_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lch_chroma_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_chroma);
return TRUE;
}

View File

@ -51,17 +51,14 @@ struct _GimpOperationLchChromaClass
GType gimp_operation_lch_chroma_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_chroma_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +30,6 @@
#include "gimpoperationlchcolor.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_lch_color_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLchColor, gimp_operation_lch_color,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -71,42 +60,17 @@ gimp_operation_lch_color_init (GimpOperationLchColor *self)
{
}
static gboolean
gimp_operation_lch_color_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_lch_color_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lch_color_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_color);
return TRUE;
}

View File

@ -51,17 +51,14 @@ struct _GimpOperationLchColorClass
GType gimp_operation_lch_color_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_color_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +30,6 @@
#include "gimpoperationlchhue.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_lch_hue_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLchHue, gimp_operation_lch_hue,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -71,42 +60,17 @@ gimp_operation_lch_hue_init (GimpOperationLchHue *self)
{
}
static gboolean
gimp_operation_lch_hue_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_lch_hue_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_lch_hue_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lch_hue_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_hue);
return TRUE;
}

View File

@ -51,16 +51,13 @@ struct _GimpOperationLchHueClass
GType gimp_operation_lch_hue_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_hue_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +30,6 @@
#include "gimpoperationlchlightness.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_lch_lightness_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLchLightness, gimp_operation_lch_lightness,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -71,42 +60,17 @@ gimp_operation_lch_lightness_init (GimpOperationLchLightness *self)
{
}
static gboolean
gimp_operation_lch_lightness_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_lch_lightness_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lch_lightness_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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 (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lch_lightness);
return TRUE;
}

View File

@ -51,17 +51,14 @@ struct _GimpOperationLchLightnessClass
GType gimp_operation_lch_lightness_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lch_lightness_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationlightenonly.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_lighten_only_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationLightenOnly, gimp_operation_lighten_only,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,17 @@ gimp_operation_lighten_only_init (GimpOperationLightenOnly *self)
{
}
static gboolean
gimp_operation_lighten_only_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_lighten_only_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_lighten_only_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_lighten_only_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_lighten_only);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationLightenOnlyClass
GType gimp_operation_lighten_only_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_lighten_only_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -29,21 +29,9 @@
#include "gimpoperationmultiply.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_multiply_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationMultiply, gimp_operation_multiply,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
static void
gimp_operation_multiply_class_init (GimpOperationMultiplyClass *klass)
{
@ -66,42 +54,17 @@ gimp_operation_multiply_init (GimpOperationMultiply *self)
{
}
static gboolean
gimp_operation_multiply_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_multiply_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_multiply_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
gimp_operation_multiply_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_multiply);
return TRUE;
}

View File

@ -50,17 +50,14 @@ struct _GimpOperationMultiplyClass
GType gimp_operation_multiply_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_multiply_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -32,29 +32,26 @@
#include <emmintrin.h>
gboolean
gimp_operation_normal_process_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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)
{
return gimp_operation_normal_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level, blend_trc,
composite_trc,
composite_mode);
return gimp_operation_normal_process_core (operation, in, aux, mask_p, out,
samples,
roi, level);
}
else
{
gfloat opacity = ((GimpOperationPointLayerMode*)(operation))->opacity;
gfloat *mask = mask_p;
const __v4sf *v_in = (const __v4sf*) in;
const __v4sf *v_aux = (const __v4sf*) aux;
__v4sf *v_out = ( __v4sf*) out;

View File

@ -32,29 +32,27 @@
#include <smmintrin.h>
gboolean
gimp_operation_normal_process_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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)
{
return gimp_operation_normal_process_pixels_core (in, aux, mask, out,
opacity, samples,
roi, level, blend_trc,
composite_trc,
composite_mode);
return gimp_operation_normal_process_core (operation,
in, aux, mask_p, out,
samples,
roi, level);
}
else
{
gfloat opacity = ((GimpOperationPointLayerMode*)(operation))->opacity;
gfloat *mask = mask_p;
const __v4sf *v_in = (const __v4sf*) in;
const __v4sf *v_aux = (const __v4sf*) aux;
__v4sf *v_out = ( __v4sf*) out;

View File

@ -35,15 +35,6 @@ static gboolean gimp_operation_normal_parent_process (GeglOperation *oper
const gchar *output_prop,
const GeglRectangle *result,
gint level);
static gboolean gimp_operation_normal_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationNormal, gimp_operation_normal,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -67,7 +58,7 @@ static const gchar* reference_xml = "<?xml version='1.0' encoding='UTF-8'?>"
"</node>"
"</gegl>";
GimpLayerModeFunc gimp_operation_normal_process_pixels = NULL;
GimpLayerModeFunc gimp_operation_normal_process = NULL;
static void
@ -88,19 +79,20 @@ gimp_operation_normal_class_init (GimpOperationNormalClass *klass)
operation_class->process = gimp_operation_normal_parent_process;
point_class->process = gimp_operation_normal_process;
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_core;
gimp_operation_normal_process = gimp_operation_normal_process_core;
#if COMPILE_SSE2_INTRINISICS
if (gimp_cpu_accel_get_support() & GIMP_CPU_ACCEL_X86_SSE2)
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_sse2;
gimp_operation_normal_process = gimp_operation_normal_process_sse2;
#endif /* COMPILE_SSE2_INTRINISICS */
#if COMPILE_SSE4_1_INTRINISICS
if (gimp_cpu_accel_get_support() & GIMP_CPU_ACCEL_X86_SSE4_1)
gimp_operation_normal_process_pixels = gimp_operation_normal_process_pixels_sse4;
gimp_operation_normal_process = gimp_operation_normal_process_sse4;
#endif /* COMPILE_SSE4_1_INTRINISICS */
point_class->process = gimp_operation_normal_process;
}
static void
@ -163,40 +155,19 @@ gimp_operation_normal_parent_process (GeglOperation *operation,
level);
}
static gboolean
gimp_operation_normal_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_normal_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_normal_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
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)
{
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;
while (samples--)

View File

@ -49,43 +49,34 @@ struct _GimpOperationNormalClass
GType gimp_operation_normal_get_type (void) G_GNUC_CONST;
extern GimpLayerModeFunc gimp_operation_normal_process_pixels;
extern GimpLayerModeFunc gimp_operation_normal_process;
gboolean gimp_operation_normal_process_pixels_core (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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_pixels_sse2 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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_pixels_sse4 (gfloat *in,
gfloat *aux,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +28,6 @@
#include "gimpoperationoverlay.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_overlay_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationOverlay, gimp_operation_overlay,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -65,42 +54,17 @@ gimp_operation_overlay_init (GimpOperationOverlay *self)
{
}
static gboolean
gboolean
gimp_operation_overlay_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_overlay_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_overlay_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (operation, in, layer, mask, out, samples,
blendfun_overlay);
return TRUE;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationOverlayClass
GType gimp_operation_overlay_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_overlay_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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

@ -49,6 +49,7 @@ struct _GimpOperationPointLayerMode
GimpLayerColorSpace blend_trc;
GimpLayerColorSpace composite_trc;
GimpLayerCompositeMode composite_mode;
GimpBlendFunc blend_func;
};

View File

@ -26,17 +26,6 @@
#include "gimpoperationreplace.h"
static gboolean gimp_operation_replace_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationReplace, gimp_operation_replace,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -63,40 +52,19 @@ gimp_operation_replace_init (GimpOperationReplace *self)
{
}
static gboolean
gimp_operation_replace_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_replace_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) operation;
return gimp_operation_replace_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_replace_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
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;
while (samples--)

View File

@ -49,17 +49,14 @@ struct _GimpOperationReplaceClass
GType gimp_operation_replace_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_replace_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationscreen.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_screen_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationScreen, gimp_operation_screen,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,17 @@ gimp_operation_screen_init (GimpOperationScreen *self)
{
}
static gboolean
gimp_operation_screen_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_screen_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_screen_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_screen_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_screen);
return TRUE;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationScreenClass
GType gimp_operation_screen_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_screen_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +28,6 @@
#include "gimpoperationsoftlight.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_softlight_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationSoftlight, gimp_operation_softlight,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -83,42 +72,18 @@ gimp_operation_softlight_init (GimpOperationSoftlight *self)
{
}
static gboolean
gimp_operation_softlight_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_softlight_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_softlight_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_softlight_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_softlight);
return TRUE;
}

View File

@ -49,17 +49,14 @@ struct _GimpOperationSoftlightClass
GType gimp_operation_softlight_get_type (void) G_GNUC_CONST;
gboolean gimp_operation_softlight_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode);
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,17 +29,6 @@
#include "gimpoperationsubtract.h"
#include "gimpblendcomposite.h"
static gboolean gimp_operation_subtract_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level);
G_DEFINE_TYPE (GimpOperationSubtract, gimp_operation_subtract,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
@ -66,42 +55,17 @@ gimp_operation_subtract_init (GimpOperationSubtract *self)
{
}
static gboolean
gimp_operation_subtract_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
gboolean
gimp_operation_subtract_process (GeglOperation *op,
void *in,
void *layer,
void *mask,
void *out,
glong samples,
const GeglRectangle *roi,
gint level)
{
GimpOperationPointLayerMode *layer_mode = (gpointer) operation;
return gimp_operation_subtract_process_pixels (in_buf, aux_buf, aux2_buf,
out_buf,
layer_mode->opacity,
samples, roi, level,
layer_mode->blend_trc,
layer_mode->composite_trc,
layer_mode->composite_mode);
}
gboolean
gimp_operation_subtract_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerColorSpace blend_trc,
GimpLayerColorSpace composite_trc,
GimpLayerCompositeMode composite_mode)
{
gimp_composite_blend (in, layer, mask, out, opacity, samples,
blend_trc, composite_trc, composite_mode,
gimp_composite_blend (op, in, layer, mask, out, samples,
blendfun_subtract);
return TRUE;
}

Some files were not shown because too many files have changed in this diff Show More