[gimp/soc-2010-cage-2] change name of gimp cage gegl op to gimp internal op.



commit 3d791670747db6ee3b9dfb0fbf57f06c0240433f
Author: Michael Muré <batolettre gmail com>
Date:   Thu Aug 12 13:47:31 2010 +0200

    change name of gimp cage gegl op to gimp internal op.

 app/gegl/gimpoperationcagecoefcalc.c  |    6 ++--
 app/gegl/gimpoperationcagetransform.c |   35 +++++++++-----------------------
 app/tools/gimpcageoptions.c           |    6 ++--
 app/tools/gimpcagetool.c              |    6 ++--
 4 files changed, 19 insertions(+), 34 deletions(-)
---
diff --git a/app/gegl/gimpoperationcagecoefcalc.c b/app/gegl/gimpoperationcagecoefcalc.c
index 2707c0b..8206ff6 100644
--- a/app/gegl/gimpoperationcagecoefcalc.c
+++ b/app/gegl/gimpoperationcagecoefcalc.c
@@ -59,9 +59,9 @@ gimp_operation_cage_coef_calc_class_init (GimpOperationCageCoefCalcClass *klass)
   GeglOperationClass       *operation_class = GEGL_OPERATION_CLASS (klass);
 
   /* FIXME: wrong categories and name, to appears in the gegl tool */
-  operation_class->name               = "gegl:cage_coef_calc";
-  operation_class->categories         = "color";
-  operation_class->description        = "GIMP cage transform";
+  operation_class->name               = "gimp:cage_coef_calc";
+  operation_class->categories         = "transform";
+  operation_class->description        = "GIMP cage transform coefficient calc";
 
   operation_class->prepare            = gimp_operation_cage_coef_calc_prepare;
   operation_class->get_bounding_box   = gimp_operation_cage_coef_calc_get_bounding_box;
diff --git a/app/gegl/gimpoperationcagetransform.c b/app/gegl/gimpoperationcagetransform.c
index 7f1ffbf..9259603 100644
--- a/app/gegl/gimpoperationcagetransform.c
+++ b/app/gegl/gimpoperationcagetransform.c
@@ -86,8 +86,8 @@ gimp_operation_cage_transform_class_init (GimpOperationCageTransformClass *klass
   object_class->finalize              = gimp_operation_cage_transform_finalize;
 
   /* FIXME: wrong categories and name, to appears in the gegl tool */
-  operation_class->name         = "gegl:cage_transform";
-  operation_class->categories   = "color";
+  operation_class->name         = "gimp:cage_transform";
+  operation_class->categories   = "transform";
   operation_class->description  = "GIMP cage reverse transform";
 
   operation_class->prepare      = gimp_operation_cage_transform_prepare;
@@ -292,12 +292,12 @@ gimp_operation_cage_transform_interpolate_source_coords_recurs (GimpOperationCag
   if (p2_d.y > roi->height) return;
   if (p3_d.y > roi->height) return;
 
-  if (p1_d.x < 0) return;
-  if (p2_d.x < 0) return;
-  if (p3_d.x < 0) return;
-  if (p1_d.y < 0) return;
-  if (p2_d.y < 0) return;
-  if (p3_d.y < 0) return;
+  if (p1_d.x <= 0) return;
+  if (p2_d.x <= 0) return;
+  if (p3_d.x <= 0) return;
+  if (p1_d.y <= 0) return;
+  if (p2_d.y <= 0) return;
+  if (p3_d.y <= 0) return;
 
   xmin = xmax = p1_d.x;
   ymin = ymax = p1_d.y;
@@ -427,7 +427,6 @@ gimp_operation_cage_transform_interpolate_source_coords_recurs (GimpOperationCag
                                                                     coords);
   }
 
-
 }
 
 static GimpCoords
@@ -457,28 +456,14 @@ gimp_cage_transform_compute_destination (GimpCageConfig *config,
 
   for(i = 0; i < cvn; i++)
   {
-
-    if (!isnan(coef[i]))
-    {
-      pos_x += coef[i] * config->cage_vertices_d[i].x;
-      pos_y += coef[i] * config->cage_vertices_d[i].y;
-    }
-
-    g_assert (!isnan(pos_x));
-    g_assert (!isnan(pos_y));
+    pos_x += coef[i] * config->cage_vertices_d[i].x;
+    pos_y += coef[i] * config->cage_vertices_d[i].y;
   }
 
   for(i = 0; i < cvn; i++)
   {
-
-    if (!isnan(coef[i]))
-    {
       pos_x += coef[i + cvn] * config->scaling_factor[i] * gimp_cage_config_get_edge_normal (config, i).x;
       pos_y += coef[i + cvn] * config->scaling_factor[i] * gimp_cage_config_get_edge_normal (config, i).y;
-    }
-
-    g_assert (!isnan(pos_x));
-    g_assert (!isnan(pos_y));
   }
 
   result.x = pos_x;
diff --git a/app/tools/gimpcageoptions.c b/app/tools/gimpcageoptions.c
index f1c7cec..145c10f 100644
--- a/app/tools/gimpcageoptions.c
+++ b/app/tools/gimpcageoptions.c
@@ -50,12 +50,12 @@ static void gimp_cage_options_set_property  (GObject      *object,
                                              guint         property_id,
                                              const GValue *value,
                                              GParamSpec   *pspec);
-                                 
+
 static void gimp_cage_options_get_property  (GObject    *object,
                                              guint       property_id,
                                              GValue     *value,
                                              GParamSpec *pspec);
-                                 
+
 G_DEFINE_TYPE (GimpCageOptions, gimp_cage_options,
                GIMP_TYPE_TRANSFORM_OPTIONS)
 
@@ -80,7 +80,7 @@ gimp_cage_options_class_init (GimpCageOptionsClass *klass)
 static void
 gimp_cage_options_init (GimpCageOptions *options)
 {
-	
+
 }
 
 static void
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index a9a11c9..bbaab2b 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -583,7 +583,7 @@ gimp_cage_tool_compute_coef (GimpCageTool *ct,
   gegl = gegl_node_new ();
 
   input = gegl_node_new_child (gegl,
-                                "operation", "gegl:cage_coef_calc",
+                                "operation", "gimp:cage_coef_calc",
                                 "config", ct->config,
                                 NULL);
 
@@ -671,7 +671,7 @@ gimp_cage_tool_process (GimpCageTool *ct,
                                   NULL);
 
     cage = gegl_node_new_child (gegl,
-                                "operation", "gegl:cage_transform",
+                                "operation", "gimp:cage_transform",
                                 "config", ct->config,
                                 NULL);
     
@@ -752,7 +752,7 @@ gimp_cage_tool_prepare_preview (GimpCageTool *ct,
                               NULL);
 
   cage = gegl_node_new_child (gegl,
-                                "operation", "gegl:cage",
+                                "operation", "gimp:cage_preview",
                                 "config", ct->config,
                                 NULL);
 



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