[gegl/soc-2012-ops] Noise-Slur Operation add random seed
- From: Maxime Nicco <maxnicco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/soc-2012-ops] Noise-Slur Operation add random seed
- Date: Tue, 28 Aug 2012 11:46:51 +0000 (UTC)
commit 9d3644bf07f7f7728a6f0298fe06cbdaa408804c
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]