app: code cleanup in the GEGL ops
This commit is contained in:
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "gimp-intl.h"
|
#include "gimp-intl.h"
|
||||||
|
|
||||||
static void gimp_operation_cage_coef_calc_prepare (GeglOperation *operation);
|
|
||||||
static void gimp_operation_cage_coef_calc_finalize (GObject *object);
|
static void gimp_operation_cage_coef_calc_finalize (GObject *object);
|
||||||
static void gimp_operation_cage_coef_calc_get_property (GObject *object,
|
static void gimp_operation_cage_coef_calc_get_property (GObject *object,
|
||||||
guint property_id,
|
guint property_id,
|
||||||
@ -40,6 +40,8 @@ static void gimp_operation_cage_coef_calc_set_property (GObject
|
|||||||
guint property_id,
|
guint property_id,
|
||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
static void gimp_operation_cage_coef_calc_prepare (GeglOperation *operation);
|
||||||
static GeglRectangle gimp_operation_cage_coef_calc_get_bounding_box (GeglOperation *operation);
|
static GeglRectangle gimp_operation_cage_coef_calc_get_bounding_box (GeglOperation *operation);
|
||||||
static gboolean gimp_operation_cage_coef_calc_process (GeglOperation *operation,
|
static gboolean gimp_operation_cage_coef_calc_process (GeglOperation *operation,
|
||||||
GeglBuffer *output,
|
GeglBuffer *output,
|
||||||
@ -92,18 +94,6 @@ gimp_operation_cage_coef_calc_init (GimpOperationCageCoefCalc *self)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_operation_cage_coef_calc_prepare (GeglOperation *operation)
|
|
||||||
{
|
|
||||||
GimpOperationCageCoefCalc *occc = GIMP_OPERATION_CAGE_COEF_CALC (operation);
|
|
||||||
GimpCageConfig *config = GIMP_CAGE_CONFIG (occc->config);
|
|
||||||
|
|
||||||
gegl_operation_set_format (operation,
|
|
||||||
"output",
|
|
||||||
babl_format_n (babl_type ("float"),
|
|
||||||
2 * gimp_cage_config_get_n_points (config)));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_operation_cage_coef_calc_finalize (GObject *object)
|
gimp_operation_cage_coef_calc_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@ -181,6 +171,18 @@ gimp_operation_cage_coef_calc_is_on_straight (GimpVector2 *d1,
|
|||||||
return (deter < 0.000000001) && (deter > -0.000000001);
|
return (deter < 0.000000001) && (deter > -0.000000001);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gimp_operation_cage_coef_calc_prepare (GeglOperation *operation)
|
||||||
|
{
|
||||||
|
GimpOperationCageCoefCalc *occc = GIMP_OPERATION_CAGE_COEF_CALC (operation);
|
||||||
|
GimpCageConfig *config = GIMP_CAGE_CONFIG (occc->config);
|
||||||
|
|
||||||
|
gegl_operation_set_format (operation,
|
||||||
|
"output",
|
||||||
|
babl_format_n (babl_type ("float"),
|
||||||
|
2 * gimp_cage_config_get_n_points (config)));
|
||||||
|
}
|
||||||
|
|
||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_cage_coef_calc_get_bounding_box (GeglOperation *operation)
|
gimp_operation_cage_coef_calc_get_bounding_box (GeglOperation *operation)
|
||||||
{
|
{
|
||||||
|
@ -57,8 +57,9 @@ gimp_operation_darken_only_mode_class_init (GimpOperationDarkenOnlyModeClass *kl
|
|||||||
"description", "GIMP darken only mode operation",
|
"description", "GIMP darken only mode operation",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
point_class->process = gimp_operation_darken_only_mode_process;
|
|
||||||
operation_class->prepare = gimp_operation_darken_only_mode_prepare;
|
operation_class->prepare = gimp_operation_darken_only_mode_prepare;
|
||||||
|
|
||||||
|
point_class->process = gimp_operation_darken_only_mode_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -29,16 +29,11 @@
|
|||||||
|
|
||||||
#include "gimpoperationdissolvemode.h"
|
#include "gimpoperationdissolvemode.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (GimpOperationDissolveMode, gimp_operation_dissolve_mode,
|
|
||||||
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
|
|
||||||
|
|
||||||
#define RANDOM_TABLE_SIZE 4096
|
#define RANDOM_TABLE_SIZE 4096
|
||||||
static gint32 random_table[RANDOM_TABLE_SIZE];
|
|
||||||
|
|
||||||
static void gimp_operation_dissolve_mode_prepare (
|
static void gimp_operation_dissolve_mode_prepare (GeglOperation *operation);
|
||||||
GeglOperation *operation);
|
static gboolean gimp_operation_dissolve_mode_process (GeglOperation *operation,
|
||||||
static gboolean gimp_operation_dissolve_mode_process (
|
|
||||||
GeglOperation *operation,
|
|
||||||
void *in_buf,
|
void *in_buf,
|
||||||
void *aux_buf,
|
void *aux_buf,
|
||||||
void *out_buf,
|
void *out_buf,
|
||||||
@ -47,6 +42,12 @@ static gboolean gimp_operation_dissolve_mode_process (
|
|||||||
gint level);
|
gint level);
|
||||||
|
|
||||||
|
|
||||||
|
G_DEFINE_TYPE (GimpOperationDissolveMode, gimp_operation_dissolve_mode,
|
||||||
|
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
|
||||||
|
|
||||||
|
static gint32 random_table[RANDOM_TABLE_SIZE];
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_operation_dissolve_mode_class_init (GimpOperationDissolveModeClass *klass)
|
gimp_operation_dissolve_mode_class_init (GimpOperationDissolveModeClass *klass)
|
||||||
{
|
{
|
||||||
|
@ -49,6 +49,7 @@ static void gimp_operation_grow_set_property (GObject *object,
|
|||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
static void gimp_operation_grow_prepare (GeglOperation *operation);
|
||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_grow_get_required_for_output (GeglOperation *self,
|
gimp_operation_grow_get_required_for_output (GeglOperation *self,
|
||||||
const gchar *input_pad,
|
const gchar *input_pad,
|
||||||
@ -56,7 +57,7 @@ gimp_operation_grow_get_required_for_output (GeglOperation *self,
|
|||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_grow_get_cached_region (GeglOperation *self,
|
gimp_operation_grow_get_cached_region (GeglOperation *self,
|
||||||
const GeglRectangle *roi);
|
const GeglRectangle *roi);
|
||||||
static void gimp_operation_grow_prepare (GeglOperation *operation);
|
|
||||||
static gboolean gimp_operation_grow_process (GeglOperation *operation,
|
static gboolean gimp_operation_grow_process (GeglOperation *operation,
|
||||||
GeglBuffer *input,
|
GeglBuffer *input,
|
||||||
GeglBuffer *output,
|
GeglBuffer *output,
|
||||||
|
@ -56,8 +56,9 @@ gimp_operation_lighten_only_mode_class_init (GimpOperationLightenOnlyModeClass *
|
|||||||
"description", "GIMP lighten only mode operation",
|
"description", "GIMP lighten only mode operation",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
point_class->process = gimp_operation_lighten_only_mode_process;
|
|
||||||
operation_class->prepare = gimp_operation_lighten_only_mode_prepare;
|
operation_class->prepare = gimp_operation_lighten_only_mode_prepare;
|
||||||
|
|
||||||
|
point_class->process = gimp_operation_lighten_only_mode_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -57,8 +57,9 @@ gimp_operation_overlay_mode_class_init (GimpOperationOverlayModeClass *klass)
|
|||||||
"description", "GIMP overlay mode operation",
|
"description", "GIMP overlay mode operation",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
point_class->process = gimp_operation_overlay_mode_process;
|
|
||||||
operation_class->prepare = gimp_operation_overlay_mode_prepare;
|
operation_class->prepare = gimp_operation_overlay_mode_prepare;
|
||||||
|
|
||||||
|
point_class->process = gimp_operation_overlay_mode_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -112,9 +112,7 @@ gimp_operation_point_filter_set_property (GObject *object,
|
|||||||
static void
|
static void
|
||||||
gimp_operation_point_filter_prepare (GeglOperation *operation)
|
gimp_operation_point_filter_prepare (GeglOperation *operation)
|
||||||
{
|
{
|
||||||
const Babl *format;
|
const Babl *format = babl_format ("R'G'B'A float");
|
||||||
|
|
||||||
format = babl_format ("R'G'B'A float");
|
|
||||||
|
|
||||||
gegl_operation_set_format (operation, "input", format);
|
gegl_operation_set_format (operation, "input", format);
|
||||||
gegl_operation_set_format (operation, "output", format);
|
gegl_operation_set_format (operation, "output", format);
|
||||||
|
@ -50,6 +50,7 @@ static void gimp_operation_shrink_set_property (GObject *object,
|
|||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
|
static void gimp_operation_shrink_prepare (GeglOperation *operation);
|
||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_shrink_get_required_for_output (GeglOperation *self,
|
gimp_operation_shrink_get_required_for_output (GeglOperation *self,
|
||||||
const gchar *input_pad,
|
const gchar *input_pad,
|
||||||
@ -57,7 +58,7 @@ gimp_operation_shrink_get_required_for_output (GeglOperation *self,
|
|||||||
static GeglRectangle
|
static GeglRectangle
|
||||||
gimp_operation_shrink_get_cached_region (GeglOperation *self,
|
gimp_operation_shrink_get_cached_region (GeglOperation *self,
|
||||||
const GeglRectangle *roi);
|
const GeglRectangle *roi);
|
||||||
static void gimp_operation_shrink_prepare (GeglOperation *operation);
|
|
||||||
static gboolean gimp_operation_shrink_process (GeglOperation *operation,
|
static gboolean gimp_operation_shrink_process (GeglOperation *operation,
|
||||||
GeglBuffer *input,
|
GeglBuffer *input,
|
||||||
GeglBuffer *output,
|
GeglBuffer *output,
|
||||||
|
@ -57,8 +57,9 @@ gimp_operation_softlight_mode_class_init (GimpOperationSoftlightModeClass *klass
|
|||||||
"description", "GIMP softlight mode operation",
|
"description", "GIMP softlight mode operation",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
point_class->process = gimp_operation_softlight_mode_process;
|
|
||||||
operation_class->prepare = gimp_operation_softlight_mode_prepare;
|
operation_class->prepare = gimp_operation_softlight_mode_prepare;
|
||||||
|
|
||||||
|
point_class->process = gimp_operation_softlight_mode_process;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user