diff --git a/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.c b/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.c index 712810aa02..0338442599 100644 --- a/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.c @@ -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--) diff --git a/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.h b/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.h index fbc5f9f0f9..21b5ea7a16 100644 --- a/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationadditionlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c index 3fd1b008ca..d7e108845e 100644 --- a/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h index 9c4f73c396..22853f77b4 100644 --- a/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationburnlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.c b/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.c index ed4d5553c5..a30fa57f4f 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.h b/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.h index 485dae6b35..55f7d50c4e 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationdarkenonlylegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.c b/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.c index 21039ff415..c4de0e9ce9 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.h b/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.h index 066cada3a6..b046c1eff8 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationdifferencelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c index e63518f252..4e8e691e26 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h index 4e3708f959..3d01ab2b8d 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationdividelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.c b/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.c index 330e24fd1e..480a6ebd82 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.h b/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.h index 11dee3eb0a..6d53efae74 100644 --- a/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationdodgelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c index 9b92315046..f38d0e76ea 100644 --- a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.h b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.h index f8c3e865af..2fe6c51880 100644 --- a/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationgrainextractlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c index 3859f101bc..c71e4fbb0e 100644 --- a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.c @@ -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 ++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.h b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.h index 45210811db..fdc4dc34f5 100644 --- a/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationgrainmergelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c index 395bfd3aea..189448b469 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.c @@ -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 ++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.h b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.h index 945feb16b0..0e15be12b8 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationhardlightlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.c b/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.c index 6bfba7a833..25f564bdd7 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.h b/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.h index e38a0ca424..9ef93be823 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationhsvcolorlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.c b/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.c index 33fee2fb25..ccfc631150 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.h b/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.h index 1fd7faf566..a1cf5dcdbe 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationhsvhuelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.c b/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.c index 9fd169fe6d..029fab1571 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.h b/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.h index 9539221519..5fb2459815 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationhsvsaturationlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.c b/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.c index 4e42d508d6..9aa369d2e3 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.h b/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.h index 00c5311851..bbef81cbc8 100644 --- a/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationhsvvaluelegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.c b/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.c index 58b832a127..3a555ae3f2 100644 --- a/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.h b/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.h index 8b98e33576..9b6ada2c5f 100644 --- a/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationlightenonlylegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.c b/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.c index 4d4ddef158..6445752f28 100644 --- a/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.h b/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.h index 2e3aff7467..dbeb9cdedd 100644 --- a/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationmultiplylegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.c b/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.c index d96970242d..88e44020d1 100644 --- a/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.h b/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.h index c43e18adc0..5a16a591ac 100644 --- a/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationscreenlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.c b/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.c index a314a3e0e4..55cd8194b1 100644 --- a/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.c @@ -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 ++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.h b/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.h index 42b125e2b0..d760e419b1 100644 --- a/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationsoftlightlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.c b/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.c index 8eeb7a27d0..a19d070052 100644 --- a/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.c +++ b/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.c @@ -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++; } diff --git a/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.h b/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.h index 97ce1d6fca..ff39e0e995 100644 --- a/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.h +++ b/app/operations/layer-modes-legacy/gimpoperationsubtractlegacy.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpblendcomposite.h b/app/operations/layer-modes/gimpblendcomposite.h index 7a5eed11c0..415e85daa3 100644 --- a/app/operations/layer-modes/gimpblendcomposite.h +++ b/app/operations/layer-modes/gimpblendcomposite.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimplayermodefunctions.c b/app/operations/layer-modes/gimplayermodefunctions.c index cb9a50c4fa..3bc190e39c 100644 --- a/app/operations/layer-modes/gimplayermodefunctions.c +++ b/app/operations/layer-modes/gimplayermodefunctions.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationaddition.c b/app/operations/layer-modes/gimpoperationaddition.c index d758cf7a00..c915dd639f 100644 --- a/app/operations/layer-modes/gimpoperationaddition.c +++ b/app/operations/layer-modes/gimpoperationaddition.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationaddition.h b/app/operations/layer-modes/gimpoperationaddition.h index 6538ffa689..4772ff79ee 100644 --- a/app/operations/layer-modes/gimpoperationaddition.h +++ b/app/operations/layer-modes/gimpoperationaddition.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationantierase.c b/app/operations/layer-modes/gimpoperationantierase.c index 9fd62864ce..c968707099 100644 --- a/app/operations/layer-modes/gimpoperationantierase.c +++ b/app/operations/layer-modes/gimpoperationantierase.c @@ -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--) diff --git a/app/operations/layer-modes/gimpoperationantierase.h b/app/operations/layer-modes/gimpoperationantierase.h index c10832402b..77d33031dd 100644 --- a/app/operations/layer-modes/gimpoperationantierase.h +++ b/app/operations/layer-modes/gimpoperationantierase.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationbehind.c b/app/operations/layer-modes/gimpoperationbehind.c index a4d15b8479..788d492c38 100644 --- a/app/operations/layer-modes/gimpoperationbehind.c +++ b/app/operations/layer-modes/gimpoperationbehind.c @@ -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--) diff --git a/app/operations/layer-modes/gimpoperationbehind.h b/app/operations/layer-modes/gimpoperationbehind.h index fb32de8495..da9f274edb 100644 --- a/app/operations/layer-modes/gimpoperationbehind.h +++ b/app/operations/layer-modes/gimpoperationbehind.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationburn.c b/app/operations/layer-modes/gimpoperationburn.c index db1d675e66..7adb3ee09f 100644 --- a/app/operations/layer-modes/gimpoperationburn.c +++ b/app/operations/layer-modes/gimpoperationburn.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationburn.h b/app/operations/layer-modes/gimpoperationburn.h index 5404290fa1..6fad8e1604 100644 --- a/app/operations/layer-modes/gimpoperationburn.h +++ b/app/operations/layer-modes/gimpoperationburn.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationcolorerase.c b/app/operations/layer-modes/gimpoperationcolorerase.c index 7f3f99f62f..faf99c1696 100644 --- a/app/operations/layer-modes/gimpoperationcolorerase.c +++ b/app/operations/layer-modes/gimpoperationcolorerase.c @@ -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--) diff --git a/app/operations/layer-modes/gimpoperationcolorerase.h b/app/operations/layer-modes/gimpoperationcolorerase.h index f1f8912673..cee4154312 100644 --- a/app/operations/layer-modes/gimpoperationcolorerase.h +++ b/app/operations/layer-modes/gimpoperationcolorerase.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationdarkenonly.c b/app/operations/layer-modes/gimpoperationdarkenonly.c index bc818c6f6f..ab15d546d8 100644 --- a/app/operations/layer-modes/gimpoperationdarkenonly.c +++ b/app/operations/layer-modes/gimpoperationdarkenonly.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationdarkenonly.h b/app/operations/layer-modes/gimpoperationdarkenonly.h index a075959f84..1407c9e5ab 100644 --- a/app/operations/layer-modes/gimpoperationdarkenonly.h +++ b/app/operations/layer-modes/gimpoperationdarkenonly.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationdifference.c b/app/operations/layer-modes/gimpoperationdifference.c index c9bc28b992..314cfa2049 100644 --- a/app/operations/layer-modes/gimpoperationdifference.c +++ b/app/operations/layer-modes/gimpoperationdifference.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationdifference.h b/app/operations/layer-modes/gimpoperationdifference.h index 366835b20a..3bbe3fd5b8 100644 --- a/app/operations/layer-modes/gimpoperationdifference.h +++ b/app/operations/layer-modes/gimpoperationdifference.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationdissolve.c b/app/operations/layer-modes/gimpoperationdissolve.c index 867c573b95..2992c5cb65 100644 --- a/app/operations/layer-modes/gimpoperationdissolve.c +++ b/app/operations/layer-modes/gimpoperationdissolve.c @@ -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; diff --git a/app/operations/layer-modes/gimpoperationdissolve.h b/app/operations/layer-modes/gimpoperationdissolve.h index 604aa7466a..7a07075891 100644 --- a/app/operations/layer-modes/gimpoperationdissolve.h +++ b/app/operations/layer-modes/gimpoperationdissolve.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationdivide.c b/app/operations/layer-modes/gimpoperationdivide.c index 79a4ea4d31..150adc64e4 100644 --- a/app/operations/layer-modes/gimpoperationdivide.c +++ b/app/operations/layer-modes/gimpoperationdivide.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationdivide.h b/app/operations/layer-modes/gimpoperationdivide.h index 021da6eeec..fd9d6de174 100644 --- a/app/operations/layer-modes/gimpoperationdivide.h +++ b/app/operations/layer-modes/gimpoperationdivide.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationdodge.c b/app/operations/layer-modes/gimpoperationdodge.c index c97ba22e1d..671fd93261 100644 --- a/app/operations/layer-modes/gimpoperationdodge.c +++ b/app/operations/layer-modes/gimpoperationdodge.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationdodge.h b/app/operations/layer-modes/gimpoperationdodge.h index 162dc2f1ea..648e5e38d6 100644 --- a/app/operations/layer-modes/gimpoperationdodge.h +++ b/app/operations/layer-modes/gimpoperationdodge.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationerase.c b/app/operations/layer-modes/gimpoperationerase.c index 8b50e47f19..f305a5e3db 100644 --- a/app/operations/layer-modes/gimpoperationerase.c +++ b/app/operations/layer-modes/gimpoperationerase.c @@ -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--) diff --git a/app/operations/layer-modes/gimpoperationerase.h b/app/operations/layer-modes/gimpoperationerase.h index e320f0c380..bb800c7624 100644 --- a/app/operations/layer-modes/gimpoperationerase.h +++ b/app/operations/layer-modes/gimpoperationerase.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationgrainextract.c b/app/operations/layer-modes/gimpoperationgrainextract.c index 79aca58c5c..c26cd1251b 100644 --- a/app/operations/layer-modes/gimpoperationgrainextract.c +++ b/app/operations/layer-modes/gimpoperationgrainextract.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationgrainextract.h b/app/operations/layer-modes/gimpoperationgrainextract.h index e34bdce7d7..bc15ffecb1 100644 --- a/app/operations/layer-modes/gimpoperationgrainextract.h +++ b/app/operations/layer-modes/gimpoperationgrainextract.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationgrainmerge.c b/app/operations/layer-modes/gimpoperationgrainmerge.c index 492dcad329..67b702a718 100644 --- a/app/operations/layer-modes/gimpoperationgrainmerge.c +++ b/app/operations/layer-modes/gimpoperationgrainmerge.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationgrainmerge.h b/app/operations/layer-modes/gimpoperationgrainmerge.h index 875db95753..e8123d5843 100644 --- a/app/operations/layer-modes/gimpoperationgrainmerge.h +++ b/app/operations/layer-modes/gimpoperationgrainmerge.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationhardlight.c b/app/operations/layer-modes/gimpoperationhardlight.c index 50040cd38c..965c332f5b 100644 --- a/app/operations/layer-modes/gimpoperationhardlight.c +++ b/app/operations/layer-modes/gimpoperationhardlight.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationhardlight.h b/app/operations/layer-modes/gimpoperationhardlight.h index 790e5ccbe4..7a4af0d002 100644 --- a/app/operations/layer-modes/gimpoperationhardlight.h +++ b/app/operations/layer-modes/gimpoperationhardlight.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationhsvcolor.c b/app/operations/layer-modes/gimpoperationhsvcolor.c index 5a61fb98de..7612e5f2dd 100644 --- a/app/operations/layer-modes/gimpoperationhsvcolor.c +++ b/app/operations/layer-modes/gimpoperationhsvcolor.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationhsvcolor.h b/app/operations/layer-modes/gimpoperationhsvcolor.h index 54d2b2fc31..a79b518ac2 100644 --- a/app/operations/layer-modes/gimpoperationhsvcolor.h +++ b/app/operations/layer-modes/gimpoperationhsvcolor.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationhsvhue.c b/app/operations/layer-modes/gimpoperationhsvhue.c index f04094221c..e38ce10b1d 100644 --- a/app/operations/layer-modes/gimpoperationhsvhue.c +++ b/app/operations/layer-modes/gimpoperationhsvhue.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationhsvhue.h b/app/operations/layer-modes/gimpoperationhsvhue.h index 724d4bd152..8c6df24858 100644 --- a/app/operations/layer-modes/gimpoperationhsvhue.h +++ b/app/operations/layer-modes/gimpoperationhsvhue.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationhsvsaturation.c b/app/operations/layer-modes/gimpoperationhsvsaturation.c index c3910c2974..29ddf224c1 100644 --- a/app/operations/layer-modes/gimpoperationhsvsaturation.c +++ b/app/operations/layer-modes/gimpoperationhsvsaturation.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationhsvsaturation.h b/app/operations/layer-modes/gimpoperationhsvsaturation.h index ba22f2361a..d838ca9b75 100644 --- a/app/operations/layer-modes/gimpoperationhsvsaturation.h +++ b/app/operations/layer-modes/gimpoperationhsvsaturation.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationhsvvalue.c b/app/operations/layer-modes/gimpoperationhsvvalue.c index a8cf4b604d..c2dd25d9f8 100644 --- a/app/operations/layer-modes/gimpoperationhsvvalue.c +++ b/app/operations/layer-modes/gimpoperationhsvvalue.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationhsvvalue.h b/app/operations/layer-modes/gimpoperationhsvvalue.h index 7419d7618b..f5bf94e644 100644 --- a/app/operations/layer-modes/gimpoperationhsvvalue.h +++ b/app/operations/layer-modes/gimpoperationhsvvalue.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationlchchroma.c b/app/operations/layer-modes/gimpoperationlchchroma.c index 092d1bbc3e..4503046b1f 100644 --- a/app/operations/layer-modes/gimpoperationlchchroma.c +++ b/app/operations/layer-modes/gimpoperationlchchroma.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationlchchroma.h b/app/operations/layer-modes/gimpoperationlchchroma.h index 40cab8d79a..67a1d63e0b 100644 --- a/app/operations/layer-modes/gimpoperationlchchroma.h +++ b/app/operations/layer-modes/gimpoperationlchchroma.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationlchcolor.c b/app/operations/layer-modes/gimpoperationlchcolor.c index f2ecadd889..cc37eee7b3 100644 --- a/app/operations/layer-modes/gimpoperationlchcolor.c +++ b/app/operations/layer-modes/gimpoperationlchcolor.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationlchcolor.h b/app/operations/layer-modes/gimpoperationlchcolor.h index 8ea4aff5fe..84c9dd801f 100644 --- a/app/operations/layer-modes/gimpoperationlchcolor.h +++ b/app/operations/layer-modes/gimpoperationlchcolor.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationlchhue.c b/app/operations/layer-modes/gimpoperationlchhue.c index 8fa855d3f1..32bf3e9c2c 100644 --- a/app/operations/layer-modes/gimpoperationlchhue.c +++ b/app/operations/layer-modes/gimpoperationlchhue.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationlchhue.h b/app/operations/layer-modes/gimpoperationlchhue.h index 246934254a..d3e3487a4f 100644 --- a/app/operations/layer-modes/gimpoperationlchhue.h +++ b/app/operations/layer-modes/gimpoperationlchhue.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationlchlightness.c b/app/operations/layer-modes/gimpoperationlchlightness.c index 8fa1459743..3743a53333 100644 --- a/app/operations/layer-modes/gimpoperationlchlightness.c +++ b/app/operations/layer-modes/gimpoperationlchlightness.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationlchlightness.h b/app/operations/layer-modes/gimpoperationlchlightness.h index 6597a2dfe4..7fcd8141de 100644 --- a/app/operations/layer-modes/gimpoperationlchlightness.h +++ b/app/operations/layer-modes/gimpoperationlchlightness.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationlightenonly.c b/app/operations/layer-modes/gimpoperationlightenonly.c index 081b605055..2fd0cfc8d0 100644 --- a/app/operations/layer-modes/gimpoperationlightenonly.c +++ b/app/operations/layer-modes/gimpoperationlightenonly.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationlightenonly.h b/app/operations/layer-modes/gimpoperationlightenonly.h index af36a1c124..779be0bf5e 100644 --- a/app/operations/layer-modes/gimpoperationlightenonly.h +++ b/app/operations/layer-modes/gimpoperationlightenonly.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationmultiply.c b/app/operations/layer-modes/gimpoperationmultiply.c index 27eb6e8563..a87ed3088c 100644 --- a/app/operations/layer-modes/gimpoperationmultiply.c +++ b/app/operations/layer-modes/gimpoperationmultiply.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationmultiply.h b/app/operations/layer-modes/gimpoperationmultiply.h index e7fe255690..5ee76fa280 100644 --- a/app/operations/layer-modes/gimpoperationmultiply.h +++ b/app/operations/layer-modes/gimpoperationmultiply.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationnormal-sse2.c b/app/operations/layer-modes/gimpoperationnormal-sse2.c index f8d48ec6a2..9e3b048c02 100644 --- a/app/operations/layer-modes/gimpoperationnormal-sse2.c +++ b/app/operations/layer-modes/gimpoperationnormal-sse2.c @@ -32,29 +32,26 @@ #include 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; diff --git a/app/operations/layer-modes/gimpoperationnormal-sse4.c b/app/operations/layer-modes/gimpoperationnormal-sse4.c index ddc8d52952..890a4ed351 100644 --- a/app/operations/layer-modes/gimpoperationnormal-sse4.c +++ b/app/operations/layer-modes/gimpoperationnormal-sse4.c @@ -32,29 +32,27 @@ #include 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; diff --git a/app/operations/layer-modes/gimpoperationnormal.c b/app/operations/layer-modes/gimpoperationnormal.c index 20b473bf07..9ffa9c998f 100644 --- a/app/operations/layer-modes/gimpoperationnormal.c +++ b/app/operations/layer-modes/gimpoperationnormal.c @@ -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 = "" "" ""; -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--) diff --git a/app/operations/layer-modes/gimpoperationnormal.h b/app/operations/layer-modes/gimpoperationnormal.h index 1ab7e1baa1..5ecbd49f4e 100644 --- a/app/operations/layer-modes/gimpoperationnormal.h +++ b/app/operations/layer-modes/gimpoperationnormal.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationoverlay.c b/app/operations/layer-modes/gimpoperationoverlay.c index cc08d9fd7e..c849eeab7f 100644 --- a/app/operations/layer-modes/gimpoperationoverlay.c +++ b/app/operations/layer-modes/gimpoperationoverlay.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationoverlay.h b/app/operations/layer-modes/gimpoperationoverlay.h index 477382814a..01e6319467 100644 --- a/app/operations/layer-modes/gimpoperationoverlay.h +++ b/app/operations/layer-modes/gimpoperationoverlay.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationpointlayermode.h b/app/operations/layer-modes/gimpoperationpointlayermode.h index f1cd7c4266..7d62e71295 100644 --- a/app/operations/layer-modes/gimpoperationpointlayermode.h +++ b/app/operations/layer-modes/gimpoperationpointlayermode.h @@ -49,6 +49,7 @@ struct _GimpOperationPointLayerMode GimpLayerColorSpace blend_trc; GimpLayerColorSpace composite_trc; GimpLayerCompositeMode composite_mode; + GimpBlendFunc blend_func; }; diff --git a/app/operations/layer-modes/gimpoperationreplace.c b/app/operations/layer-modes/gimpoperationreplace.c index ed7b688bb7..145f38b2b9 100644 --- a/app/operations/layer-modes/gimpoperationreplace.c +++ b/app/operations/layer-modes/gimpoperationreplace.c @@ -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--) diff --git a/app/operations/layer-modes/gimpoperationreplace.h b/app/operations/layer-modes/gimpoperationreplace.h index 07f297c3d2..d4b52def04 100644 --- a/app/operations/layer-modes/gimpoperationreplace.h +++ b/app/operations/layer-modes/gimpoperationreplace.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationscreen.c b/app/operations/layer-modes/gimpoperationscreen.c index 576db27a08..a1d5273d3a 100644 --- a/app/operations/layer-modes/gimpoperationscreen.c +++ b/app/operations/layer-modes/gimpoperationscreen.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationscreen.h b/app/operations/layer-modes/gimpoperationscreen.h index af36c29695..2acb443bae 100644 --- a/app/operations/layer-modes/gimpoperationscreen.h +++ b/app/operations/layer-modes/gimpoperationscreen.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationsoftlight.c b/app/operations/layer-modes/gimpoperationsoftlight.c index 0df422f882..15c56bd701 100644 --- a/app/operations/layer-modes/gimpoperationsoftlight.c +++ b/app/operations/layer-modes/gimpoperationsoftlight.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationsoftlight.h b/app/operations/layer-modes/gimpoperationsoftlight.h index a8c2c258b1..ddd8ae45f5 100644 --- a/app/operations/layer-modes/gimpoperationsoftlight.h +++ b/app/operations/layer-modes/gimpoperationsoftlight.h @@ -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__ */ diff --git a/app/operations/layer-modes/gimpoperationsubtract.c b/app/operations/layer-modes/gimpoperationsubtract.c index 1d2c058ea8..5ac9accd36 100644 --- a/app/operations/layer-modes/gimpoperationsubtract.c +++ b/app/operations/layer-modes/gimpoperationsubtract.c @@ -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; } diff --git a/app/operations/layer-modes/gimpoperationsubtract.h b/app/operations/layer-modes/gimpoperationsubtract.h index 65581a8bca..14c53f410b 100644 --- a/app/operations/layer-modes/gimpoperationsubtract.h +++ b/app/operations/layer-modes/gimpoperationsubtract.h @@ -50,17 +50,14 @@ struct _GimpOperationSubtractClass GType gimp_operation_subtract_get_type (void) G_GNUC_CONST; -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); +gboolean gimp_operation_subtract_process (GeglOperation *op, + void *in, + void *layer, + void *mask, + void *out, + glong samples, + const GeglRectangle *roi, + gint level); #endif /* __GIMP_OPERATION_SUBTRACT_H__ */ diff --git a/app/operations/operations-types.h b/app/operations/operations-types.h index 3c82a2fa1c..ebee4cda48 100644 --- a/app/operations/operations-types.h +++ b/app/operations/operations-types.h @@ -55,17 +55,14 @@ typedef struct _GimpCagePoint GimpCagePoint; /* functions */ -typedef gboolean (* GimpLayerModeFunc) (gfloat *in, - gfloat *aux, - gfloat *mask, - gfloat *out, - gfloat opacity, +typedef gboolean (* GimpLayerModeFunc) (GeglOperation *operation, + void *in, + void *aux, + void *mask, + void *out, glong samples, const GeglRectangle *roi, - gint level, - GimpLayerColorSpace blend_trc, - GimpLayerColorSpace composite_trc, - GimpLayerCompositeMode composite_mode); + gint level); typedef void (* GimpBlendFunc) (const float *dest, const float *src, diff --git a/app/paint/gimppaintcore-loops.c b/app/paint/gimppaintcore-loops.c index 979e9e0674..f3c160dd44 100644 --- a/app/paint/gimppaintcore-loops.c +++ b/app/paint/gimppaintcore-loops.c @@ -26,6 +26,7 @@ #include "core/gimptempbuf.h" #include "operations/layer-modes/gimplayermodefunctions.h" +#include "operations/layer-modes/gimpoperationpointlayermode.h" #include "gimppaintcore-loops.h" @@ -356,6 +357,12 @@ do_layer_blend (GeglBuffer *src_buffer, gfloat *mask_pixel = NULL; gfloat *paint_pixel = paint_data + ((iter->roi[0].y - roi.y) * paint_stride + iter->roi[0].x - roi.x) * 4; int iy; + GimpOperationPointLayerMode layer_data; + + layer_data.opacity = opacity; + layer_data.blend_trc = blend_trc; + layer_data.composite_trc = composite_trc; + layer_data.composite_mode = composite_mode; if (mask_buffer) mask_pixel = (gfloat *)iter->data[2]; @@ -364,21 +371,19 @@ do_layer_blend (GeglBuffer *src_buffer, process_roi.width = iter->roi[0].width; process_roi.height = 1; + for (iy = 0; iy < iter->roi[0].height; iy++) { process_roi.y = iter->roi[0].y + iy; - (*apply_func) (in_pixel, + (*apply_func) ((GeglOperation*)&layer_data, + in_pixel, paint_pixel, mask_pixel, out_pixel, - opacity, iter->roi[0].width, &process_roi, - 0, - blend_trc, - composite_trc, - composite_mode); + 0); in_pixel += iter->roi[0].width * 4; out_pixel += iter->roi[0].width * 4;