[gegl/soc-2012-ops: 52/58] Noise-Hurl Operation add random seed



commit d73af00dab47bf5e7efd2e52abb9bdf848c972d3
Author: Maxime Nicco <maxime nicco gmail fr>
Date:   Wed Aug 15 19:13:04 2012 +0200

    Noise-Hurl Operation add random seed
    
    add random seed functionality

 operations/common/noise-hurl.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/operations/common/noise-hurl.c b/operations/common/noise-hurl.c
index 4ad8ccf..4022822 100644
--- a/operations/common/noise-hurl.c
+++ b/operations/common/noise-hurl.c
@@ -27,7 +27,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"))
 
@@ -74,7 +76,10 @@ process (GeglOperation       *operation,
   in_pixel      = in_buf;
   out_pixel     = out_buf;
 
-  gr = g_rand_new ();
+  if (o->random_seed)
+    gr = g_rand_new();
+  else
+    gr = g_rand_new_with_seed (o->seed);
 
   out_pix = out_pixel;
 



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