[gegl] lohalo: assume identity with no matrix



commit 47652aca802205a988b1c89d07fd8e230be37f15
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Fri Jul 1 03:24:24 2011 +0100

    lohalo: assume identity with no matrix
    
    Make it valid to call lohalo without specifying the inverse jacobian matrix.
    The code would be simplified by only having the condition once in code.

 gegl/buffer/gegl-sampler-lohalo.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index a1cc720..6d71b15 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -1957,10 +1957,10 @@ gegl_sampler_lohalo_get (      GeglSampler* restrict self,
        * Ellipse reference:
        * http://en.wikipedia.org/wiki/Ellipse#Canonical_form
        */
-      const gdouble a = self->inverse_jacobian->coeff[0][0];
-      const gdouble b = self->inverse_jacobian->coeff[0][1];
-      const gdouble c = self->inverse_jacobian->coeff[1][0];
-      const gdouble d = self->inverse_jacobian->coeff[1][1];
+      const gdouble a = self->inverse_jacobian?self->inverse_jacobian->coeff[0][0]:1;
+      const gdouble b = self->inverse_jacobian?self->inverse_jacobian->coeff[0][1]:0;
+      const gdouble c = self->inverse_jacobian?self->inverse_jacobian->coeff[1][0]:0;
+      const gdouble d = self->inverse_jacobian?self->inverse_jacobian->coeff[1][1]:1;
 
       /*
        * Computations are done in double precision because "direct"



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