app: make layer modes more configurable

Implement a common utility function gimp_blend_composite that uses utility
functions for implementing layer modes, with separate (possibly SIMD) optimized
loops for blending and compositing, with configured linear TRC, perceptual
gamma TRC or even using CIE Lab as the space.
This commit is contained in:
Øyvind Kolås
2017-01-15 21:11:00 +01:00
parent d1fea4d6c6
commit 41fff6990e
105 changed files with 2383 additions and 1992 deletions

View File

@ -66,28 +66,34 @@ 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,
glong samples,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_addition_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_addition_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_addition_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_ADDITION_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_burn_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_burn_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_burn_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_burn_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_BURN_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_darken_only_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_darken_only_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_DARKEN_ONLY_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_difference_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_difference_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_difference_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_difference_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_DIFFERENCE_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_divide_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_divide_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_divide_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_divide_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_DIVIDE_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_dodge_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_dodge_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_dodge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_dodge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_DODGE_LEGACY_H__ */

View File

@ -29,13 +29,13 @@
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);
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,
@ -74,20 +74,23 @@ gimp_operation_grain_extract_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_grain_extract_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_grain_extract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_Trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_GRAIN_EXTRACT_LEGACY_H__ */

View File

@ -29,13 +29,13 @@
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);
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,
@ -74,20 +74,23 @@ gimp_operation_grain_merge_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_grain_merge_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_grain_merge_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -56,7 +56,10 @@ gboolean gimp_operation_grain_merge_legacy_process_pixels (gfloat *
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_GRAIN_MERGE_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_hardlight_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_hardlight_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_hardlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -56,7 +56,10 @@ gboolean gimp_operation_hardlight_legacy_process_pixels (gfloat *in
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_HARDLIGHT_LEGACY_H__ */

View File

@ -78,20 +78,23 @@ gimp_operation_hsv_color_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_hsv_color_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_hsv_color_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -56,7 +56,10 @@ gboolean gimp_operation_hsv_color_legacy_process_pixels (gfloat *in
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level);
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_HSV_COLOR_LEGACY_H__ */

View File

@ -78,20 +78,23 @@ gimp_operation_hsv_hue_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_hsv_hue_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_hsv_hue_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,18 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_HSV_HUE_LEGACY_H__ */

View File

@ -78,20 +78,23 @@ gimp_operation_hsv_saturation_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_hsv_saturation_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_hsv_saturation_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_HSV_SATURATION_LEGACY_H__ */

View File

@ -78,20 +78,23 @@ gimp_operation_hsv_value_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_hsv_value_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_hsv_value_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_HSV_VALUE_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_lighten_only_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_lighten_only_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_lighten_only_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
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,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_LIGHTEN_ONLY_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_multiply_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_multiply_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_multiply_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,16 @@ 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);
gboolean gimp_operation_multiply_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_MULTIPLY_LEGACY_H__ */

View File

@ -74,20 +74,23 @@ gimp_operation_screen_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_screen_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_screen_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_SCREEN_LEGACY_H__ */

View File

@ -92,20 +92,22 @@ gimp_operation_softlight_legacy_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
return gimp_operation_softlight_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, 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)
gimp_operation_softlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_softlight_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_SOFTLIGHT_LEGACY_H__ */

View File

@ -66,28 +66,31 @@ 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,
glong samples,
const GeglRectangle *roi,
gint level)
void *in_buf,
void *aux_buf,
void *aux2_buf,
void *out_buf,
glong samples,
const GeglRectangle *roi,
gint level)
{
gfloat opacity = GIMP_OPERATION_POINT_LAYER_MODE (operation)->opacity;
GimpOperationPointLayerMode *layer_mode = (GimpOperationPointLayerMode*)operation;
return gimp_operation_subtract_legacy_process_pixels (in_buf, aux_buf, aux2_buf, out_buf, opacity, samples, roi, level);
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)
gimp_operation_subtract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode)
{
const gboolean has_mask = mask != NULL;

View File

@ -49,14 +49,17 @@ 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);
gboolean gimp_operation_subtract_legacy_process_pixels (gfloat *in,
gfloat *layer,
gfloat *mask,
gfloat *out,
gfloat opacity,
glong samples,
const GeglRectangle *roi,
gint level,
GimpLayerBlendTRC blend_trc,
GimpLayerBlendTRC composite_trc,
GimpLayerCompositeMode composite_mode);
#endif /* __GIMP_OPERATION_SUBTRACT_LEGACY_H__ */