[gegl] operations: api refactoring churn



commit 684c9f7a9fb7d58fed634a3d56b49dae584f7936
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue May 20 14:50:00 2014 +0200

    operations: api refactoring churn

 operations/common/vignette.c |   95 ++++++++++++++++++-----------------------
 operations/common/waves.c    |   59 +++++++++++---------------
 2 files changed, 67 insertions(+), 87 deletions(-)
---
diff --git a/operations/common/vignette.c b/operations/common/vignette.c
index 1bc3c8e..9fbd7c2 100644
--- a/operations/common/vignette.c
+++ b/operations/common/vignette.c
@@ -27,62 +27,51 @@ enum_start (gegl_vignette_shape)
   enum_value (GEGL_VIGNETTE_SHAPE_DIAMOND, "Diamond")
 enum_end (GeglVignetteShape)
 
-gegl_property_enum (shape, _("Vignette shape"),
+property_enum (shape, _("Vignette shape"),
     GeglVignetteShape, gegl_vignette_shape,
-    "default", GEGL_VIGNETTE_SHAPE_CIRCLE,
-    NULL)
-
-gegl_property_color (color, _("Color"),
-    "description", _("Defaults to 'black', you can use transparency here to erase portions of an image"),
-    "default", "black",
-    NULL)
-
-gegl_property_double (radius, _("Radius"),
-    "description",_("How far out vignetting goes as portion of half image diagonal"),
-    "default", 1.5, "min", 0.0, "max", 3.0,
-    "unit", "relative-distance",
-    NULL)
-
-gegl_property_double (softness, _("Softness"),
-    "default", 0.8, "min", 0.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (gamma, _("Gamma"),
-    "description", _("Falloff linearity"),
-    "default", 2.0, "min", 1.0, "max", 20.0,
-    NULL)
-
-gegl_property_double (proportion, _("Proportion"),
-    "description", _("How close we are to image proportions"),
-    "default", 1.0, "min", 0.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (squeeze, _("Squeeze"),
-    "description",_("Aspect ratio to use, -0.5 = 1:2, 0.0 = 1:1, 0.5 = 2:1, "
+    GEGL_VIGNETTE_SHAPE_CIRCLE)
+
+property_color (color, _("Color"), "black")
+    description (_("Defaults to 'black', you can use transparency here to erase portions of an image"))
+
+property_double (radius, _("Radius"), 1.5)
+    description (_("How far out vignetting goes as portion of half image diagonal"))
+    value_range (0.0, 3.0)
+    ui_meta     ("unit", "relative-distance")
+
+property_double (softness, _("Softness"), 0.8)
+    value_range (0.0, 1.0)
+
+property_double (gamma, _("Gamma"), 2.0)
+    description (_("Falloff linearity"))
+    value_range (1.0, 20.0)
+
+property_double (proportion, _("Proportion"), 1.0)
+    description(_("How close we are to image proportions"))
+    value_range (0.0, 1.0)
+
+property_double (squeeze, _("Squeeze"), 0.0)
+    description (("Aspect ratio to use, -0.5 = 1:2, 0.0 = 1:1, 0.5 = 2:1, "
               "-1.0 = 1:inf 1.0 = inf:1, this is applied after "
               "proportion is taken into account, to directly use "
-              "squeeze factor as proportions, set proportion to 0.0."),
-    "default", 0.0, "min", -1.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (x, _("Center X"),
-    "description", _("Horizontal center of vignetting"),
-    "default", 0.5, "min", -1.0, "max", 2.0,
-    "unit", "relative-distance",
-    "axis", "x",
-    NULL)
-
-gegl_property_double (y, _("Center Y"),
-    "description", _("Vertical center of vignetting"),
-    "default", 0.5, "min", -1.0, "max", 2.0,
-    "unit", "relative-distance",
-    "axis", "y",
-    NULL)
-
-gegl_property_double (rotation, _("Rotation"),
-    "min", 0.0, "max", 360.0,
-    "unit", "degree", /* XXX: perhaps change to radians? */
-    NULL)
+              "squeeze factor as proportions, set proportion to 0.0."))
+    value_range (-1.0, 1.0)
+
+property_double (x, _("Center X"), 0.5)
+    description (_("Horizontal center of vignetting"))
+    value_range (-1.0, 2.0)
+    ui_meta     ("unit", "relative-distance")
+    ui_meta     ("axis", "x")
+
+property_double (y, _("Center Y"), 0.5)
+    description (_("Vertical center of vignetting"))
+    value_range (-1, 2)
+    ui_meta     ("unit", "relative-distance")
+    ui_meta     ("axis", "y")
+
+property_double (rotation, _("Rotation"), 0.0)
+    value_range (0.0, 360.0)
+    ui_meta     ("unit", "degree") /* XXX: change to radians */
 
 #else
 
diff --git a/operations/common/waves.c b/operations/common/waves.c
index cbfd697..ada941c 100644
--- a/operations/common/waves.c
+++ b/operations/common/waves.c
@@ -23,47 +23,38 @@
 
 #ifdef GEGL_PROPERTIES
 
-gegl_property_double (x, _("Center X"),
-    "description", _("X coordinate of the center of the waves"),
-    "ui-min", 0.0, "ui-max", 1024.0, "ui-gamma", 1.0,
-    "unit", "pixel-coordinate",
-    "axis", "x",
-    NULL)
-
-gegl_property_double (y, _("Center Y"),
-    "description", _("Y coordinate of the center of the waves"),
-    "ui-min", 0.0, "ui-max", 1024.0, "ui-gamma", 1.0,
-    "unit", "pixel-coordinate",
-    "axis", "y",
-    NULL)
-
-gegl_property_double (amplitude, _("Amplitude"),
-    "description", _("Amplitude of the ripple"),
-    "default", 25.0, "min", 0.0, "max", 1000.0,
-    NULL)
-
-gegl_property_double (period, _("Period"),
-    "description", _("Period (wavelength) of the ripple"),
-    "default", 200.0, "min", 0.0, "max", 1000.0,
-    NULL)
-
-gegl_property_double (phi, _("Phase shift"),
-    "min", -1.0, "max", 1.0,
-    NULL)
-
-gegl_property_double (aspect, _("Aspect ratio"),
-    "default", 1.0, "min", 0.1, "max", 10.0,
-    NULL)
-
-gegl_property_enum (sampler_type, _("Resampling method"),
-    GeglSamplerType, gegl_sampler_type,
-    "description", _("Mathematical method for reconstructing pixel values"),
-    "default", GEGL_SAMPLER_CUBIC,
-    NULL)
-
-gegl_property_boolean (clamp, _("Clamp deformation"),
-    "description", _("Limit deformation in the image area."),
-    NULL)
+property_double (x, _("Center X"), 0.0)
+    description(_("X coordinate of the center of the waves"))
+    ui_range   (0.0, 1024.0)
+    ui_meta    ("unit", "pixel-coordinate") /* XXX: should be relative */
+    ui_meta    ("axis", "x")
+
+property_double (y, _("Center Y"), 0.0)
+    description(_("Y coordinate of the center of the waves"))
+    ui_range   (0.0, 1024.0)
+    ui_meta    ("unit", "pixel-coordinate")
+    ui_meta    ("axis", "y")
+
+property_double (amplitude, _("Amplitude"), 25.0)
+    description(_("Amplitude of the ripple"))
+    value_range (0.0, 1000.0)
+
+property_double (period, _("Period"), 200)
+    description(_("Period (wavelength) of the ripple"))
+    value_range (0, 1000)
+
+property_double (phi, _("Phase shift"), 0)
+    value_range (-1, 1)
+
+property_double (aspect, _("Aspect ratio"), 1.0)
+    value_range (0.1, 10.0)  /* XXX: needs better ui type */
+
+property_enum (sampler_type, _("Resampling method"),
+    GeglSamplerType, gegl_sampler_type, GEGL_SAMPLER_CUBIC)
+    description(_("Mathematical method for reconstructing pixel values"))
+
+property_boolean (clamp, _("Clamp deformation"), FALSE)
+    description(_("Limit deformation in the image area."))
 
 #else
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]