[gegl/samplers] Switched inverse_jacobian back to a GeglMatrix2 (which now works as well as a gdouble ptr)



commit aeabd384125204907d1a12c70de5d408dfc78d3b
Author: Adam Turcotte <aturcotte src gnome org>
Date:   Fri Jun 17 14:21:32 2011 -0400

    Switched inverse_jacobian back to a GeglMatrix2 (which now works as well as a gdouble ptr)

 gegl/buffer/gegl-sampler-lohalo.c |    8 ++++----
 gegl/buffer/gegl-sampler.h        |    2 +-
 gegl/gegl-matrix.h                |    2 +-
 operations/affine/affine.c        |   12 ++++++------
 4 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler-lohalo.c b/gegl/buffer/gegl-sampler-lohalo.c
index 062fcce..bc687c4 100644
--- a/gegl/buffer/gegl-sampler-lohalo.c
+++ b/gegl/buffer/gegl-sampler-lohalo.c
@@ -1740,10 +1740,10 @@ gegl_sampler_lohalo_get (      GeglSampler* restrict self,
        * Ellipse reference:
        * http://en.wikipedia.org/wiki/Ellipse#Canonical_form
        */
-      const gdouble a = self->inverse_jacobian[0];
-      const gdouble b = self->inverse_jacobian[1];
-      const gdouble c = self->inverse_jacobian[2];
-      const gdouble d = self->inverse_jacobian[3];
+      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];
 
       /*
        * n is the matrix Jinv * transpose(Jinv). Eigenvalues of n are
diff --git a/gegl/buffer/gegl-sampler.h b/gegl/buffer/gegl-sampler.h
index 49cc133..9600c7e 100644
--- a/gegl/buffer/gegl-sampler.h
+++ b/gegl/buffer/gegl-sampler.h
@@ -47,7 +47,7 @@ struct _GeglSampler
   GeglRectangle  context_rect;
   void          *sampler_buffer;
   GeglRectangle  sampler_rectangle;
-  gdouble       *inverse_jacobian;
+  GeglMatrix2   *inverse_jacobian;
   gdouble        x; /* mirrors the currently requested */
   gdouble        y; /* coordinates in the instance     */
 };
diff --git a/gegl/gegl-matrix.h b/gegl/gegl-matrix.h
index 8b5c77b..76a1ee9 100644
--- a/gegl/gegl-matrix.h
+++ b/gegl/gegl-matrix.h
@@ -11,7 +11,7 @@ G_BEGIN_DECLS
  * Note: If making use of this in public API, add a boxed type for introspection
  */
 typedef struct {
-    gdouble coeff [2][2];
+    gdouble coeff[2][2];
 } GeglMatrix2;
 
 /***
diff --git a/operations/affine/affine.c b/operations/affine/affine.c
index 967fadd..a94a4a2 100644
--- a/operations/affine/affine.c
+++ b/operations/affine/affine.c
@@ -681,7 +681,7 @@ affine_generic (GeglBuffer  *dest,
   gfloat * restrict     dest_buf,
                        *dest_ptr;
   GeglMatrix3           inverse;
-  gdouble               inverse_jacobian[4];
+  GeglMatrix2           inverse_jacobian;
   gdouble               u_start,
                         v_start,
                         u_float,
@@ -709,13 +709,13 @@ affine_generic (GeglBuffer  *dest,
 
       gegl_matrix3_copy_into (&inverse, matrix);
       gegl_matrix3_invert (&inverse);
-      inverse_jacobian[0] = inverse.coeff[0][0];
-      inverse_jacobian[1] = inverse.coeff[0][1];
-      inverse_jacobian[2] = inverse.coeff[1][0];
-      inverse_jacobian[3] = inverse.coeff[1][1];
+      inverse_jacobian.coeff[0][0] = inverse.coeff[0][0];
+      inverse_jacobian.coeff[0][1] = inverse.coeff[0][1];
+      inverse_jacobian.coeff[1][0] = inverse.coeff[1][0];
+      inverse_jacobian.coeff[1][1] = inverse.coeff[1][1];
 
      /* set inverse_jacobian for samplers that support it */
-      sampler->inverse_jacobian = inverse_jacobian;
+      sampler->inverse_jacobian = &inverse_jacobian;
 
       u_start = inverse.coeff[0][0] * roi->x + inverse.coeff[0][1]
                     * roi->y + inverse.coeff[0][2];



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