[gegl] operations: port ops to gegl-op.h
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations: port ops to gegl-op.h
- Date: Tue, 20 May 2014 21:28:37 +0000 (UTC)
commit dfc204e0a2f59683d1d4066aece42910841bcc36
Author: Øyvind Kolås <pippin gimp org>
Date: Tue May 20 23:27:30 2014 +0200
operations: port ops to gegl-op.h
gegl/gegl-op.h | 8 ++-
operations/common/alien-map.c | 84 +++++++++++-------------
operations/common/antialias.c | 10 ++--
operations/common/apply-lens.c | 28 ++++----
operations/common/bilateral-filter-fast.c | 24 ++++----
operations/common/bilateral-filter.c | 28 +++++----
operations/common/box-blur.c | 25 ++++---
operations/common/buffer-sink.c | 16 ++--
operations/common/buffer-source.c | 34 +++++-----
operations/common/bump-map.c | 85 +++++++++++------------
operations/common/c2g.c | 46 +++++++------
operations/common/cartoon.c | 22 +++----
operations/common/channel-mixer.c | 96 +++++++++++++--------------
operations/common/color-reduction.c | 53 +++++++--------
operations/common/color-temperature.c | 66 ++++++++++---------
operations/common/color-to-alpha.c | 19 +++---
operations/common/contrast-curve.c | 23 ++++---
operations/common/deinterlace.c | 44 ++++++------
operations/common/difference-of-gaussians.c | 24 ++++---
operations/common/display.c | 24 ++++----
operations/common/dropshadow.c | 44 +++++++------
operations/common/edge-laplace.c | 10 ++--
operations/common/edge-sobel.c | 28 +++-----
operations/common/exp-combine.c | 34 +++++-----
operations/common/exposure.c | 34 +++++-----
operations/common/fattal02.c | 41 ++++++-----
operations/common/fractal-trace.c | 93 +++++++++++++-------------
operations/common/gegl-buffer-load-op.c | 33 +++++-----
operations/common/gegl-buffer-save-op.c | 15 ++--
operations/common/grey.c | 10 ++--
operations/common/high-pass.c | 24 ++++---
operations/common/image-compare.c | 32 ++++-----
32 files changed, 583 insertions(+), 574 deletions(-)
---
diff --git a/gegl/gegl-op.h b/gegl/gegl-op.h
index 8e405f5..0f4fde8 100644
--- a/gegl/gegl-op.h
+++ b/gegl/gegl-op.h
@@ -863,9 +863,11 @@ gegl_op_class_intern_init (gpointer klass)
#define property_curve(name, label, def_val) \
REGISTER_IF_ANY \
- }{ GParamSpec *pspec = \
- gegl_param_spec_curve (#name, label, NULL, flags);\
- current_prop = PROP_##name ;
+ }{ GeglCurve *_gegl_op_default_curve = gegl_curve_new_default (); \
+ GParamSpec *pspec = \
+ gegl_param_spec_curve (#name, label, NULL, _gegl_op_default_curve, flags);\
+ current_prop = PROP_##name ;\
+ g_object_unref (_gegl_op_default_curve);\
#define property_color(name, label, def_val) \
REGISTER_IF_ANY \
diff --git a/operations/common/alien-map.c b/operations/common/alien-map.c
index ff48d34..98a53c5 100644
--- a/operations/common/alien-map.c
+++ b/operations/common/alien-map.c
@@ -23,60 +23,52 @@
#include <glib/gi18n-lib.h>
#include <math.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_register_enum (gegl_alien_map_color_model)
+enum_start (gegl_alien_map_color_model)
enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_RGB, "RGB")
enum_value (GEGL_ALIEN_MAP_COLOR_MODEL_HSL, "HSL")
-gegl_chant_register_enum_end (GeglAlienMapColorModel)
-
-gegl_chant_enum (color_model, _("Color model"),
- GeglAlienMapColorModel,
- gegl_alien_map_color_model,
- GEGL_ALIEN_MAP_COLOR_MODEL_RGB,
- _("What color model used for the transformation"))
-
-gegl_chant_double (cpn_1_frequency, _("Component 1 frequency"),
- 0, 20, 1,
- _("Component 1 frequency"))
-gegl_chant_double (cpn_2_frequency, _("Component 2 frequency"),
- 0, 20, 1,
- _("Component 2 frequency"))
-gegl_chant_double (cpn_3_frequency, _("Component 3 frequency"),
- 0, 20, 1,
- _("Component 3 frequency"))
-
-gegl_chant_double (cpn_1_phaseshift, _("Component 1 phase shift"),
- 0, 360, 0,
- _("Component 1 phase shift"))
-gegl_chant_double (cpn_2_phaseshift, _("Component 2 phase shift"),
- 0, 360, 0,
- _("Component 2 phase shift"))
-gegl_chant_double (cpn_3_phaseshift, _("Component 3 phase shift"),
- 0, 360, 0,
- _("Component 3 phase shift"))
-
-gegl_chant_boolean (cpn_1_keep, _("Keep component 1"),
- FALSE,
- _("Keep component 1"))
-gegl_chant_boolean (cpn_2_keep, _("Keep component 2"),
- FALSE,
- _("Keep component 2"))
-gegl_chant_boolean (cpn_3_keep, _("Keep component 3"),
- FALSE,
- _("Keep component 3"))
+enum_end (GeglAlienMapColorModel)
+
+property_enum (color_model, _("Color model"),
+ GeglAlienMapColorModel, gegl_alien_map_color_model,
+ GEGL_ALIEN_MAP_COLOR_MODEL_RGB)
+ description (_("What color model used for the transformation"))
+
+property_double (cpn_1_frequency, _("Component 1 frequency"), 1)
+ value_range (0, 20)
+
+property_double (cpn_2_frequency, _("Component 2 frequency"), 1)
+ value_range (0, 20)
+
+property_double (cpn_3_frequency, _("Component 3 frequency"), 1)
+ value_range (0, 20)
+
+property_double (cpn_1_phaseshift, _("Component 1 phase shift"), 0)
+ value_range (0, 360)
+ ui_meta ("unit", "degree")
+property_double (cpn_2_phaseshift, _("Component 2 phase shift"), 0)
+ value_range (0, 360)
+ ui_meta ("unit", "degree")
+property_double (cpn_3_phaseshift, _("Component 3 phase shift"), 0)
+ value_range (0, 360)
+ ui_meta ("unit", "degree")
+
+property_boolean (cpn_1_keep, _("Keep component 1"), FALSE)
+property_boolean (cpn_2_keep, _("Keep component 2"), FALSE)
+property_boolean (cpn_3_keep, _("Keep component 3"), FALSE)
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "alien-map.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "alien-map.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void
prepare (GeglOperation *operation)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (o->color_model == GEGL_ALIEN_MAP_COLOR_MODEL_RGB)
{
@@ -102,7 +94,7 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
gfloat *in = in_buf;
gfloat *out = out_buf;
gfloat freq[3];
@@ -153,7 +145,7 @@ cl_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
cl_float3 freq;
cl_float3 phaseshift;
cl_int3 keep;
@@ -203,7 +195,7 @@ error:
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
diff --git a/operations/common/antialias.c b/operations/common/antialias.c
index 2a00dc8..f97191a 100644
--- a/operations/common/antialias.c
+++ b/operations/common/antialias.c
@@ -33,16 +33,16 @@
#include <glib/gi18n-lib.h>
#include <math.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
/* This operation has no properties */
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "antialias.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "antialias.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void
prepare (GeglOperation *operation)
@@ -260,7 +260,7 @@ process (GeglOperation *operation,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/apply-lens.c b/operations/common/apply-lens.c
index 1c4c863..58d5c52 100644
--- a/operations/common/apply-lens.c
+++ b/operations/common/apply-lens.c
@@ -26,25 +26,23 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double (refraction_index, _("Lens refraction index"),
- 1.0, 100.0, 1.7,
- _("Lens refraction index"))
+property_double (refraction_index, _("Lens refraction index"), 1.7)
+ value_range (1.0, 100.0)
-gegl_chant_boolean (keep_surroundings, _("Keep original surroundings"),
- FALSE,
- _("Keep image unchanged, where not affected by the lens."))
+property_boolean (keep_surroundings, _("Keep original surroundings"), FALSE)
+ description(_("Keep image unchanged, where not affected by the lens."))
+
+property_color (background_color, _("Background Color"), "none")
+ //ui_meta ("role", "color-secondary")
-gegl_chant_color (background_color, _("Background Color"),
- "none",
- _("Background Color (defaults to 'none')"))
#else
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "apply-lens.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "apply-lens.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
#include <stdio.h>
@@ -136,7 +134,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
const Babl *input_format = gegl_buffer_get_format (input);
const int bytes_per_pixel = babl_format_get_bytes_per_pixel (input_format);
@@ -269,7 +267,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/bilateral-filter-fast.c b/operations/common/bilateral-filter-fast.c
index d9458e8..d6197de 100644
--- a/operations/common/bilateral-filter-fast.c
+++ b/operations/common/bilateral-filter-fast.c
@@ -28,22 +28,22 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double (r_sigma, _("Smoothness"),
- 1, 100, 50,
- _("Level of smoothness"))
+property_double (r_sigma, _("Smoothness"), 50)
+ description(_("Level of smoothness"))
+ value_range (1, 100)
-gegl_chant_int (s_sigma, _("Blur radius"),
- 1, 100, 8,
- _("Radius of square pixel region, (width and height will be radius*2+1)."))
+property_int (s_sigma, _("Blur radius"), 8)
+ description(_("Radius of square pixel region, (width and height will be radius*2+1)."))
+ value_range (1, 100)
#else
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "bilateral-filter-fast.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "bilateral-filter-fast.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
inline static float lerp(float a, float b, float v)
@@ -100,7 +100,7 @@ bilateral_process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (gegl_operation_use_opencl (operation))
if (bilateral_cl_process (operation, input, output, result, o->s_sigma, o->r_sigma/100))
@@ -472,7 +472,7 @@ bilateral_cl_process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/bilateral-filter.c b/operations/common/bilateral-filter.c
index 416adb8..282b718 100644
--- a/operations/common/bilateral-filter.c
+++ b/operations/common/bilateral-filter.c
@@ -21,20 +21,24 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
+property_double (blur_radius, _("Blur radius"), 4.0)
+ description(_("Radius of square pixel region, (width and height will be radius*2+1)."))
+ value_range (0.0, 1000.0)
+ ui_range (0.0, 100.0)
+ ui_gamma (1.5)
-gegl_chant_double_ui (blur_radius, _("Blur radius"), 0.0, 1000.0, 4.0, 0.0, 100.0, 1.5,
- _("Radius of square pixel region, (width and height will be radius*2+1)."))
-gegl_chant_double (edge_preservation, _("Edge preservation"), 0.0, 100.0, 8.0,
- _("Amount of edge preservation"))
+property_double (edge_preservation, _("Edge preservation"), 8.0)
+ description (_("Amount of edge preservation"))
+ value_range (0.0, 100.0)
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "bilateral-filter.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "bilateral-filter.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
static void
@@ -50,7 +54,7 @@ bilateral_filter (GeglBuffer *src,
static void prepare (GeglOperation *operation)
{
GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
area->left = area->right = area->top = area->bottom = ceil (o->blur_radius);
gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));
@@ -117,7 +121,7 @@ cl_process (GeglOperation *operation,
gint err;
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,
result,
@@ -159,7 +163,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglRectangle compute;
if (o->blur_radius >= 1.0 && gegl_operation_use_opencl (operation))
@@ -266,7 +270,7 @@ bilateral_filter (GeglBuffer *src,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/box-blur.c b/operations/common/box-blur.c
index d512f85..d518723 100644
--- a/operations/common/box-blur.c
+++ b/operations/common/box-blur.c
@@ -20,17 +20,20 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_int_ui (radius, _("Radius"), 0, 1000, 4, 0, 100, 1.5,
- _("Radius of square pixel region, (width and height will be radius*2+1)"))
+property_int (radius, _("Radius"), 4)
+ description(_("Radius of square pixel region, (width and height will be radius*2+1)"))
+ value_range (0, 1000)
+ ui_range (0, 100)
+ ui_gamma (1.5)
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "box-blur.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "box-blur.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <stdio.h>
#include <math.h>
@@ -161,11 +164,11 @@ ver_blur (GeglBuffer *src,
static void prepare (GeglOperation *operation)
{
- GeglChantO *o;
+ GeglProperties *o;
GeglOperationAreaFilter *op_area;
op_area = GEGL_OPERATION_AREA_FILTER (operation);
- o = GEGL_CHANT_PROPERTIES (operation);
+ o = GEGL_PROPERTIES (operation);
op_area->left =
op_area->right =
@@ -285,7 +288,7 @@ cl_process (GeglOperation *operation,
gint err = 0;
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,
result,
@@ -339,7 +342,7 @@ process (GeglOperation *operation,
{
GeglRectangle rect;
GeglRectangle tmprect;
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBuffer *temp;
GeglOperationAreaFilter *op_area;
op_area = GEGL_OPERATION_AREA_FILTER (operation);
@@ -372,7 +375,7 @@ process (GeglOperation *operation,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/buffer-sink.c b/operations/common/buffer-sink.c
index 09e1a47..75d75bd 100644
--- a/operations/common/buffer-sink.c
+++ b/operations/common/buffer-sink.c
@@ -20,19 +20,19 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_pointer (buffer, _("Buffer location"),
+property_pointer (buffer, _("Buffer location"),
_("The location where to store the output GeglBuffer"))
-gegl_chant_pointer (format, _("babl format"),
+property_pointer (format, _("babl format"),
_("The babl format of the output GeglBuffer, NULL to use input buffer format"))
#else
-#define GEGL_CHANT_TYPE_SINK
-#define GEGL_CHANT_C_FILE "buffer-sink.c"
+#define GEGL_OP_SINK
+#define GEGL_OP_C_FILE "buffer-sink.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static gboolean
process (GeglOperation *operation,
@@ -40,7 +40,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (o->buffer != NULL &&
(o->format == NULL || o->format == gegl_buffer_get_format (input)))
@@ -66,7 +66,7 @@ process (GeglOperation *operation,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
diff --git a/operations/common/buffer-source.c b/operations/common/buffer-source.c
index aec8524..b419ed3 100644
--- a/operations/common/buffer-source.c
+++ b/operations/common/buffer-source.c
@@ -20,17 +20,17 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_object(buffer, _("Input buffer"),
- _("The GeglBuffer to load into the pipeline"))
+property_object(buffer, _("Input buffer"), GEGL_TYPE_BUFFER)
+ description (_("The GeglBuffer to load into the pipeline"))
#else
-#define GEGL_CHANT_TYPE_SOURCE
-#define GEGL_CHANT_C_FILE "buffer-source.c"
+#define GEGL_OP_SOURCE
+#define GEGL_OP_C_FILE "buffer-source.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
typedef struct
{
@@ -38,12 +38,12 @@ typedef struct
} Priv;
static Priv *
-get_priv (GeglChantO *o)
+get_priv (GeglProperties *o)
{
- Priv *priv = (Priv*)o->chant_data;
+ Priv *priv = (Priv*)o->user_data;
if (priv == NULL) {
priv = g_new0 (Priv, 1);
- o->chant_data = (void*) priv;
+ o->user_data = (void*) priv;
priv->buffer_changed_handler = 0;
}
@@ -62,7 +62,7 @@ static void
gegl_buffer_source_prepare (GeglOperation *operation)
{
const Babl *format = NULL;
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (o->buffer)
format = gegl_buffer_get_format (GEGL_BUFFER (o->buffer));
@@ -74,7 +74,7 @@ static GeglRectangle
get_bounding_box (GeglOperation *operation)
{
GeglRectangle result = {0,0,0,0};
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (!o->buffer)
{
@@ -91,7 +91,7 @@ my_set_property (GObject *gobject,
GParamSpec *pspec)
{
GeglOperation *operation = GEGL_OPERATION (gobject);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
Priv *p = get_priv(o);
GObject *buffer = NULL;
@@ -124,7 +124,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (o->buffer)
{
@@ -147,7 +147,7 @@ process (GeglOperation *operation,
static void
dispose (GObject *object)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (object);
+ GeglProperties *o = GEGL_PROPERTIES (object);
Priv *p = get_priv(o);
if (o->buffer)
@@ -161,15 +161,15 @@ dispose (GObject *object)
if (p) {
g_free(p);
- o->chant_data = NULL;
+ o->user_data = NULL;
}
- G_OBJECT_CLASS (gegl_chant_parent_class)->dispose (object);
+ G_OBJECT_CLASS (gegl_op_parent_class)->dispose (object);
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
diff --git a/operations/common/bump-map.c b/operations/common/bump-map.c
index 31c87cc..d8f4898 100644
--- a/operations/common/bump-map.c
+++ b/operations/common/bump-map.c
@@ -34,65 +34,62 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_register_enum (gegl_bump_map_type)
+enum_start (gegl_bump_map_type)
enum_value (GEGL_BUMP_MAP_TYPE_LINEAR, "Linear")
enum_value (GEGL_BUMP_MAP_TYPE_SPHERICAL, "Cosinus")
enum_value (GEGL_BUMP_MAP_TYPE_SINUSOIDAL, "Sinusoidal")
-gegl_chant_register_enum_end (GeglBumpMapType)
+enum_end (GeglBumpMapType)
-gegl_chant_enum (type, _("Type"),
- GeglBumpMapType, gegl_bump_map_type,
- GEGL_BUMP_MAP_TYPE_LINEAR,
- _("Type of map"))
+property_enum (type, _("Type"), GeglBumpMapType, gegl_bump_map_type,
+ GEGL_BUMP_MAP_TYPE_LINEAR)
+ description (_("Type of map"))
-gegl_chant_boolean (compensate, _("Compensate"),
- TRUE,
- _("Compensate for darkening"))
+property_boolean (compensate, _("Compensate"), TRUE)
+ description (_("Compensate for darkening"))
-gegl_chant_boolean (invert, _("Invert"),
- FALSE,
- _("Invert bumpmap"))
+property_boolean (invert, _("Invert"), FALSE)
+ description (_("Invert bumpmap"))
-gegl_chant_boolean (tiled, _("Tiled"),
- FALSE,
- _("Tiled bumpmap"))
+property_boolean (tiled, _("Tiled"), FALSE)
+ description (_("Tiled bumpmap"))
-gegl_chant_double (azimuth, _("Azimuth"),
- 0.0, 360.0, 135.0,
- _("Azimuth"))
+property_double (azimuth, _("Azimuth"), 135.0)
+ value_range (0.0, 360.0)
+ ui_meta ("unit", "degree")
-gegl_chant_double (elevation, _("Elevation"),
- 0.0, 360.0, 45.0,
- _("Elevation"))
+property_double (elevation, _("Elevation"), 45.0)
+ value_range (0.0, 360.0)
-gegl_chant_double (depth, _("Depth"),
- 0.0005, 100, 0.005,
- _("Depth"))
+property_double (depth, _("Depth"), 0.005)
+ value_range (0.0005, 100)
-gegl_chant_int_ui (offset_x, _("Offset X"),
- -20000, 20000,0, -1000.0, 1000.0, 1.0,
- NULL)
+property_int (offset_x, _("Offset X"), -1000.0)
+ value_range (-20000, 20000)
+ ui_range (-1000.0, 1000.0)
+ ui_meta ("axis", "x")
+ ui_meta ("unit", "pixel-coordinate")
-gegl_chant_int_ui (offset_y, _("Offset Y"),
- -20000, 20000,0, -1000.0, 1000.0, 1.0,
- NULL)
+property_int (offset_y, _("Offset Y"), -1000.0)
+ value_range (-20000, 20000)
+ ui_range (-1000.0, 1000.0)
+ ui_meta ("axis", "y")
+ ui_meta ("unit", "pixel-coordinate")
-gegl_chant_double (waterlevel, _("Waterlevel"),
- 0.0,1.0,0.0,
- _("Level that full transparency should represent"))
+property_double (waterlevel, _("Waterlevel"), 0.0)
+ description(_("Level that full transparency should represent"))
+ value_range (0.0, 1.0)
-gegl_chant_double (ambient, _("Ambient"),
- 0.0, 1.0, 0.0,
- _("Ambient lighting factor"))
+property_double (ambient, _("Ambient lighting factor"), 0.0)
+ value_range (0.0, 1.0)
#else
-#define GEGL_CHANT_TYPE_COMPOSER
-#define GEGL_CHANT_C_FILE "bump-map.c"
+#define GEGL_OP_COMPOSER
+#define GEGL_OP_C_FILE "bump-map.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
/***** Macros *****/
@@ -114,7 +111,7 @@ typedef struct
} bumpmap_params_t;
static void
-bumpmap_setup_calc (GeglChantO *o,
+bumpmap_setup_calc (GeglProperties *o,
bumpmap_params_t *params)
{
/* Convert to radians */
@@ -180,7 +177,7 @@ bumpmap_row (const gfloat *src,
gint bm_width,
gint bm_xofs,
gboolean row_in_bumpmap,
- GeglChantO *o,
+ GeglProperties *o,
bumpmap_params_t *params)
{
gint xofs1, xofs2, xofs3;
@@ -298,7 +295,7 @@ process (GeglOperation *operation,
const GeglRectangle *rect,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gfloat *src_buf, *dst_buf, *bm_row1, *bm_row2, *bm_row3, *src_row, *dest_row, *bm_tmprow;
const Babl *format = gegl_operation_get_format (operation, "output");
gint channels = babl_format_get_n_components (format);
@@ -459,7 +456,7 @@ get_bounding_box (GeglOperation *self)
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationComposerClass *composer_class;
diff --git a/operations/common/c2g.c b/operations/common/c2g.c
index 66438a8..263b8ff 100644
--- a/operations/common/c2g.c
+++ b/operations/common/c2g.c
@@ -22,34 +22,38 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_int_ui (radius, _("Radius"),
- 2, 3000, 300, 2, 3000, 1.6,
- _("Neighborhood taken into account, this is the radius "
+property_int (radius, _("Radius"), 300)
+ description(_("Neighborhood taken into account, this is the radius "
"in pixels taken into account when deciding which "
"colors map to which gray values"))
-
-gegl_chant_int_ui (samples, _("Samples"),
- 1, 1000, 4, 1, 20, 1.0,
- _("Number of samples to do per iteration looking for "
- "the range of colors"))
-
-gegl_chant_int_ui (iterations, _("Iterations"),
- 1, 1000, 10, 1, 20, 1.0,
- _("Number of iterations, a higher number of iterations "
+ value_range (2, 3000)
+ ui_range (2, 1000)
+ ui_gamma (1.6)
+ ui_meta ("unit", "pixel-distance")
+
+property_int (samples, _("Samples"), 4)
+ description (_("Number of samples to do per iteration looking for the range of colors"))
+ value_range (1, 1000)
+ ui_range (1, 20)
+
+property_int (iterations, _("Iterations"), 10)
+ description(_("Number of iterations, a higher number of iterations "
"provides less noisy results at a computational cost"))
+ value_range (1, 1000)
+ ui_range (1, 20)
/*
-gegl_chant_double (rgamma, _("Radial Gamma"), 0.0, 8.0, 2.0,
+property_double (rgamma, _("Radial Gamma"), 0.0, 8.0, 2.0,
_("Gamma applied to radial distribution"))
*/
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "c2g.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "c2g.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
#include <stdlib.h>
#include "envelopes.h"
@@ -141,7 +145,7 @@ static void prepare (GeglOperation *operation)
{
GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
area->left = area->right = area->top = area->bottom =
- ceil (GEGL_CHANT_PROPERTIES (operation)->radius);
+ ceil (GEGL_PROPERTIES (operation)->radius);
gegl_operation_set_format (operation, "input", babl_format ("RGBA float"));
gegl_operation_set_format (operation, "output", babl_format ("YA float"));
@@ -273,7 +277,7 @@ cl_process (GeglOperation *operation,
gint err;
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,
result,
@@ -318,7 +322,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglRectangle compute;
compute = gegl_operation_get_required_for_output (operation, "input",result);
@@ -337,7 +341,7 @@ process (GeglOperation *operation,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/cartoon.c b/operations/common/cartoon.c
index 3bb751c..aa18011 100644
--- a/operations/common/cartoon.c
+++ b/operations/common/cartoon.c
@@ -20,22 +20,20 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double (mask_radius, _("Mask radius"),
- 0.0, 50.0, 7.0,
- _("Mask radius"))
+property_double (mask_radius, _("Mask radius"), 7.0)
+ value_range (0.0, 50.0)
-gegl_chant_double (pct_black, _("Percent black"),
- 0.0, 1.0, 0.2,
- _("Percent black"))
+property_double (pct_black, _("Percent black"), 0.2)
+ value_range (0.0, 1.0)
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "cartoon.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "cartoon.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@@ -217,7 +215,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBufferIterator *iter;
GeglBuffer *dest1;
GeglBuffer *dest2;
@@ -300,7 +298,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/channel-mixer.c b/operations/common/channel-mixer.c
index cfa7858..3d12ea1 100644
--- a/operations/common/channel-mixer.c
+++ b/operations/common/channel-mixer.c
@@ -31,58 +31,56 @@
#include <glib/gi18n-lib.h>
#include <math.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_boolean (monochrome, _("Monochrome"),
- FALSE,
- _("Monochrome"))
+property_boolean (monochrome, _("Monochrome"), FALSE)
-gegl_chant_boolean (preserve_luminosity, _("Preserve Luminosity"),
- FALSE,
- _("Preserve Luminosity"))
+property_boolean (preserve_luminosity, _("Preserve Luminosity"), FALSE)
-gegl_chant_double (rr_gain, _("Red Red Gain"),
- -2.0, +2.0, 1.0,
- _("Set the red gain for the red channel"))
+property_double (rr_gain, _("Red Red Gain"), 1.0)
+ description(_("Set the red gain for the red channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (rg_gain, _("Red Green Gain"),
- -2.0, +2.0, 0.0,
- _("Set the green gain for the red channel"))
+property_double (rg_gain, _("Red Green Gain"), 0.0)
+ description(_("Set the green gain for the red channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (rb_gain, _("Red Blue Gain"),
- -2.0, +2.0, 0.0,
- _("Set the blue gain for the red channel"))
+property_double (rb_gain, _("Blue Gain"), 0.0)
+ description(_("Set the blue gain for the red channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (gr_gain, _("Green Red Gain"),
- -2.0, +2.0, 0.0,
- _("Set the red gain for the green channel"))
+property_double (gr_gain, _("Green Red Gain"), 0.0)
+ description(_("Set the red gain for the green channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (gg_gain, _("Green Green Gain"),
- -2.0, +2.0, 1.0,
- _("Set the green gain for the green channel"))
+property_double (gg_gain, _("Green Green Gain"), 1.0)
+ description(_("Set the green gain for the green channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (gb_gain, _("Green Blue Gain"),
- -2.0, +2.0, 0.0,
- _("Set the blue gain for the green channel"))
+property_double (gb_gain, _("Green Blue Gain"), 0.0)
+ description(_("Set the blue gain for the green channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (br_gain, _("Blue Red Gain"),
- -2.0, +2.0, 0.0,
- _("Set the red gain for the blue channel"))
-gegl_chant_double (bg_gain, _("Blue Green Gain"),
- -2.0, +2.0, 0.0,
- _("Set the green gain for the blue channel"))
+property_double (br_gain, _("Blue Red Gain"), 0.0)
+ description(_("Set the red gain for the green channel"))
+ value_range (-2.0, 2.0)
+
+property_double (bg_gain, _("Blue Green Gain"), 0.0)
+ description(_("Set the green gain for the green channel"))
+ value_range (-2.0, 2.0)
+
+property_double (bb_gain, _("Blue Blue Gain"), 1.0)
+ description(_("Set the blue gain for the green channel"))
+ value_range (-2.0, 2.0)
-gegl_chant_double (bb_gain, _("Blue Blue Gain"),
- -2.0, +2.0, 1.0,
- _("Set the blue gain for the blue channel"))
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "channel-mixer.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "channel-mixer.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
typedef enum
{
@@ -113,14 +111,14 @@ typedef struct
static void prepare (GeglOperation *operation)
{
const Babl *input_format = gegl_operation_get_source_format (operation, "input");
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
CmParamsType *mix;
const Babl *format;
- if (o->chant_data == NULL)
- o->chant_data = g_slice_new0 (CmParamsType);
+ if (o->user_data == NULL)
+ o->user_data = g_slice_new0 (CmParamsType);
- mix = (CmParamsType*) o->chant_data;
+ mix = (CmParamsType*) o->user_data;
mix->monochrome = o->monochrome;
mix->preserve_luminosity = o->preserve_luminosity;
@@ -164,15 +162,15 @@ static void prepare (GeglOperation *operation)
static void finalize (GObject *object)
{
GeglOperation *op = (void*) object;
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
- if (o->chant_data)
+ if (o->user_data)
{
- g_slice_free (CmParamsType, o->chant_data);
- o->chant_data = NULL;
+ g_slice_free (CmParamsType, o->user_data);
+ o->user_data = NULL;
}
- G_OBJECT_CLASS (gegl_chant_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gegl_op_parent_class)->finalize (object);
}
static gdouble
@@ -231,8 +229,8 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
- CmParamsType *mix = (CmParamsType*) o->chant_data;
+ GeglProperties *o = GEGL_PROPERTIES (op);
+ CmParamsType *mix = (CmParamsType*) o->user_data;
gdouble red_norm, green_norm, blue_norm, black_norm;
gfloat *in, *out;
@@ -276,7 +274,7 @@ process (GeglOperation *op,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
diff --git a/operations/common/color-reduction.c b/operations/common/color-reduction.c
index 7923f5c..1325c6f 100644
--- a/operations/common/color-reduction.c
+++ b/operations/common/color-reduction.c
@@ -21,46 +21,45 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_register_enum (gegl_dither_strategy)
+enum_start (gegl_dither_strategy)
enum_value (GEGL_DITHER_NONE, "None")
enum_value (GEGL_DITHER_RANDOM, "Random")
enum_value (GEGL_DITHER_RESILIENT, "Resilient")
enum_value (GEGL_DITHER_RANDOM_COVARIANT, "Random Covariant")
enum_value (GEGL_DITHER_BAYER, "Bayer")
enum_value (GEGL_DITHER_FLOYD_STEINBERG, "Floyd-Steinberg")
-gegl_chant_register_enum_end (GeglDitherStrategy)
+enum_end (GeglDitherStrategy)
-gegl_chant_int (red_bits, _("Red bits"),
- 1, 16, 8,
- _("Number of bits for red channel"))
+property_int (red_bits, _("Red bits"), 8)
+ description(_("Number of bits for red channel"))
+ value_range (1, 16)
-gegl_chant_int (green_bits, _("Green bits"),
- 1, 16, 8,
- _("Number of bits for green channel"))
+property_int (green_bits, _("Green bits"), 8)
+ description(_("Number of bits for green channel"))
+ value_range (1, 16)
-gegl_chant_int (blue_bits, _("Blue bits"),
- 1, 16, 8,
- _("Number of bits for blue channel"))
+property_int (blue_bits, _("Blue bits"), 8)
+ description(_("Number of bits for blue channel"))
+ value_range (1, 16)
-gegl_chant_int (alpha_bits, _("Alpha bits"),
- 1, 16, 8,
- _("Number of bits for alpha channel"))
+property_int (alpha_bits, _("Alpha bits"), 8)
+ description(_("Number of bits for alpha channel"))
+ value_range (1, 16)
-gegl_chant_enum (dither_strategy, _("Dithering Strategy"),
- GeglDitherStrategy, gegl_dither_strategy, GEGL_DITHER_RESILIENT,
- _("The dithering strategy to use"))
+property_enum (dither_strategy, _("Dithering Strategy"),
+ GeglDitherStrategy, gegl_dither_strategy, GEGL_DITHER_RESILIENT)
+ description (_("The dithering strategy to use"))
-gegl_chant_seed (seed, rand, _("Random seed"),
- NULL)
+property_seed (seed, _("Random seed"), rand)
#else
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "color-reduction.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "color-reduction.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#define REDUCE_16B(value) (((value) & ((1 << 17) - 1)) - 65536)
@@ -430,7 +429,7 @@ get_required_for_output (GeglOperation *self,
const gchar *input_pad,
const GeglRectangle *roi)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (self);
+ GeglProperties *o = GEGL_PROPERTIES (self);
if (o->dither_strategy == GEGL_DITHER_FLOYD_STEINBERG)
return *gegl_operation_source_get_bounding_box (self, "input");
@@ -442,7 +441,7 @@ static GeglRectangle
get_cached_region (GeglOperation *self,
const GeglRectangle *roi)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (self);
+ GeglProperties *o = GEGL_PROPERTIES (self);
if (o->dither_strategy == GEGL_DITHER_FLOYD_STEINBERG)
return *gegl_operation_source_get_bounding_box (self, "input");
@@ -457,7 +456,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
guint channel_bits [4];
channel_bits [0] = o->red_bits;
@@ -475,7 +474,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/color-temperature.c b/operations/common/color-temperature.c
index 068dff9..f0f2d6d 100644
--- a/operations/common/color-temperature.c
+++ b/operations/common/color-temperature.c
@@ -22,24 +22,26 @@
#define LOWEST_TEMPERATURE 1000
#define HIGHEST_TEMPERATURE 12000
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double (original_temperature, _("Original temperature"),
- LOWEST_TEMPERATURE, HIGHEST_TEMPERATURE, 6500,
- _("Estimated temperature of the light source in Kelvin "
- "the image was taken with."))
+property_double (original_temperature, _("Original temperature"), 6500)
+ description(_("Estimated temperature of the light source in Kelvin "
+ "the image was taken with."))
+ value_range (LOWEST_TEMPERATURE, HIGHEST_TEMPERATURE)
+ ui_meta ("unit", "kelvin")
-gegl_chant_double (intended_temperature, _("Intended temperature"),
- LOWEST_TEMPERATURE, HIGHEST_TEMPERATURE, 6500,
- _("Corrected estimation of the temperature of the light "
- "source in Kelvin."))
+property_double (intended_temperature, _("Intended temperature"), 6500)
+ description(_("Corrected estimation of the temperature of the light "
+ "source in Kelvin."))
+ value_range (LOWEST_TEMPERATURE, HIGHEST_TEMPERATURE)
+ ui_meta ("unit", "kelvin")
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "color-temperature.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "color-temperature.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static const gfloat rgb_r55[3][12];
@@ -88,15 +90,15 @@ static void prepare (GeglOperation *operation)
static void
finalize (GObject *object)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (object);
+ GeglProperties *o = GEGL_PROPERTIES (object);
- if (o->chant_data)
+ if (o->user_data)
{
- g_free (o->chant_data);
- o->chant_data = NULL;
+ g_free (o->user_data);
+ o->user_data = NULL;
}
- G_OBJECT_CLASS (gegl_chant_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gegl_op_parent_class)->finalize (object);
}
static void
@@ -106,25 +108,25 @@ notify (GObject *object,
if (strcmp (pspec->name, "original-temperature") == 0 ||
strcmp (pspec->name, "intended-temperature") == 0)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (object);
+ GeglProperties *o = GEGL_PROPERTIES (object);
/* one of the properties has changed,
* invalidate the preprocessed coefficients
*/
- if (o->chant_data)
+ if (o->user_data)
{
- g_free (o->chant_data);
- o->chant_data = NULL;
+ g_free (o->user_data);
+ o->user_data = NULL;
}
}
- if (G_OBJECT_CLASS (gegl_chant_parent_class)->notify)
- G_OBJECT_CLASS (gegl_chant_parent_class)->notify (object, pspec);
+ if (G_OBJECT_CLASS (gegl_op_parent_class)->notify)
+ G_OBJECT_CLASS (gegl_op_parent_class)->notify (object, pspec);
}
static gfloat *
-preprocess (GeglChantO *o)
+preprocess (GeglProperties *o)
{
gfloat *coeffs = g_new (gfloat, 3);
gfloat original_temperature_rgb[3];
@@ -151,17 +153,17 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
gfloat *in_pixel = in_buf;
gfloat *out_pixel = out_buf;
- const gfloat *coeffs = o->chant_data;
+ const gfloat *coeffs = o->user_data;
in_pixel = in_buf;
out_pixel = out_buf;
if (! coeffs)
{
- coeffs = o->chant_data = preprocess (o);
+ coeffs = o->user_data = preprocess (o);
}
while (n_pixels--)
@@ -192,18 +194,18 @@ cl_process (GeglOperation *op,
const GeglRectangle *roi,
int level)
{
- /* Retrieve a pointer to GeglChantO structure which contains all the
+ /* Retrieve a pointer to GeglProperties structure which contains all the
* chanted properties
*/
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
- const gfloat *coeffs = o->chant_data;
+ GeglProperties *o = GEGL_PROPERTIES (op);
+ const gfloat *coeffs = o->user_data;
cl_int cl_err = 0;
if (! coeffs)
{
- coeffs = o->chant_data = preprocess (o);
+ coeffs = o->user_data = preprocess (o);
}
if (!cl_data)
@@ -240,7 +242,7 @@ error:
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GObjectClass *object_class;
GeglOperationClass *operation_class;
diff --git a/operations/common/color-to-alpha.c b/operations/common/color-to-alpha.c
index a8a5904..14c70ff 100644
--- a/operations/common/color-to-alpha.c
+++ b/operations/common/color-to-alpha.c
@@ -23,18 +23,17 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_color (color, _("Color"),
- "white",
- _("The color to render (defaults to 'white')"))
+property_color (color, _("Color"), "white")
+ description(_("The color to render (defaults to, and works best with, 'white')"))
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "color-to-alpha.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "color-to-alpha.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <stdio.h>
#include <math.h>
@@ -143,7 +142,7 @@ cl_process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gfloat color[4];
gegl_color_get_pixel (o->color, babl_format ("R'G'B'A float"), color);
@@ -192,7 +191,7 @@ process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
const Babl *format = babl_format ("R'G'B'A float");
gfloat color[4];
gint x;
@@ -213,7 +212,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *filter_class;
diff --git a/operations/common/contrast-curve.c b/operations/common/contrast-curve.c
index 040cbde..a7ce436 100644
--- a/operations/common/contrast-curve.c
+++ b/operations/common/contrast-curve.c
@@ -20,18 +20,21 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_int (sampling_points, _("Sample points"), 0, 65536, 0,
- _("Number of curve sampling points. 0 for exact calculation."))
-gegl_chant_curve (curve, _("Curve"), _("The contrast curve."))
+property_int (sampling_points, _("Sample points"), 0)
+ description (_("Number of curve sampling points. 0 for exact calculation."))
+ value_range (0, 65536)
+
+property_curve (curve, _("Curve"), NULL)
+ description (_("The contrast curve."))
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "contrast-curve.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "contrast-curve.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
@@ -69,7 +72,7 @@ cl_process (GeglOperation *self,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (self);
+ GeglProperties *o = GEGL_PROPERTIES (self);
gint num_sampling_points;
gdouble *xs, *ys;
gfloat *ysf = NULL;
@@ -177,7 +180,7 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
gint num_sampling_points;
GeglCurve *curve;
gint i;
@@ -235,7 +238,7 @@ process (GeglOperation *op,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
diff --git a/operations/common/deinterlace.c b/operations/common/deinterlace.c
index 7e49ea6..01643f5 100644
--- a/operations/common/deinterlace.c
+++ b/operations/common/deinterlace.c
@@ -25,38 +25,38 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_register_enum (gegl_deinterlace_keep)
+enum_start (gegl_deinterlace_keep)
enum_value (GEGL_DEINTERLACE_KEEP_EVEN, "Keep even fields")
enum_value (GEGL_DEINTERLACE_KEEP_ODD, "Keep odd fields")
-gegl_chant_register_enum_end (GeglDeinterlaceKeep)
+enum_end (GeglDeinterlaceKeep)
-gegl_chant_register_enum (gegl_orientation)
+enum_start (gegl_orientation)
enum_value (GEGL_ORIENTATION_HORIZONTAL, "Horizontal")
enum_value (GEGL_ORIENTATION_VERTICAL, "Vertical")
-gegl_chant_register_enum_end (GeglOrientation)
+enum_end (GeglOrientation)
-gegl_chant_enum (keep, _("Keep"),
- GeglDeinterlaceKeep, gegl_deinterlace_keep,
- GEGL_DEINTERLACE_KEEP_EVEN,
- _("Keep even or odd fields"))
+property_enum (keep, _("Keep"),
+ GeglDeinterlaceKeep, gegl_deinterlace_keep,
+ GEGL_DEINTERLACE_KEEP_EVEN)
+ description(_("Keep even or odd fields"))
-gegl_chant_enum (orientation, _("Orientation"),
- GeglOrientation, gegl_orientation,
- GEGL_ORIENTATION_HORIZONTAL,
- _("Deinterlace horizontally or vertically"))
+property_enum (orientation, _("Orientation"),
+ GeglOrientation, gegl_orientation,
+ GEGL_ORIENTATION_HORIZONTAL)
+ description(_("Deinterlace horizontally or vertically"))
-gegl_chant_int (size, _("Block size"),
- 0, 100, 1,
- _("Block size of deinterlacing rows/columns"))
+property_int (size, _("Block size"), 1)
+ value_range (0, 100)
+ description (_("Block size of deinterlacing rows/columns"))
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "deinterlace.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "deinterlace.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <stdio.h>
#include <math.h>
@@ -64,7 +64,7 @@ static void
prepare (GeglOperation *operation)
{
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
if (o->orientation == GEGL_ORIENTATION_HORIZONTAL)
{
@@ -240,7 +240,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
const Babl *format = babl_format ("RGBA float");
GeglRectangle rect;
@@ -318,7 +318,7 @@ get_required_for_output (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/difference-of-gaussians.c b/operations/common/difference-of-gaussians.c
index c81c3a1..299820f 100644
--- a/operations/common/difference-of-gaussians.c
+++ b/operations/common/difference-of-gaussians.c
@@ -19,22 +19,24 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double_ui (radius1, _("Radius 1"),
- 0.0, 1000.0, 1.0, 0.0, 10.0, 1.5,
- _("Radius"))
+property_double (radius1, _("Radius 1"), 1.0)
+ value_range (0.0, 1000.0)
+ ui_range (0.0, 10.0)
+ ui_gamma (1.5)
-gegl_chant_double_ui (radius2, _("Radius 2"),
- 0.0, 1000.0, 2.0, 0.0, 10.0, 1.5,
- _("Radius"))
+property_double (radius2, _("Radius 2"), 2.0)
+ value_range (0.0, 1000.0)
+ ui_range (0.0, 20.0)
+ ui_gamma (1.5)
#else
-#define GEGL_CHANT_TYPE_META
-#define GEGL_CHANT_C_FILE "difference-of-gaussians.c"
+#define GEGL_OP_META
+#define GEGL_OP_C_FILE "difference-of-gaussians.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void attach (GeglOperation *operation)
{
@@ -70,7 +72,7 @@ static void attach (GeglOperation *operation)
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
diff --git a/operations/common/display.c b/operations/common/display.c
index b46c6f5..489cf8a 100644
--- a/operations/common/display.c
+++ b/operations/common/display.c
@@ -19,12 +19,12 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
-gegl_chant_string (window_title, _(""), "window_title",
- _("Title to be given to output window"))
+#ifdef GEGL_PROPERTIES
+property_string (window_title, _(""), "window_title")
+ description(_("Title to be given to output window"))
#else
-#define GEGL_CHANT_C_FILE "display.c"
+#define GEGL_OP_C_FILE "display.c"
#include "gegl-plugin.h"
@@ -33,7 +33,7 @@ gegl_chant_string (window_title, _(""), "window_title",
* Will use one of several well-known display operations
* to actually display the output. */
-struct _GeglChant
+struct _GeglOp
{
GeglOperationSink parent_instance;
gpointer properties;
@@ -45,18 +45,18 @@ struct _GeglChant
typedef struct
{
GeglOperationSinkClass parent_class;
-} GeglChantClass;
+} GeglOpClass;
-#include "gegl-chant.h"
+#include "gegl-op.h"
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_SINK)
/* Set the correct display handler operation. */
static void
set_display_handler (GeglOperation *operation)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
- GeglChant *self = GEGL_CHANT (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
+ GeglOp *self = GEGL_OP (operation);
const gchar *known_handlers[] = {"gegl-gtk3:display",
"gegl-gtk2:display",
"gegl:sdl-display"};
@@ -94,7 +94,7 @@ set_display_handler (GeglOperation *operation)
static void
attach (GeglOperation *operation)
{
- GeglChant *self = GEGL_CHANT (operation);
+ GeglOp *self = GEGL_OP (operation);
g_assert (!self->input);
g_assert (!self->display);
@@ -117,14 +117,14 @@ process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
- GeglChant *self = GEGL_CHANT (operation);
+ GeglOp *self = GEGL_OP (operation);
return gegl_operation_process (gegl_node_get_gegl_operation (self->display),
context, output_pad, roi, level);
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
GeglOperationSinkClass *sink_class = GEGL_OPERATION_SINK_CLASS (klass);
diff --git a/operations/common/dropshadow.c b/operations/common/dropshadow.c
index 0383535..b9b9b35 100644
--- a/operations/common/dropshadow.c
+++ b/operations/common/dropshadow.c
@@ -20,37 +20,41 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double_ui (x, _("X"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, -20.0, 20.0, 1.0,
- _("Horizontal shadow offset"))
+property_double (x, _("X"), 20.0)
+ description (_("Horizontal shadow offset"))
+ ui_range (-40.0, 40.0)
+ ui_meta ("unit", "pixel-coordinate")
+ ui_meta ("axis", "x")
-gegl_chant_double_ui (y, _("Y"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 20.0, -20.0, 20.0, 1.0,
- _("Vertical shadow offset"))
+property_double (y, _("Y"), 20.0)
+ description (_("Vertical shadow offset"))
+ ui_range (-40.0, 40.0)
+ ui_meta ("unit", "pixel-coordinate")
+ ui_meta ("axis", "y")
-gegl_chant_double_ui (radius, _("Radius"),
- 0.0, G_MAXDOUBLE, 10.0, 0.0, 300.0, 1.5,
- _("Blur radius"))
+property_double (radius, _("Blur radius"), 10.0)
+ value_range (0.0, G_MAXDOUBLE)
+ ui_range (0.0, 300.0)
+ ui_gamma (1.5)
+ ui_meta ("unit", "pixel-distance")
-gegl_chant_color (color, _("Color"),
- "black",
- _("The shadow's color (defaults to 'black')"))
+property_color (color, _("Color"), "black")
+ description (_("The shadow's color (defaults to 'black')"))
/* It does make sense to sometimes have opacities > 1 (see GEGL logo
* for example)
*/
-gegl_chant_double (opacity, _("Opacity"),
- 0.0, 2.0, 0.5,
- _("Opacity"))
+property_double (opacity, _("Opacity"), 0.5)
+ value_range (0.0, 2.0)
#else
-#define GEGL_CHANT_TYPE_META
-#define GEGL_CHANT_C_FILE "dropshadow.c"
+#define GEGL_OP_META
+#define GEGL_OP_C_FILE "dropshadow.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
/* in attach we hook into graph adding the needed nodes */
static void
@@ -91,7 +95,7 @@ attach (GeglOperation *operation)
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class = GEGL_OPERATION_CLASS (klass);
diff --git a/operations/common/edge-laplace.c b/operations/common/edge-laplace.c
index e5df6b6..52e01cd 100644
--- a/operations/common/edge-laplace.c
+++ b/operations/common/edge-laplace.c
@@ -24,14 +24,14 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "edge-laplace.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "edge-laplace.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
#define LAPLACE_RADIUS 2
@@ -388,7 +388,7 @@ cl_process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/edge-sobel.c b/operations/common/edge-sobel.c
index 8c76866..a4bf97a 100644
--- a/operations/common/edge-sobel.c
+++ b/operations/common/edge-sobel.c
@@ -22,26 +22,20 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_boolean (horizontal, _("Horizontal"),
- TRUE,
- _("Horizontal"))
+property_boolean (horizontal, _("Horizontal"), TRUE)
-gegl_chant_boolean (vertical, _("Vertical"),
- TRUE,
- _("Vertical"))
+property_boolean (vertical, _("Vertical"), TRUE)
-gegl_chant_boolean (keep_signal, _("Keep Signal"),
- TRUE,
- _("Keep Signal"))
+property_boolean (keep_signal, _("Keep Signal"), TRUE)
#else
-#define GEGL_CHANT_TYPE_AREA_FILTER
-#define GEGL_CHANT_C_FILE "edge-sobel.c"
+#define GEGL_OP_AREA_FILTER
+#define GEGL_OP_C_FILE "edge-sobel.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
#include <stdio.h>
@@ -62,7 +56,7 @@ edge_sobel (GeglBuffer *src,
static void prepare (GeglOperation *operation)
{
GeglOperationAreaFilter *area = GEGL_OPERATION_AREA_FILTER (operation);
- //GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ //GeglProperties *o = GEGL_PROPERTIES (operation);
const Babl *source_format = gegl_operation_get_source_format (operation, "input");
@@ -144,7 +138,7 @@ cl_process (GeglOperation *operation,
gint err;
GeglOperationAreaFilter *op_area = GEGL_OPERATION_AREA_FILTER (operation);
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBufferClIterator *i = gegl_buffer_cl_iterator_new (output,
result,
@@ -188,7 +182,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglRectangle compute;
gboolean has_alpha;
@@ -310,7 +304,7 @@ edge_sobel (GeglBuffer *src,
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/exp-combine.c b/operations/common/exp-combine.c
index 678b4fd..30ce052 100644
--- a/operations/common/exp-combine.c
+++ b/operations/common/exp-combine.c
@@ -20,16 +20,18 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_string(exposures, _("Exposure Values"), "",
- _("Relative brightness of each exposure in EV"))
-gegl_chant_int (steps, _("Discretization Bits"),
- 8, 32, 12,
- _("Log2 of source's discretization steps"))
-gegl_chant_double (sigma, _("Weight Sigma"),
- 0.0f, 32.0f, 8.0f,
- _("Weight distribution sigma controlling response contributions"))
+property_string(exposures, _("Exposure Values"), "")
+ description (_("Relative brightness of each exposure in EV"))
+
+property_int (steps, _("Discretization Bits"), 13)
+ description (_("Log2 of source's discretization steps"))
+ value_range (8, 32)
+
+property_double (sigma, _("Weight Sigma"), 8.0f)
+ description (_("Weight distribution sigma controlling response contributions"))
+ value_range (0.0f, 32.0f)
#else
@@ -37,7 +39,7 @@ gegl_chant_double (sigma, _("Weight Sigma"),
/*#define DEBUG_SAVE_CURVES*/
#include <gegl-plugin.h>
-struct _GeglChant
+struct _GeglOp
{
GeglOperationFilter parent_instance;
gpointer properties;
@@ -46,11 +48,11 @@ struct _GeglChant
typedef struct
{
GeglOperationFilterClass parent_class;
-} GeglChantClass;
+} GeglOpClass;
-#define GEGL_CHANT_C_FILE "exp-combine.c"
-#include "gegl-chant.h"
+#define GEGL_OP_C_FILE "exp-combine.c"
+#include "gegl-op.h"
GEGL_DEFINE_DYNAMIC_OPERATION(GEGL_TYPE_OPERATION_FILTER)
#include <errno.h>
@@ -868,7 +870,7 @@ gegl_expcombine_get_exposures (GeglOperation *operation,
const GeglRectangle *full_roi,
GeglRectangle *scaled_roi)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gchar *ev_cursor = o->exposures;
GSList *exposures = NULL,
*inputs,
@@ -1041,7 +1043,7 @@ gegl_expcombine_process (GeglOperation *operation,
const GeglRectangle *full_roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglBuffer *output = gegl_operation_context_get_target (context,
output_pad);
@@ -1249,7 +1251,7 @@ gegl_expcombine_get_required_for_output (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
diff --git a/operations/common/exposure.c b/operations/common/exposure.c
index 0c5d846..00279ab 100644
--- a/operations/common/exposure.c
+++ b/operations/common/exposure.c
@@ -20,26 +20,26 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double_ui (exposure, _("Exposure"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0, -10.0, 10.0, 1.0,
- _("Relative brightness change in stops"))
+property_double (exposure, _("Exposure"), 0.0)
+ description (_("Relative brightness change in stops"))
+ ui_range (-10.0, 10.0)
-gegl_chant_double_ui (offset, _("Offset"),
- -0.5, 0.5, 0.0, -0.5, 0.5, 1.0,
- _("Offset value added"))
+property_double (offset, _("Offset"), 0.0)
+ description (_("Offset value added"))
+ value_range (-0.5, 0.5)
-gegl_chant_double_ui (gamma, _("Gamma"),
- 0.01, 10, 1.0, 0.01, 3.0, 1.0,
- _("Gamma correction"))
+property_double (gamma, _("Gamma correction"), 0.01)
+ value_range (0.01, 10)
+ ui_range (0.01, 3.0)
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "exposure.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "exposure.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
#ifdef _MSC_VER
@@ -64,7 +64,7 @@ process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
gfloat *in_pixel;
gfloat *out_pixel;
@@ -131,11 +131,11 @@ cl_process (GeglOperation *op,
const GeglRectangle *roi,
gint level)
{
- /* Retrieve a pointer to GeglChantO structure which contains all the
+ /* Retrieve a pointer to GeglProperties structure which contains all the
* chanted properties
*/
- GeglChantO *o = GEGL_CHANT_PROPERTIES (op);
+ GeglProperties *o = GEGL_PROPERTIES (op);
gfloat gain = powf(2.0, o->exposure);
gfloat offset = o->offset;
@@ -167,7 +167,7 @@ cl_process (GeglOperation *op,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
diff --git a/operations/common/fattal02.c b/operations/common/fattal02.c
index 0403c38..5f788a3 100644
--- a/operations/common/fattal02.c
+++ b/operations/common/fattal02.c
@@ -28,28 +28,31 @@
#include <math.h>
-#ifdef GEGL_CHANT_PROPERTIES
-
-gegl_chant_double (alpha, _("Alpha"),
- 0.0, 2.0, 1.0,
- _("Gradient threshold for detail enhancement"))
-gegl_chant_double (beta, _("Beta"),
- 0.1, 2.0, 0.9,
- _("Strength of local detail enhancement"))
-gegl_chant_double (saturation, _("Saturation"),
- 0.0, 1.0, 0.8,
- _("Global color saturation factor"))
-gegl_chant_double (noise, _("Noise"),
- 0.0, 1.0, 0.0,
- _("Gradient threshold for lowering detail enhancement"))
+#ifdef GEGL_PROPERTIES
+
+property_double (alpha, _("Alpha"), 1.0)
+ description(_("Gradient threshold for detail enhancement"))
+ value_range (0.0, 2.0)
+
+property_double (beta, _("Beta"), 0.9)
+ description(_("Strength of local detail enhancement"))
+ value_range (0.1, 2.0)
+
+property_double (saturation, _("Saturation"), 0.8)
+ description (_("Global color saturation factor"))
+ value_range (0.0, 1.0)
+
+property_double (noise, _("Noise"), 0.0)
+ description (_("Gradient threshold for lowering detail enhancement"))
+ value_range (0.0, 1.0)
#else
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "fattal02.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "fattal02.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include "gegl-debug.h"
#include <stdlib.h>
@@ -1246,7 +1249,7 @@ fattal02_process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- const GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ const GeglProperties *o = GEGL_PROPERTIES (operation);
gfloat noise;
const gint pix_stride = 3; /* RGBA */
@@ -1304,7 +1307,7 @@ fattal02_process (GeglOperation *operation,
/*
*/
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/fractal-trace.c b/operations/common/fractal-trace.c
index 8b7fe96..147386f 100644
--- a/operations/common/fractal-trace.c
+++ b/operations/common/fractal-trace.c
@@ -20,56 +20,57 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_register_enum (gegl_fractal_trace_type)
+enum_start (gegl_fractal_trace_type)
enum_value (GEGL_FRACTAL_TRACE_TYPE_MANDELBROT, "Mandelbrot")
enum_value (GEGL_FRACTAL_TRACE_TYPE_JULIA, "Julia")
-gegl_chant_register_enum_end (GeglFractalTraceType)
-
-gegl_chant_enum (fractal, _("Fractal type"),
- GeglFractalTraceType, gegl_fractal_trace_type,
- GEGL_FRACTAL_TRACE_TYPE_MANDELBROT, _("Type of a fractal"))
-
-gegl_chant_double (X1, _("X1"),
- -50.0, 50.0, -1.00,
- _("X1 value, position"))
-gegl_chant_double (X2, _("X2"),
- -50.0, 50.0, 0.50,
- _("X2 value, position"))
-
-gegl_chant_double (Y1, _("Y1"),
- -50.0, 50.0, -1.00,
- _("X2 value, position"))
-gegl_chant_double (Y2, _("Y2"),
- -50.0, 50.0, 1.00,
- _("Y2 value, position"))
-
-gegl_chant_double (JX, _("JX"),
- -50.0, 50.0, 0.5,
- _("Julia seed X value, position"))
-gegl_chant_double (JY, _("JY"),
- -50.0, 50.0, 0.5,
- _("Julia seed Y value, position"))
-
-gegl_chant_int (depth, _("Depth"),
- 1, 65536, 3,
- _("Depth value"))
-
-gegl_chant_double (bailout, _("Bailout"),
- 0.0, G_MAXDOUBLE, G_MAXDOUBLE,
- _("Bailout length"))
-
-gegl_chant_enum (abyss_policy, _("Abyss policy"),
- GeglAbyssPolicy, gegl_abyss_policy, GEGL_ABYSS_LOOP,
- _("How to deal with pixels outside of the input buffer"))
+enum_end (GeglFractalTraceType)
+
+property_enum (fractal, _("Fractal type"),
+ GeglFractalTraceType, gegl_fractal_trace_type,
+ GEGL_FRACTAL_TRACE_TYPE_MANDELBROT)
+
+property_double (X1, _("X1"), -1.0)
+ description (_("X1 value, position"))
+ value_range (-50.0, 50.0)
+
+property_double (X2, _("X2"), 0.50)
+ description (_("X2 value, position"))
+ value_range (-50.0, 50.0)
+
+property_double (Y1, _("Y1"), -1.0)
+ description (_("Y1 value, position"))
+ value_range (-50.0, 50.0)
+
+property_double (Y2, _("Y2"), 1.0)
+ description (_("Y@ value, position"))
+ value_range (-50.0, 50.0)
+
+property_double (JX, _("JX"), 0.5)
+ description (_("Julia seed X value, position"))
+ value_range (-50.0, 50.0)
+
+property_double (JY, _("JY"), 0.5)
+ description (_("Julia seed Y value, position"))
+ value_range (-50.0, 50.0)
+
+property_int (depth, _("Depth"), 3)
+ value_range (1, 65536)
+
+property_double (bailout, _("Bailout length"), G_MAXDOUBLE)
+ value_range (0.0, G_MAXDOUBLE)
+
+property_enum (abyss_policy, _("Abyss policy"),
+ GeglAbyssPolicy, gegl_abyss_policy, GEGL_ABYSS_LOOP)
+ description (_("How to deal with pixels outside of the input buffer"))
#else
-#define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE "fractal-trace.c"
+#define GEGL_OP_FILTER
+#define GEGL_OP_C_FILE "fractal-trace.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <math.h>
static void
@@ -116,7 +117,7 @@ fractaltrace (GeglBuffer *input,
const GeglRectangle *picture,
gfloat *dst_buf,
const GeglRectangle *roi,
- GeglChantO *o,
+ GeglProperties *o,
gint y,
GeglFractalTraceType fractal_type,
const Babl *format)
@@ -191,7 +192,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
GeglRectangle boundary;
const Babl *format;
gfloat *dst_buf;
@@ -236,7 +237,7 @@ get_required_for_output (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationFilterClass *filter_class;
diff --git a/operations/common/gegl-buffer-load-op.c b/operations/common/gegl-buffer-load-op.c
index f5693d3..26feadb 100644
--- a/operations/common/gegl-buffer-load-op.c
+++ b/operations/common/gegl-buffer-load-op.c
@@ -19,37 +19,38 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_file_path (path, _("File"), "/tmp/gegl-buffer.gegl", _("Path of GeglBuffer file to load."))
+property_file_path (path, _("File"), "/tmp/gegl-buffer.gegl")
+ description(_("Path of GeglBuffer file to load."))
#else
-#define GEGL_CHANT_TYPE_SOURCE
-#define GEGL_CHANT_C_FILE "gegl-buffer-load-op.c"
+#define GEGL_OP_SOURCE
+#define GEGL_OP_C_FILE "gegl-buffer-load-op.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void
-gegl_buffer_load_op_ensure_buffer (GeglChantO *o)
+gegl_buffer_load_op_ensure_buffer (GeglProperties *o)
{
- if (!o->chant_data)
- o->chant_data = gegl_buffer_load (o->path);
+ if (!o->user_data)
+ o->user_data = gegl_buffer_load (o->path);
}
static GeglRectangle
gegl_buffer_load_op_get_bounding_box (GeglOperation *operation)
{
GeglRectangle result = { 0, 0, 0, 0 };
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gegl_buffer_load_op_ensure_buffer (o);
- if (o->chant_data)
+ if (o->user_data)
{
- result.width = gegl_buffer_get_width (GEGL_BUFFER (o->chant_data));
- result.height = gegl_buffer_get_height (GEGL_BUFFER (o->chant_data));
+ result.width = gegl_buffer_get_width (GEGL_BUFFER (o->user_data));
+ result.height = gegl_buffer_get_height (GEGL_BUFFER (o->user_data));
}
return result;
@@ -62,18 +63,18 @@ gegl_buffer_load_op_process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gegl_buffer_load_op_ensure_buffer (o);
- gegl_operation_context_take_object (context, output_pad, o->chant_data);
- o->chant_data = NULL;
+ gegl_operation_context_take_object (context, output_pad, o->user_data);
+ o->user_data = NULL;
return TRUE;
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
diff --git a/operations/common/gegl-buffer-save-op.c b/operations/common/gegl-buffer-save-op.c
index 8a2eb70..f77f55f 100644
--- a/operations/common/gegl-buffer-save-op.c
+++ b/operations/common/gegl-buffer-save-op.c
@@ -19,16 +19,17 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_file_path (path, _("File"), "/tmp/gegl-buffer.gegl", _("Target file path to write GeglBuffer
to."))
+property_file_path (path, _("File"), "/tmp/gegl-buffer.gegl")
+ description (_("Target file path to write GeglBuffer to."))
#else
-#define GEGL_CHANT_TYPE_SINK
-#define GEGL_CHANT_C_FILE "gegl-buffer-save-op.c"
+#define GEGL_OP_SINK
+#define GEGL_OP_C_FILE "gegl-buffer-save-op.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static gboolean
@@ -37,7 +38,7 @@ gegl_buffer_save_op_process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gegl_buffer_save (input, o->path, result);
@@ -45,7 +46,7 @@ gegl_buffer_save_op_process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationSinkClass *sink_class;
diff --git a/operations/common/grey.c b/operations/common/grey.c
index bc79dc7..a5c5277 100644
--- a/operations/common/grey.c
+++ b/operations/common/grey.c
@@ -20,16 +20,16 @@
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
/* no properties */
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "grey.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "grey.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void prepare (GeglOperation *operation)
{
@@ -86,7 +86,7 @@ error:
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
diff --git a/operations/common/high-pass.c b/operations/common/high-pass.c
index a556be3..eca092e 100644
--- a/operations/common/high-pass.c
+++ b/operations/common/high-pass.c
@@ -19,19 +19,25 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_double_ui (std_dev, _("Std. Dev."), 0.0, 10000.0, 4.0, 0.0, 1000.0,
- 1.5, _("Standard deviation (spatial scale factor)"))
-gegl_chant_double_ui (contrast, _("Contrast"), 0.0, 5.0, 1.0,
- 0.0, 5.0, 1.0, _("Contrast of high-pass"))
+property_double (std_dev, _("Std. Dev."), 4.0)
+ description (_("Standard deviation (spatial scale factor)"))
+ value_range (0.0, 10000.0)
+ ui_range (0.0, 1000.0)
+ ui_gamma (1.5)
+
+property_double (contrast, _("Contrast"), 1.0)
+ description(_("Contrast of high-pass"))
+ value_range (0.0, 5.0)
+ ui_range (0.0, 5.0)
#else
-#define GEGL_CHANT_TYPE_META
-#define GEGL_CHANT_C_FILE "high-pass.c"
+#define GEGL_OP_META
+#define GEGL_OP_C_FILE "high-pass.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
static void
attach (GeglOperation *operation)
@@ -61,7 +67,7 @@ attach (GeglOperation *operation)
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
diff --git a/operations/common/image-compare.c b/operations/common/image-compare.c
index 4367d2b..b58bd6c 100644
--- a/operations/common/image-compare.c
+++ b/operations/common/image-compare.c
@@ -22,30 +22,26 @@
#include <math.h>
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
+#ifdef GEGL_PROPERTIES
-gegl_chant_int (wrong_pixels, _("Wrong pixels"),
- G_MININT, G_MAXINT, 0,
- _("Number of differing pixels."))
+property_int (wrong_pixels, _("Wrong pixels"), 0)
+ description(_("Number of differing pixels."))
-gegl_chant_double (max_diff, _("Maximum difference"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- _("Maximum difference between two pixels."))
+property_double (max_diff, _("Maximum difference"), 0.0)
+ description(_("Maximum difference between two pixels."))
-gegl_chant_double (avg_diff_wrong, _("Average difference (wrong)"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- _("Average difference between wrong pixels."))
+property_double (avg_diff_wrong, _("Average difference (wrong)"), 0.0)
+ description(_("Average difference between wrong pixels."))
-gegl_chant_double (avg_diff_total, _("Average difference (total)"),
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- _("Average difference between all pixels."))
+property_double (avg_diff_total, _("Average difference (total)"), 0.0)
+ description(_("Average difference between all pixels."))
#else
-#define GEGL_CHANT_TYPE_COMPOSER
-#define GEGL_CHANT_C_FILE "image-compare.c"
+#define GEGL_OP_COMPOSER
+#define GEGL_OP_C_FILE "image-compare.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#define ERROR_TOLERANCE 0.01
#define SQR(x) ((x) * (x))
@@ -81,7 +77,7 @@ process (GeglOperation *operation,
const GeglRectangle *result,
gint level)
{
- GeglChantO *props = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *props = GEGL_PROPERTIES (operation);
gdouble max_diff = 0.0;
gdouble diffsum = 0.0;
gint wrong_pixels = 0;
@@ -189,7 +185,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationComposerClass *composer_class;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]