app: code cleanup in the GEGL ops

This commit is contained in:
Michael Natterer
2012-04-21 00:46:48 +02:00
parent f0daec882f
commit 53bda86ceb
44 changed files with 288 additions and 281 deletions

View File

@ -30,7 +30,7 @@
#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_get_property (GObject *object,
guint property_id,
@ -40,6 +40,8 @@ static void gimp_operation_cage_coef_calc_set_property (GObject
guint property_id,
const GValue *value,
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 gboolean gimp_operation_cage_coef_calc_process (GeglOperation *operation,
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
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);
}
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
gimp_operation_cage_coef_calc_get_bounding_box (GeglOperation *operation)
{

View File

@ -57,8 +57,9 @@ gimp_operation_darken_only_mode_class_init (GimpOperationDarkenOnlyModeClass *kl
"description", "GIMP darken only mode operation",
NULL);
point_class->process = gimp_operation_darken_only_mode_process;
operation_class->prepare = gimp_operation_darken_only_mode_prepare;
point_class->process = gimp_operation_darken_only_mode_process;
}
static void

View File

@ -29,16 +29,11 @@
#include "gimpoperationdissolvemode.h"
G_DEFINE_TYPE (GimpOperationDissolveMode, gimp_operation_dissolve_mode,
GIMP_TYPE_OPERATION_POINT_LAYER_MODE)
#define RANDOM_TABLE_SIZE 4096
static gint32 random_table[RANDOM_TABLE_SIZE];
static void gimp_operation_dissolve_mode_prepare (
GeglOperation *operation);
static gboolean gimp_operation_dissolve_mode_process (
GeglOperation *operation,
static void gimp_operation_dissolve_mode_prepare (GeglOperation *operation);
static gboolean gimp_operation_dissolve_mode_process (GeglOperation *operation,
void *in_buf,
void *aux_buf,
void *out_buf,
@ -47,6 +42,12 @@ static gboolean gimp_operation_dissolve_mode_process (
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
gimp_operation_dissolve_mode_class_init (GimpOperationDissolveModeClass *klass)
{

View File

@ -49,6 +49,7 @@ static void gimp_operation_grow_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec);
static void gimp_operation_grow_prepare (GeglOperation *operation);
static GeglRectangle
gimp_operation_grow_get_required_for_output (GeglOperation *self,
const gchar *input_pad,
@ -56,7 +57,7 @@ gimp_operation_grow_get_required_for_output (GeglOperation *self,
static GeglRectangle
gimp_operation_grow_get_cached_region (GeglOperation *self,
const GeglRectangle *roi);
static void gimp_operation_grow_prepare (GeglOperation *operation);
static gboolean gimp_operation_grow_process (GeglOperation *operation,
GeglBuffer *input,
GeglBuffer *output,

View File

@ -56,8 +56,9 @@ gimp_operation_lighten_only_mode_class_init (GimpOperationLightenOnlyModeClass *
"description", "GIMP lighten only mode operation",
NULL);
point_class->process = gimp_operation_lighten_only_mode_process;
operation_class->prepare = gimp_operation_lighten_only_mode_prepare;
point_class->process = gimp_operation_lighten_only_mode_process;
}
static void

View File

@ -57,8 +57,9 @@ gimp_operation_overlay_mode_class_init (GimpOperationOverlayModeClass *klass)
"description", "GIMP overlay mode operation",
NULL);
point_class->process = gimp_operation_overlay_mode_process;
operation_class->prepare = gimp_operation_overlay_mode_prepare;
point_class->process = gimp_operation_overlay_mode_process;
}
static void

View File

@ -112,9 +112,7 @@ gimp_operation_point_filter_set_property (GObject *object,
static void
gimp_operation_point_filter_prepare (GeglOperation *operation)
{
const Babl *format;
format = babl_format ("R'G'B'A float");
const Babl *format = babl_format ("R'G'B'A float");
gegl_operation_set_format (operation, "input", format);
gegl_operation_set_format (operation, "output", format);

View File

@ -50,6 +50,7 @@ static void gimp_operation_shrink_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec);
static void gimp_operation_shrink_prepare (GeglOperation *operation);
static GeglRectangle
gimp_operation_shrink_get_required_for_output (GeglOperation *self,
const gchar *input_pad,
@ -57,7 +58,7 @@ gimp_operation_shrink_get_required_for_output (GeglOperation *self,
static GeglRectangle
gimp_operation_shrink_get_cached_region (GeglOperation *self,
const GeglRectangle *roi);
static void gimp_operation_shrink_prepare (GeglOperation *operation);
static gboolean gimp_operation_shrink_process (GeglOperation *operation,
GeglBuffer *input,
GeglBuffer *output,

View File

@ -57,8 +57,9 @@ gimp_operation_softlight_mode_class_init (GimpOperationSoftlightModeClass *klass
"description", "GIMP softlight mode operation",
NULL);
point_class->process = gimp_operation_softlight_mode_process;
operation_class->prepare = gimp_operation_softlight_mode_prepare;
point_class->process = gimp_operation_softlight_mode_process;
}
static void