[gegl] spherize: disable negative curvatures



commit 5ce60d58f4ad65bf0617383ad6cb192eed41b91c
Author: Ell <ell_se yahoo com>
Date:   Wed Oct 11 11:55:06 2017 -0400

    spherize: disable negative curvatures
    
    Restrict the "curvature" property to the [0, 1] range.  Negative
    curvatures produce the same result as positive curvatures when the
    angle of view is 0, and the choice of upper bound for their mapping
    to apex angles, depending on the angle of view, is arbitrary,
    unlike positive curvatures.
    
    Note that this commit only restricts the value range of the
    property, while keeping support for negative curvatures in the
    code, since it is trivial.

 operations/workshop/spherize.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/operations/workshop/spherize.c b/operations/workshop/spherize.c
index d19fb39..05e1cd8 100644
--- a/operations/workshop/spherize.c
+++ b/operations/workshop/spherize.c
@@ -40,7 +40,15 @@ property_double (angle_of_view, _("Angle of view"), 0.0)
 
 property_double (curvature, _("Curvature"), 1.0)
   description (_("Spherical cap apex angle, as a fraction of the co-angle of view"))
-  value_range (-1.0, 1.0)
+  value_range (0.0, 1.0) /* note that the code can handle negative curvatures
+                          * (in the [-1, 0) range), in which case the image is
+                          * wrapped around the back face, rather than the front
+                          * face, of the spherical cap.  we disable negative
+                          * curvatures atm, in particular, since they produce
+                          * the same result when the angle of view is 0, and
+                          * since their upper-bound, wrt the angle of view, is
+                          * arbitrary.
+                          */
 
 property_double (amount, _("Amount"), 1.0)
   description (_("Displacement scaling factor (negative values refer to the inverse displacement)"))


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