[gegl: 49/55] Noise-Hurl Operation add random seed
- From: Michael Murà <mmure src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gegl: 49/55] Noise-Hurl Operation add random seed
- Date: Wed, 29 Aug 2012 11:22:09 +0000 (UTC)
commit 94db577d256baa28f0c4ac402ce49958b1ac995a
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]