[gegl/soc-2012-ops: 54/58] Noise-Slur Operation add random seed
- From: Michael Murà <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/soc-2012-ops: 54/58] Noise-Slur Operation add random seed
- Date: Wed, 29 Aug 2012 11:09:03 +0000 (UTC)
commit d8ce661a6c9343e58d6580b36b9d6939c684ba78
Author: Maxime Nicco <maxime nicco gmail fr>
Date: Wed Aug 15 19:16:22 2012 +0200
Noise-Slur Operation add random seed
add random seed functionality
operations/common/noise-slur.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/noise-slur.c b/operations/common/noise-slur.c
index 1d9c93c..0855784 100644
--- a/operations/common/noise-slur.c
+++ b/operations/common/noise-slur.c
@@ -30,7 +30,9 @@
#ifdef GEGL_CHANT_PROPERTIES
-//gegl_chant_int (random_seed, _("Random seed"), 1, 8, 2, _("Random seed"))
+gegl_chant_boolean (random_seed, _("Random Seed "), FALSE, _("to get a random seed"))
+
+gegl_chant_seed (seed, _("Seed"), _("Random seed"))
gegl_chant_double (pct_random, _("Randomization (%)"), 0.0, 100.0, 3.0, _("Radomization"))
@@ -85,7 +87,11 @@ process (GeglOperation *operation,
gint k, b, i;
gint total_pixels;
- gr = g_rand_new ();
+ if (o->random_seed)
+ gr = g_rand_new();
+ else
+ gr = g_rand_new_with_seed (o->seed);
+
tmp = gegl_buffer_new(result, babl_format ("RGBA float"));
src_rect.x = result->x - op_area->left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]