[gegl] noise-rgb: gummify + fix



commit 8681bf105e683aa41bbf132f3ac0989f1d5a6a22
Author: Ell <ell_se yahoo com>
Date:   Fri May 4 12:40:31 2018 -0400

    noise-rgb: gummify + fix
    
    When the op's "independent" property is FALSE, only the value of
    the "red" property (and not "green" and "blue") affects the output,
    using the same noise value for all channels.  Use GUM to hide the
    "green" and "blue" properties in this case, and to change the label
    of the "red" property to "value".
    
    Fix output when "independent" is FALSE, and "green" or "blue" are
    0 (previously, there would be no noise applied to the green/blue
    channels, respectively.)

 operations/common/noise-rgb.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/operations/common/noise-rgb.c b/operations/common/noise-rgb.c
index 237d30f..446db2c 100644
--- a/operations/common/noise-rgb.c
+++ b/operations/common/noise-rgb.c
@@ -38,12 +38,16 @@ property_boolean (gaussian, _("Gaussian distribution"), TRUE)
 
 property_double (red, _("Red"), 0.20)
    value_range  (0.0, 1.0)
+   ui_meta      ("label", "[! independent : non-independent-label]")
+   ui_meta      ("non-independent-label", _("Value"))
 
 property_double (green, _("Green"), 0.20)
    value_range  (0.0, 1.0)
+   ui_meta      ("visible", "independent")
 
 property_double (blue, _("Blue"), 0.20)
    value_range  (0.0, 1.0)
+   ui_meta      ("visible", "independent")
 
 property_double (alpha, _("Alpha"), 0.0)
    value_range  (0.0, 1.0)
@@ -154,7 +158,7 @@ process (GeglOperation       *operation,
       if (b == 0 || o->independent || b == 3 )
          noise_coeff = noise[b] * noise_fun (o->rand, x, y, &n) * 0.5;
 
-      if (noise[b] > 0.0)
+      if (noise_coeff > 0.0)
       {
         if (o->correlated)
         {


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