[gegl: 3/11] threshold: use gegl-op.h



commit 7d4766812a1a8a9481e321a63227844732549e57
Author: Øyvind Kolås <pippin gimp org>
Date:   Thu May 15 00:56:19 2014 +0200

    threshold: use gegl-op.h

 operations/common/threshold.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/operations/common/threshold.c b/operations/common/threshold.c
index 6c06654..ff1e806 100644
--- a/operations/common/threshold.c
+++ b/operations/common/threshold.c
@@ -20,17 +20,25 @@
 #include <glib/gi18n-lib.h>
 
 
-#ifdef GEGL_CHANT_PROPERTIES
-
-gegl_chant_double_ui (value, _("Threshold"), -10.0, 10.0, 0.5, 0.0, 1.0, 1.0, 
-   _("Global threshold level (used when there is no auxiliary input buffer)."))
+#ifdef GEGL_PROPERTIES
+
+gegl_property_double (
+    value,
+    "nick",  _("Threshold"),
+    "default",    0.5,
+    "min",     -200.0,
+    "max",      200.0,
+    "ui-min",   -10.0,
+    "ui-max",    10.0,
+    "blurb", _("Scalar threshold level (overriden if an auxiliary input buffer is provided.)."),
+    NULL)
 
 #else
 
-#define GEGL_CHANT_TYPE_POINT_COMPOSER
-#define GEGL_CHANT_C_FILE       "threshold.c"
+#define GEGL_OP_POINT_COMPOSER
+#define GEGL_OP_C_FILE       "threshold.c"
 
-#include "gegl-chant.h"
+#include "gegl-op.h"
 
 static void prepare (GeglOperation *operation)
 {
@@ -55,7 +63,7 @@ process (GeglOperation       *op,
 
   if (aux == NULL)
     {
-      gfloat value = GEGL_CHANT_PROPERTIES (op)->value;
+      gfloat value = GEGL_PROPERTIES (op)->value;
       for (i=0; i<n_pixels; i++)
         {
           gfloat c;
@@ -92,7 +100,7 @@ process (GeglOperation       *op,
 #include "opencl/threshold.cl.h"
 
 static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
 {
   GeglOperationClass              *operation_class;
   GeglOperationPointComposerClass *point_composer_class;


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