[gegl/soc-2013-opecl-ops] Fixing Noise-hurl, so in every repetition it chooses differents pixel.
- From: Carlos Zubieta <czubieta src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/soc-2013-opecl-ops] Fixing Noise-hurl, so in every repetition it chooses differents pixel.
- Date: Wed, 31 Jul 2013 16:48:33 +0000 (UTC)
commit 9bf522dad4058e611d98edcf7b5bb9a07fe37e19
Author: Carlos Zubieta <czubieta dev gmail com>
Date: Fri Jul 26 17:20:51 2013 -0500
Fixing Noise-hurl, so in every repetition it chooses differents pixel.
operations/common/noise-hurl.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/operations/common/noise-hurl.c b/operations/common/noise-hurl.c
index 4f16702..b047ca0 100644
--- a/operations/common/noise-hurl.c
+++ b/operations/common/noise-hurl.c
@@ -66,6 +66,7 @@ process (GeglOperation *operation,
gfloat *GEGL_ALIGNED out_pixel;
gfloat *out_pix;
gint i, cnt;
+ gint x, y, n;
in_pixel = in_buf;
out_pixel = out_buf;
@@ -78,13 +79,12 @@ process (GeglOperation *operation,
in_pixel += 1;
}
+ n = 0;
+
for (cnt = 0; cnt < o->repeat; cnt++)
{
- gint x, y, n;
-
x = roi->x;
y = roi->y;
- n = 0;
out_pix = out_pixel;
@@ -97,13 +97,14 @@ process (GeglOperation *operation,
blue = out_pix[2];
alpha = out_pix[3];
- if (gegl_random_float_range (o->seed, x, y, 0, n++, 0.0, 100.0) <=
+ if (gegl_random_float_range (o->seed, x, y, 0, n, 0.0, 100.0) <=
o->pct_random)
{
- red = gegl_random_float_range (o->seed, x, y, 0, n++, 0.0, 1.0);
- green = gegl_random_float_range (o->seed, x, y, 0, n++, 0.0, 1.0);
- blue = gegl_random_float_range (o->seed, x, y, 0, n++, 0.0, 1.0);
+ red = gegl_random_float_range (o->seed, x, y, 0, n+1, 0.0, 1.0);
+ green = gegl_random_float_range (o->seed, x, y, 0, n+2, 0.0, 1.0);
+ blue = gegl_random_float_range (o->seed, x, y, 0, n+3, 0.0, 1.0);
}
+ n += 4;
out_pix[0] = red;
out_pix[1] = green;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]