[gegl] panorama-projection: bail earlier when pixel is in wrong hemisphere



commit 08e19170427dc098d3667e3560124026ae815766
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Apr 10 00:49:07 2018 +0200

    panorama-projection: bail earlier when pixel is in wrong hemisphere

 operations/common/panorama-projection.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/operations/common/panorama-projection.c b/operations/common/panorama-projection.c
index 15cda79..e5bb83d 100644
--- a/operations/common/panorama-projection.c
+++ b/operations/common/panorama-projection.c
@@ -157,6 +157,13 @@ gnomonic_ll2xy (Transform *transform,
            transform->cos_tilt * cos_lat *
             cos_lon_minus_pan);
 
+  if (cos_c <= 0.01f)
+  {
+    *x = -.1f;
+    *y = -.1f;
+    return;
+  }
+
   *x = ((cos_lat * sin (lon - transform->pan)) / cos_c);
   *y = ((transform->cos_tilt * sin_lat -
          transform->sin_tilt * cos_lat * cos_lon_minus_pan) / cos_c);
@@ -176,11 +183,6 @@ gnomonic_ll2xy (Transform *transform,
   *x += transform->xoffset;
   *y += 0.5f;
 
-  if (cos_c <= 0.01f)
-  {
-    *x = -.1f;
-    *y = -.1f;
-  }
 }
 
 static void inline


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