[gegl] alpha-inpaint: make direction invariancy be runtime settable



commit f01f409387d7823bcceaa69925feb3803508bb49
Author: Øyvind Kolås <pippin gimp org>
Date:   Fri Jul 5 16:33:50 2019 +0200

    alpha-inpaint: make direction invariancy be runtime settable

 operations/workshop/alpha-inpaint.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/operations/workshop/alpha-inpaint.c b/operations/workshop/alpha-inpaint.c
index 3af6fb0e7..a92226b54 100644
--- a/operations/workshop/alpha-inpaint.c
+++ b/operations/workshop/alpha-inpaint.c
@@ -103,6 +103,8 @@ property_double (ring_gap4, "ring gap4", 5.5)
   value_range (0.0, 16.0)
   ui_steps    (0.25, 0.25)
 
+property_boolean (direction_invariant, "direction invariant", TRUE)
+  description ("wheter we normalize feature vector to start with highest energy ray")
 
 #else
 
@@ -130,7 +132,6 @@ property_double (ring_gap4, "ring gap4", 5.5)
  * after sampling so that the ray with the most energy is stored first - this
  * is how we achieve orientation invariance.
  */
-#define DIRECTION_INVARIANT // comment out to make search be direction dependent
 
 #define N_SCALE_NEEDLES         3
 
@@ -365,7 +366,7 @@ static void extract_site (PixelDuster *duster, GeglBuffer *buffer, double x, dou
     gegl_sampler_get (sampler_f, x + dx * scale, y + dy * scale, NULL, &dst[i*4], 0);
   }
 
-#ifdef DIRECTION_INVARIANT
+  if (duster->o->direction_invariant)
   {
     int warmest_ray = 0;
     float warmest_ray_energy = 0;
@@ -408,7 +409,6 @@ static void extract_site (PixelDuster *duster, GeglBuffer *buffer, double x, dou
        }
     }
   }
-#endif
 }
 
 static inline float f_rgb_diff (float *a, float *b)


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