[gegl/pippin/property-keys: 8/10] noise-rgb: migrate to new op api
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/pippin/property-keys: 8/10] noise-rgb: migrate to new op api
- Date: Wed, 14 May 2014 23:01:40 +0000 (UTC)
commit f91b46939714907c94cde81d359ba849e249410b
Author: Øyvind Kolås <pippin gimp org>
Date: Thu May 15 00:59:00 2014 +0200
noise-rgb: migrate to new op api
operations/common/noise-rgb.c | 89 ++++++++++++++++++++++++++---------------
1 files changed, 56 insertions(+), 33 deletions(-)
---
diff --git a/operations/common/noise-rgb.c b/operations/common/noise-rgb.c
index 2e20f6e..44125af 100644
--- a/operations/common/noise-rgb.c
+++ b/operations/common/noise-rgb.c
@@ -23,41 +23,64 @@
#include "config.h"
#include <glib/gi18n-lib.h>
-#ifdef GEGL_CHANT_PROPERTIES
-
-gegl_chant_boolean (correlated, _("Correlated noise"),
- FALSE,
- _("Correlated noise"))
-
-gegl_chant_boolean (independent, _("Independent RGB"),
- TRUE,
- _("Independent RGB"))
-
-gegl_chant_double (red, _("Red"),
- 0.0, 1.0, 0.20,
- _("Red"))
-
-gegl_chant_double (green, _("Green"),
- 0.0, 1.0, 0.20,
- _("Green"))
-
-gegl_chant_double (blue, _("Blue"),
- 0.0, 1.0, 0.20,
- _("Blue"))
-
-gegl_chant_double (alpha, _("Alpha"),
- 0.0, 1.0, 0.00,
- _("Alpha"))
-
-gegl_chant_seed (seed, rand, _("Seed"),
- _("Random seed"))
+#ifdef GEGL_PROPERTIES
+
+gegl_property_boolean (
+ correlated,
+ "nick", _("Correlated noise"),
+ "default", FALSE,
+ NULL)
+
+gegl_property_boolean (
+ independent,
+ "nick", _("Independent RGB"),
+ "default", TRUE,
+ NULL)
+
+gegl_property_double (
+ red,
+ "nick", _("Red"),
+ "min", 0.0,
+ "max", 1.0,
+ "default", 0.20,
+ NULL)
+
+gegl_property_double (
+ green,
+ "nick", _("Green"),
+ "min", 0.0,
+ "max", 1.0,
+ "default", 0.20,
+ NULL)
+
+gegl_property_double (
+ blue,
+ "nick", _("Blue"),
+ "min", 0.0,
+ "max", 1.0,
+ "default", 0.20,
+ NULL)
+
+gegl_property_double (
+ alpha,
+ "nick", _("Alpha"),
+ "min", 0.0,
+ "max", 1.0,
+ "default", 0.00,
+ NULL)
+
+gegl_property_seed (
+ seed, rand,
+ "nick", _("Seed"),
+ "blurb", _("Random seed"),
+ NULL)
#else
-#define GEGL_CHANT_TYPE_POINT_FILTER
-#define GEGL_CHANT_C_FILE "noise-rgb.c"
+#define GEGL_OP_POINT_FILTER
+#define GEGL_OP_C_FILE "noise-rgb.c"
-#include "gegl-chant.h"
+#include "gegl-op.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@@ -106,7 +129,7 @@ process (GeglOperation *operation,
const GeglRectangle *roi,
gint level)
{
- GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
+ GeglProperties *o = GEGL_PROPERTIES (operation);
gdouble noise_coeff = 0.0;
int rint = 0;
@@ -169,7 +192,7 @@ process (GeglOperation *operation,
}
static void
-gegl_chant_class_init (GeglChantClass *klass)
+gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationPointFilterClass *point_filter_class;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]