[gegl] bloom: change "amount" property to "threshold"



commit 9cc79768be91f22ea6756650765b925e07406ecb
Author: Ell <ell_se yahoo com>
Date:   Tue Jun 2 19:57:13 2020 +0300

    bloom: change "amount" property to "threshold"
    
    Rename the "amount" property to "threshold", and reverse its
    interpretation; furthermore, increase the value ranges of the
    properties.  This allows the glow to be limited to over-exposed
    areas, by using a threshold > 100%.

 operations/common/bloom.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/operations/common/bloom.c b/operations/common/bloom.c
index 48fea3085..9a6942a78 100644
--- a/operations/common/bloom.c
+++ b/operations/common/bloom.c
@@ -23,13 +23,14 @@
 
 #ifdef GEGL_PROPERTIES
 
-property_double (amount, _("Amount"), 50.0)
+property_double (threshold, _("Threshold"), 50.0)
     description (_("Glow-area brightness threshold"))
-    value_range (0.0, 100.0)
+    ui_range    (0.0, 100.0)
 
 property_double (softness, _("Softness"), 25.0)
     description (_("Glow-area edge softness"))
-    value_range (0.0, 100.0)
+    value_range (0.0, G_MAXDOUBLE)
+    ui_range    (0.0, 100.0)
 
 property_double (radius, _("Radius"), 10.0)
     description (_("Glow radius"))
@@ -40,7 +41,7 @@ property_double (radius, _("Radius"), 10.0)
 
 property_double (strength, _("Strength"), 50.0)
     description (_("Glow strength"))
-    value_range (0.0, 1000.0)
+    value_range (0.0, G_MAXDOUBLE)
     ui_range    (0.0, 100.0)
 
 property_boolean (limit_exposure, _("Limit exposure"), FALSE)
@@ -73,11 +74,9 @@ update (GeglOperation *operation)
 
   if (nodes)
     {
-      gdouble threshold = 1.0 - o->amount / 100.0;
-
       gegl_node_set (nodes->levels,
-                     "in-low",   threshold - o->softness / 100.0,
-                     "in-high",  threshold + o->softness / 100.0,
+                     "in-low",   (o->threshold - o->softness) / 100.0,
+                     "in-high",  (o->threshold + o->softness) / 100.0,
                      "out-high", o->strength / 100.0,
                      NULL);
 


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