gegl r2847 - in trunk: . gegl



Author: ok
Date: Thu Jan  1 21:59:12 2009
New Revision: 2847
URL: http://svn.gnome.org/viewvc/gegl?rev=2847&view=rev

Log:
* gegl/gegl-matrix.[ch]: (gegl_matrix3_debug),
(gegl_matrix3_parse_string), (gegl_matrix3_to_string): document
GeglMatrix.


Modified:
   trunk/ChangeLog
   trunk/gegl/gegl-matrix.c
   trunk/gegl/gegl-matrix.h

Modified: trunk/gegl/gegl-matrix.c
==============================================================================
--- trunk/gegl/gegl-matrix.c	(original)
+++ trunk/gegl/gegl-matrix.c	Thu Jan  1 21:59:12 2009
@@ -23,7 +23,8 @@
 #include "gegl-matrix.h"
 
 
-void gegl_matrix3_debug (GeglMatrix3 matrix)
+#if 0
+static void gegl_matrix3_debug (GeglMatrix3 matrix)
 {
   if (matrix)
     {
@@ -36,6 +37,7 @@
       g_print("NULL matrix\n");
     }
 }
+#endif
 
 void
 gegl_matrix3_identity (GeglMatrix3 matrix)
@@ -232,7 +234,6 @@
           {
             a = strtod(p, &p);
             matrix [j][i] = a;
-            g_print ("%f\n", a);
             if (!p) return;
             p = strchr (p, ',');
             if (!p) return;
@@ -260,6 +261,5 @@
   res = str->str;
   g_string_free (str, FALSE);
 
-  g_print (",,.. %s ,....\n", res);
   return res;
 }

Modified: trunk/gegl/gegl-matrix.h
==============================================================================
--- trunk/gegl/gegl-matrix.h	(original)
+++ trunk/gegl/gegl-matrix.h	Thu Jan  1 21:59:12 2009
@@ -3,29 +3,157 @@
 
 #include <glib.h>
 
+/***
+ * GeglMatrix:
+ *
+ * #GeglMatrix a 3x3 matrix for GEGL represented by the structure:
+ * Matrixes are currently used by #GeglPath and the affine operations,
+ * they might be used more centrally in the core of GEGL later.
+ *
+ * typedef gdouble GeglMatrix3 [3][3];
+ */
+
 typedef gdouble GeglMatrix3 [3][3];
 
+/**
+ * gegl_matrix3_identity:
+ * @matrix: a #GeglMatrix
+ *
+ * Set the provided @matrix to the identity matrix.
+ */
 void       gegl_matrix3_identity        (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_equal:
+ * @matrix1: a #GeglMatrix
+ * @matrix2: a #GeglMatrix
+ *
+ * Check if two matrices are equal.
+ *
+ * Returns TRUE if the matrices are equal.
+ */
 gboolean   gegl_matrix3_equal           (GeglMatrix3 matrix1,
                                          GeglMatrix3 matrix2);
+
+/**
+ * gegl_matrix3_is_identity:
+ * @matrix: a #GeglMatrix
+ *
+ * Check if a matrix is the identity matrix.
+ *
+ * Returns TRUE if the matrix is the identity matrix.
+ */
 gboolean   gegl_matrix3_is_identity     (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_is_scale:
+ * @matrix: a #GeglMatrix
+ *
+ * Check if a matrix only does scaling.
+ *
+ * Returns TRUE if the matrix only does scaling.
+ */
 gboolean   gegl_matrix3_is_scale        (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_is_translate:
+ * @matrix: a #GeglMatrix
+ *
+ * Check if a matrix only does translation.
+ *
+ * Returns TRUE if the matrix only does trasnlation.
+ */
 gboolean   gegl_matrix3_is_translate    (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_copy:
+ * @dst: a #GeglMatrix
+ * @src: a #GeglMatrix
+ *
+ * Copies the matrix in @src into @dst.
+ */
 void       gegl_matrix3_copy            (GeglMatrix3 dst,
                                          GeglMatrix3 src);
+
+/**
+ * gegl_matrix3_determinant:
+ * @matrix: a #GeglMatrix
+ *
+ * Returns the determinant for the matrix.
+ */
 gdouble    gegl_matrix3_determinant     (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_invert:
+ * @matrix: a #GeglMatrix
+ *
+ * Inverts @matrix.
+ */
 void       gegl_matrix3_invert          (GeglMatrix3 matrix);
+
+/**
+ * gegl_matrix3_multiply:
+ * @left: a #GeglMatrix
+ * @right: a #GeglMatrix
+ * @product: a #GeglMatrix to store the result in.
+ *
+ * Multiples @product = @left  @right
+ */
 void       gegl_matrix3_multiply        (GeglMatrix3 left,
                                          GeglMatrix3 right,
                                          GeglMatrix3 product);
+
+/**
+ * gegl_matrix3_originate:
+ * @matrix: a #GeglMatrix
+ * @x: x coordinate of new origin
+ * @y: y coordinate of new origin.
+ * 
+ * Hmm not quite sure what this does.
+ *
+ */
 void       gegl_matrix3_originate       (GeglMatrix3 matrix,
                                          gdouble     x,
                                          gdouble     y);
+
+
+/**
+ * gegl_matrix3_transform_point:
+ * @matrix: a #GeglMatrix
+ * @x: pointer to an x coordinate
+ * @y: pointer to an y coordinate
+ * 
+ * transforms the coordinates provided in @x and @y and changes to the
+ * coordinates gotten when the transformed with the matrix.
+ *
+ */
 void       gegl_matrix3_transform_point (GeglMatrix3 matrix,
                                          gdouble    *x,
                                          gdouble    *y);
+
+/**
+ * gegl_matrix3_parse_string:
+ * @matrix: a #GeglMatrix
+ * @string: a string describing the matrix (right now a small subset of the
+ * transform strings allowed by SVG)
+ *
+ * Parse a transofmation matrix from a string.
+ */
 void       gegl_matrix3_parse_string    (GeglMatrix3 matrix,
                                          const gchar *string);
+/**
+ * gegl_matrix3_to_string:
+ * @matrix: a #GeglMatrix
+ *
+ * Serialize a #GeglMatrix to a string.
+ *
+ * Returns a freshly allocated string representing that #GeglMatrix, the
+ * returned string should be g_free()'d.
+ *
+ */
 gchar *    gegl_matrix3_to_string       (GeglMatrix3 matrix);
 
+/***
+ */
+
 #endif



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