[gegl] transform-op: complete the renaming of affine to transform
- From: Michael Murà <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] transform-op: complete the renaming of affine to transform
- Date: Mon, 18 Jun 2012 12:08:08 +0000 (UTC)
commit ccd1bd972a77c64d762a20ec505ffd4a37fec47f
Author: Michael Murà <mure michael gmail com>
Date: Sun Jun 10 16:06:34 2012 +0900
transform-op: complete the renaming of affine to transform
operations/transform/chant.h | 10 +-
operations/transform/module.c | 10 +-
operations/transform/module.h | 6 +-
operations/transform/transform-core.c | 380 ++++++++++++++++----------------
operations/transform/transform-core.h | 20 +-
5 files changed, 213 insertions(+), 213 deletions(-)
---
diff --git a/operations/transform/chant.h b/operations/transform/chant.h
index cafef34..3e0b590 100644
--- a/operations/transform/chant.h
+++ b/operations/transform/chant.h
@@ -15,8 +15,8 @@
#define GEGL_CHANT_PARENT_TypeName OpTransform
#define GEGL_CHANT_PARENT_TypeNameClass OpTransformClass
-#define GEGL_CHANT_PARENT_TYPE TYPE_OP_AFFINE
-#define GEGL_CHANT_PARENT_CLASS OP_AFFINE_CLASS
+#define GEGL_CHANT_PARENT_TYPE TYPE_OP_TRANSFORM
+#define GEGL_CHANT_PARENT_CLASS OP_TRANSFORM_CLASS
typedef struct Generated GeglChantOperation;
typedef struct GeneratedClass ChantClass;
@@ -89,7 +89,7 @@ type_name##_get_type (void) \
NULL /* value_table */ \
}; \
g_define_type_id = \
- gegl_module_register_type (affine_module_get_module (), TYPE_PARENT,\
+ gegl_module_register_type (transform_module_get_module (), TYPE_PARENT,\
"GeglOpPlugIn-" #type_name,\
&g_define_type_info, 0);\
{ CODE ; }\
@@ -252,8 +252,8 @@ gegl_chant_constructor (GType type,
static void class_init (GeglOperationClass *operation_class);
#endif
-static void create_matrix (OpTransform *affine,
- GeglMatrix3 *matrix);
+static void create_matrix (OpTransform *transform,
+ GeglMatrix3 *matrix);
static void
gegl_chant_class_init (ChantClass * klass)
diff --git a/operations/transform/module.c b/operations/transform/module.c
index 1833e95..34976ac 100644
--- a/operations/transform/module.c
+++ b/operations/transform/module.c
@@ -21,16 +21,16 @@
#include "module.h"
#include "transform-core.h"
-static GTypeModule *affine_module;
+static GTypeModule *transform_module;
static const GeglModuleInfo modinfo =
{
GEGL_MODULE_ABI_VERSION
};
G_MODULE_EXPORT GTypeModule *
-affine_module_get_module (void)
+transform_module_get_module (void)
{
- return affine_module;
+ return transform_module;
}
G_MODULE_EXPORT const GeglModuleInfo *
@@ -52,9 +52,9 @@ G_MODULE_EXPORT gboolean
gegl_module_register (GTypeModule *module)
{
GType dummy;
- affine_module = module;
+ transform_module = module;
- dummy = op_affine_get_type ();
+ dummy = op_transform_get_type ();
dummy = rotate_get_type ();
dummy = scale_get_type ();
dummy = scaleratio_get_type ();
diff --git a/operations/transform/module.h b/operations/transform/module.h
index a29819f..797d827 100644
--- a/operations/transform/module.h
+++ b/operations/transform/module.h
@@ -1,12 +1,12 @@
-#ifndef __AFFINE_MODULE_H__
-#define __AFFINE_MODULE_H__
+#ifndef __TRANSFORM_MODULE_H__
+#define __TRANSFORM_MODULE_H__
G_BEGIN_DECLS
#include <glib-object.h>
#include <gegl-plugin.h>
-G_MODULE_EXPORT GTypeModule * affine_module_get_module (void);
+G_MODULE_EXPORT GTypeModule * transform_module_get_module (void);
G_MODULE_EXPORT const GeglModuleInfo * gegl_module_query (GTypeModule *module);
G_MODULE_EXPORT gboolean gegl_module_register (GTypeModule *module);
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 6cbd562..385caee 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -53,70 +53,70 @@ enum
PROP_LANCZOS_WIDTH
};
-static void gegl_affine_finalize (GObject *object);
-static void gegl_affine_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-static void gegl_affine_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gegl_affine_bounding_box (gdouble *points,
- gint num_points,
- GeglRectangle *output);
-static gboolean gegl_affine_is_intermediate_node (OpTransform *affine);
-static gboolean gegl_affine_is_composite_node (OpTransform *affine);
-static void gegl_affine_get_source_matrix (OpTransform *affine,
- GeglMatrix3 *output);
-static GeglRectangle gegl_affine_get_bounding_box (GeglOperation *op);
-static GeglRectangle gegl_affine_get_invalidated_by_change (GeglOperation *operation,
- const gchar *input_pad,
- const GeglRectangle *input_region);
-static GeglRectangle gegl_affine_get_required_for_output (GeglOperation *self,
- const gchar *input_pad,
- const GeglRectangle *region);
-static gboolean gegl_affine_process (GeglOperation *operation,
- GeglOperationContext *context,
- const gchar *output_prop,
- const GeglRectangle *result,
- gint level);
-static GeglNode * gegl_affine_detect (GeglOperation *operation,
- gint x,
- gint y);
+static void gegl_transform_finalize (GObject *object);
+static void gegl_transform_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void gegl_transform_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gegl_transform_bounding_box (gdouble *points,
+ gint num_points,
+ GeglRectangle *output);
+static gboolean gegl_transform_is_intermediate_node (OpTransform *transform);
+static gboolean gegl_transform_is_composite_node (OpTransform *transform);
+static void gegl_transform_get_source_matrix (OpTransform *transform,
+ GeglMatrix3 *output);
+static GeglRectangle gegl_transform_get_bounding_box (GeglOperation *op);
+static GeglRectangle gegl_transform_get_invalidated_by_change (GeglOperation *operation,
+ const gchar *input_pad,
+ const GeglRectangle *input_region);
+static GeglRectangle gegl_transform_get_required_for_output (GeglOperation *self,
+ const gchar *input_pad,
+ const GeglRectangle *region);
+static gboolean gegl_transform_process (GeglOperation *operation,
+ GeglOperationContext *context,
+ const gchar *output_prop,
+ const GeglRectangle *result,
+ gint level);
+static GeglNode * gegl_transform_detect (GeglOperation *operation,
+ gint x,
+ gint y);
static gboolean gegl_matrix3_is_affine (GeglMatrix3 *matrix);
-static gboolean gegl_affine_matrix3_allow_fast_translate (GeglMatrix3 *matrix);
-static gboolean gegl_affine_matrix3_allow_fast_reflect_x (GeglMatrix3 *matrix);
-static gboolean gegl_affine_matrix3_allow_fast_reflect_y (GeglMatrix3 *matrix);
-
-static void gegl_affine_fast_reflect_x (GeglBuffer *dest,
- GeglBuffer *src,
- const GeglRectangle *dest_rect,
- const GeglRectangle *src_rect,
- gint level);
-static void gegl_affine_fast_reflect_y (GeglBuffer *dest,
- GeglBuffer *src,
- const GeglRectangle *dest_rect,
- const GeglRectangle *src_rect,
- gint level);
+static gboolean gegl_transform_matrix3_allow_fast_translate (GeglMatrix3 *matrix);
+static gboolean gegl_transform_matrix3_allow_fast_reflect_x (GeglMatrix3 *matrix);
+static gboolean gegl_transform_matrix3_allow_fast_reflect_y (GeglMatrix3 *matrix);
+
+static void gegl_transform_fast_reflect_x (GeglBuffer *dest,
+ GeglBuffer *src,
+ const GeglRectangle *dest_rect,
+ const GeglRectangle *src_rect,
+ gint level);
+static void gegl_transform_fast_reflect_y (GeglBuffer *dest,
+ GeglBuffer *src,
+ const GeglRectangle *dest_rect,
+ const GeglRectangle *src_rect,
+ gint level);
/* ************************* */
-static void op_affine_init (OpTransform *self);
-static void op_affine_class_init (OpTransformClass *klass);
-static gpointer op_affine_parent_class = NULL;
+static void op_transform_init (OpTransform *self);
+static void op_transform_class_init (OpTransformClass *klass);
+static gpointer op_transform_parent_class = NULL;
static void
-op_affine_class_intern_init (gpointer klass)
+op_transform_class_intern_init (gpointer klass)
{
- op_affine_parent_class = g_type_class_peek_parent (klass);
- op_affine_class_init ((OpTransformClass *) klass);
+ op_transform_parent_class = g_type_class_peek_parent (klass);
+ op_transform_class_init ((OpTransformClass *) klass);
}
GType
-op_affine_get_type (void)
+op_transform_get_type (void)
{
static GType g_define_type_id = 0;
if (G_UNLIKELY (g_define_type_id == 0))
@@ -126,19 +126,19 @@ op_affine_get_type (void)
sizeof (OpTransformClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- (GClassInitFunc) op_affine_class_intern_init,
+ (GClassInitFunc) op_transform_class_intern_init,
(GClassFinalizeFunc) NULL,
NULL, /* class_data */
sizeof (OpTransform),
0, /* n_preallocs */
- (GInstanceInitFunc) op_affine_init,
+ (GInstanceInitFunc) op_transform_init,
NULL /* value_table */
};
g_define_type_id =
- gegl_module_register_type (affine_module_get_module (),
+ gegl_module_register_type (transform_module_get_module (),
GEGL_TYPE_OPERATION_FILTER,
- "GeglOpPlugIn-affine",
+ "GeglOpPlugIn-transform-core",
&g_define_type_info, 0);
}
return g_define_type_id;
@@ -167,7 +167,7 @@ op_affine_sampler_init (OpTransform *self)
#endif
static void
-gegl_affine_prepare (GeglOperation *operation)
+gegl_transform_prepare (GeglOperation *operation)
{
const Babl *format = babl_format ("RaGaBaA float");
gegl_operation_set_format (operation, "input", format);
@@ -175,21 +175,21 @@ gegl_affine_prepare (GeglOperation *operation)
}
static void
-op_affine_class_init (OpTransformClass *klass)
+op_transform_class_init (OpTransformClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GeglOperationClass *op_class = GEGL_OPERATION_CLASS (klass);
- gobject_class->set_property = gegl_affine_set_property;
- gobject_class->get_property = gegl_affine_get_property;
- gobject_class->finalize = gegl_affine_finalize;
+ gobject_class->set_property = gegl_transform_set_property;
+ gobject_class->get_property = gegl_transform_get_property;
+ gobject_class->finalize = gegl_transform_finalize;
- op_class->get_invalidated_by_change = gegl_affine_get_invalidated_by_change;
- op_class->get_bounding_box = gegl_affine_get_bounding_box;
- op_class->get_required_for_output = gegl_affine_get_required_for_output;
- op_class->detect = gegl_affine_detect;
- op_class->process = gegl_affine_process;
- op_class->prepare = gegl_affine_prepare;
+ op_class->get_invalidated_by_change = gegl_transform_get_invalidated_by_change;
+ op_class->get_bounding_box = gegl_transform_get_bounding_box;
+ op_class->get_required_for_output = gegl_transform_get_required_for_output;
+ op_class->detect = gegl_transform_detect;
+ op_class->process = gegl_transform_process;
+ op_class->prepare = gegl_transform_prepare;
op_class->no_cache = TRUE;
klass->create_matrix = NULL;
@@ -236,24 +236,24 @@ op_affine_class_init (OpTransformClass *klass)
}
static void
-gegl_affine_finalize (GObject *object)
+gegl_transform_finalize (GObject *object)
{
- g_free (OP_AFFINE (object)->filter);
- G_OBJECT_CLASS (op_affine_parent_class)->finalize (object);
+ g_free (OP_TRANSFORM (object)->filter);
+ G_OBJECT_CLASS (op_transform_parent_class)->finalize (object);
}
static void
-op_affine_init (OpTransform *self)
+op_transform_init (OpTransform *self)
{
}
static void
-gegl_affine_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+gegl_transform_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- OpTransform *self = OP_AFFINE (object);
+ OpTransform *self = OP_TRANSFORM (object);
switch (prop_id)
{
@@ -279,12 +279,12 @@ gegl_affine_get_property (GObject *object,
}
static void
-gegl_affine_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+gegl_transform_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- OpTransform *self = OP_AFFINE (object);
+ OpTransform *self = OP_TRANSFORM (object);
switch (prop_id)
{
@@ -311,37 +311,37 @@ gegl_affine_set_property (GObject *object,
}
static void
-gegl_affine_create_matrix (OpTransform *affine,
- GeglMatrix3 *matrix)
+gegl_transform_create_matrix (OpTransform *transform,
+ GeglMatrix3 *matrix)
{
gegl_matrix3_identity (matrix);
- if (OP_AFFINE_GET_CLASS (affine))
- OP_AFFINE_GET_CLASS (affine)->create_matrix (affine, matrix);
+ if (OP_TRANSFORM_GET_CLASS (transform))
+ OP_TRANSFORM_GET_CLASS (transform)->create_matrix (transform, matrix);
}
static void
-gegl_affine_create_composite_matrix (OpTransform *affine,
- GeglMatrix3 *matrix)
+gegl_transform_create_composite_matrix (OpTransform *transform,
+ GeglMatrix3 *matrix)
{
- gegl_affine_create_matrix (affine, matrix);
+ gegl_transform_create_matrix (transform, matrix);
- if (affine->origin_x || affine->origin_y)
- gegl_matrix3_originate (matrix, affine->origin_x, affine->origin_y);
+ if (transform->origin_x || transform->origin_y)
+ gegl_matrix3_originate (matrix, transform->origin_x, transform->origin_y);
- if (gegl_affine_is_composite_node (affine))
+ if (gegl_transform_is_composite_node (transform))
{
GeglMatrix3 source;
- gegl_affine_get_source_matrix (affine, &source);
+ gegl_transform_get_source_matrix (transform, &source);
gegl_matrix3_multiply (matrix, &source, matrix);
}
}
static void
-gegl_affine_bounding_box (gdouble *points,
- gint num_points,
- GeglRectangle *output)
+gegl_transform_bounding_box (gdouble *points,
+ gint num_points,
+ GeglRectangle *output)
{
gint i;
gdouble min_x,
@@ -378,10 +378,10 @@ gegl_affine_bounding_box (gdouble *points,
}
static gboolean
-gegl_affine_is_intermediate_node (OpTransform *affine)
+gegl_transform_is_intermediate_node (OpTransform *transform)
{
GSList *connections;
- GeglOperation *op = GEGL_OPERATION (affine);
+ GeglOperation *op = GEGL_OPERATION (transform);
connections = gegl_pad_get_connections (gegl_node_get_pad (op->node,
"output"));
@@ -394,8 +394,8 @@ gegl_affine_is_intermediate_node (OpTransform *affine)
sink = gegl_connection_get_sink_node (connections->data)->operation;
- if (! IS_OP_AFFINE (sink) ||
- strcmp (affine->filter, OP_AFFINE (sink)->filter))
+ if (! IS_OP_TRANSFORM (sink) ||
+ strcmp (transform->filter, OP_TRANSFORM (sink)->filter))
return FALSE;
}
while ((connections = g_slist_next (connections)));
@@ -404,10 +404,10 @@ gegl_affine_is_intermediate_node (OpTransform *affine)
}
static gboolean
-gegl_affine_is_composite_node (OpTransform *affine)
+gegl_transform_is_composite_node (OpTransform *transform)
{
GSList *connections;
- GeglOperation *op = GEGL_OPERATION (affine);
+ GeglOperation *op = GEGL_OPERATION (transform);
GeglOperation *source;
connections = gegl_pad_get_connections (gegl_node_get_pad (op->node,
@@ -417,16 +417,16 @@ gegl_affine_is_composite_node (OpTransform *affine)
source = gegl_connection_get_source_node (connections->data)->operation;
- return (IS_OP_AFFINE (source) &&
- ! strcmp (affine->filter, OP_AFFINE (source)->filter));
+ return (IS_OP_TRANSFORM (source) &&
+ ! strcmp (transform->filter, OP_TRANSFORM (source)->filter));
}
static void
-gegl_affine_get_source_matrix (OpTransform *affine,
- GeglMatrix3 *output)
+gegl_transform_get_source_matrix (OpTransform *transform,
+ GeglMatrix3 *output)
{
GSList *connections;
- GeglOperation *op = GEGL_OPERATION (affine);
+ GeglOperation *op = GEGL_OPERATION (transform);
GeglOperation *source;
connections = gegl_pad_get_connections (gegl_node_get_pad (op->node,
@@ -434,16 +434,16 @@ gegl_affine_get_source_matrix (OpTransform *affine,
g_assert (connections);
source = gegl_connection_get_source_node (connections->data)->operation;
- g_assert (IS_OP_AFFINE (source));
+ g_assert (IS_OP_TRANSFORM (source));
- gegl_affine_create_composite_matrix (OP_AFFINE (source), output);
- /*gegl_matrix3_copy (output, OP_AFFINE (source)->matrix);*/
+ gegl_transform_create_composite_matrix (OP_TRANSFORM (source), output);
+ /*gegl_matrix3_copy (output, OP_TRANSFORM (source)->matrix);*/
}
static GeglRectangle
-gegl_affine_get_bounding_box (GeglOperation *op)
+gegl_transform_get_bounding_box (GeglOperation *op)
{
- OpTransform *affine = OP_AFFINE (op);
+ OpTransform *transform = OP_TRANSFORM (op);
GeglMatrix3 matrix;
GeglRectangle in_rect = {0,0,0,0},
have_rect;
@@ -454,22 +454,22 @@ gegl_affine_get_bounding_box (GeglOperation *op)
GeglSampler *sampler;
sampler = gegl_buffer_sampler_new (NULL, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
context_rect = *gegl_sampler_get_context_rect (sampler);
g_object_unref (sampler);
if (gegl_operation_source_get_bounding_box (op, "input"))
in_rect = *gegl_operation_source_get_bounding_box (op, "input");
- gegl_affine_create_composite_matrix (affine, &matrix);
+ gegl_transform_create_composite_matrix (transform, &matrix);
- if (gegl_affine_is_intermediate_node (affine) ||
+ if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&matrix))
{
return in_rect;
}
- if (!gegl_affine_matrix3_allow_fast_translate (&matrix))
+ if (!gegl_transform_matrix3_allow_fast_translate (&matrix))
{
in_rect.x += context_rect.x;
in_rect.y += context_rect.y;
@@ -493,22 +493,22 @@ gegl_affine_get_bounding_box (GeglOperation *op)
gegl_matrix3_transform_point (&matrix,
have_points + i, have_points + i + 1);
- gegl_affine_bounding_box (have_points, 4, &have_rect);
+ gegl_transform_bounding_box (have_points, 4, &have_rect);
return have_rect;
}
static GeglNode *
-gegl_affine_detect (GeglOperation *operation,
- gint x,
- gint y)
+gegl_transform_detect (GeglOperation *operation,
+ gint x,
+ gint y)
{
- OpTransform *affine = OP_AFFINE (operation);
+ OpTransform *transform = OP_TRANSFORM (operation);
GeglNode *source_node = gegl_operation_get_source_node (operation, "input");
GeglMatrix3 inverse;
gdouble need_points [2];
gint i;
- if (gegl_affine_is_intermediate_node (affine) ||
+ if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&inverse))
{
return gegl_operation_detect (source_node->operation, x, y);
@@ -517,23 +517,23 @@ gegl_affine_detect (GeglOperation *operation,
need_points [0] = x;
need_points [1] = y;
- gegl_affine_create_matrix (affine, &inverse);
+ gegl_transform_create_matrix (transform, &inverse);
gegl_matrix3_invert (&inverse);
for (i = 0; i < 2; i += 2)
gegl_matrix3_transform_point (&inverse,
- need_points + i, need_points + i + 1);
+ need_points + i, need_points + i + 1);
return gegl_operation_detect (source_node->operation,
need_points[0], need_points[1]);
}
static GeglRectangle
-gegl_affine_get_required_for_output (GeglOperation *op,
- const gchar *input_pad,
- const GeglRectangle *region)
+gegl_transform_get_required_for_output (GeglOperation *op,
+ const gchar *input_pad,
+ const GeglRectangle *region)
{
- OpTransform *affine = OP_AFFINE (op);
+ OpTransform *transform = OP_TRANSFORM (op);
GeglMatrix3 inverse;
GeglRectangle requested_rect,
need_rect;
@@ -544,14 +544,14 @@ gegl_affine_get_required_for_output (GeglOperation *op,
requested_rect = *region;
sampler = gegl_buffer_sampler_new (NULL, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
context_rect = *gegl_sampler_get_context_rect (sampler);
g_object_unref (sampler);
- gegl_affine_create_composite_matrix (affine, &inverse);
+ gegl_transform_create_composite_matrix (transform, &inverse);
gegl_matrix3_invert (&inverse);
- if (gegl_affine_is_intermediate_node (affine) ||
+ if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&inverse))
{
return requested_rect;
@@ -571,8 +571,8 @@ gegl_affine_get_required_for_output (GeglOperation *op,
for (i = 0; i < 8; i += 2)
gegl_matrix3_transform_point (&inverse,
- need_points + i, need_points + i + 1);
- gegl_affine_bounding_box (need_points, 4, &need_rect);
+ need_points + i, need_points + i + 1);
+ gegl_transform_bounding_box (need_points, 4, &need_rect);
need_rect.x += context_rect.x;
need_rect.y += context_rect.y;
@@ -582,11 +582,11 @@ gegl_affine_get_required_for_output (GeglOperation *op,
}
static GeglRectangle
-gegl_affine_get_invalidated_by_change (GeglOperation *op,
- const gchar *input_pad,
- const GeglRectangle *input_region)
+gegl_transform_get_invalidated_by_change (GeglOperation *op,
+ const gchar *input_pad,
+ const GeglRectangle *input_region)
{
- OpTransform *affine = OP_AFFINE (op);
+ OpTransform *transform = OP_TRANSFORM (op);
GeglMatrix3 matrix;
GeglRectangle affected_rect;
GeglRectangle context_rect;
@@ -596,24 +596,24 @@ gegl_affine_get_invalidated_by_change (GeglOperation *op,
GeglRectangle region = *input_region;
sampler = gegl_buffer_sampler_new (NULL, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
context_rect = *gegl_sampler_get_context_rect (sampler);
g_object_unref (sampler);
- gegl_affine_create_matrix (affine, &matrix);
+ gegl_transform_create_matrix (transform, &matrix);
- if (affine->origin_x || affine->origin_y)
- gegl_matrix3_originate (&matrix, affine->origin_x, affine->origin_y);
+ if (transform->origin_x || transform->origin_y)
+ gegl_matrix3_originate (&matrix, transform->origin_x, transform->origin_y);
- if (gegl_affine_is_composite_node (affine))
+ if (gegl_transform_is_composite_node (transform))
{
GeglMatrix3 source;
- gegl_affine_get_source_matrix (affine, &source);
+ gegl_transform_get_source_matrix (transform, &source);
gegl_matrix3_multiply (&matrix, &source, &matrix);
}
- if (gegl_affine_is_intermediate_node (affine) ||
+ if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&matrix))
{
return region;
@@ -640,16 +640,16 @@ gegl_affine_get_invalidated_by_change (GeglOperation *op,
gegl_matrix3_transform_point (&matrix,
affected_points + i, affected_points + i + 1);
- gegl_affine_bounding_box (affected_points, 4, &affected_rect);
+ gegl_transform_bounding_box (affected_points, 4, &affected_rect);
return affected_rect;
}
static void
-affine_affine (GeglBuffer *dest,
- GeglBuffer *src,
- GeglMatrix3 *matrix,
- GeglSampler *sampler,
- gint level)
+transform_affine (GeglBuffer *dest,
+ GeglBuffer *src,
+ GeglMatrix3 *matrix,
+ GeglSampler *sampler,
+ gint level)
{
GeglBufferIterator *i;
const GeglRectangle *dest_extent;
@@ -671,7 +671,7 @@ affine_affine (GeglBuffer *dest,
format = babl_format ("RaGaBaA float");
- /* XXX: fast paths as existing in files in the same dir as affine.c
+ /* XXX: fast paths as existing in files in the same dir as transform.c
* should probably be hooked in here, and bailing out before using
* the generic code.
*/
@@ -725,11 +725,11 @@ affine_affine (GeglBuffer *dest,
}
static void
-affine_generic (GeglBuffer *dest,
- GeglBuffer *src,
- GeglMatrix3 *matrix,
- GeglSampler *sampler,
- gint level)
+transform_generic (GeglBuffer *dest,
+ GeglBuffer *src,
+ GeglMatrix3 *matrix,
+ GeglSampler *sampler,
+ gint level)
{
GeglBufferIterator *i;
const GeglRectangle *dest_extent;
@@ -750,7 +750,7 @@ affine_generic (GeglBuffer *dest,
format = babl_format ("RaGaBaA float");
- /* XXX: fast paths as existing in files in the same dir as affine.c
+ /* XXX: fast paths as existing in files in the same dir as transform.c
* should probably be hooked in here, and bailing out before using
* the generic code.
*/
@@ -826,7 +826,7 @@ static gboolean gegl_matrix3_is_affine (GeglMatrix3 *matrix)
}
static gboolean
-gegl_affine_matrix3_allow_fast_translate (GeglMatrix3 *matrix)
+gegl_transform_matrix3_allow_fast_translate (GeglMatrix3 *matrix)
{
if (! GEGL_FLOAT_EQUAL (matrix->coeff[0][2], (gint) matrix->coeff[0][2]) ||
! GEGL_FLOAT_EQUAL (matrix->coeff[1][2], (gint) matrix->coeff[1][2]))
@@ -835,7 +835,7 @@ gegl_affine_matrix3_allow_fast_translate (GeglMatrix3 *matrix)
}
static gboolean
-gegl_affine_matrix3_allow_fast_reflect_x (GeglMatrix3 *matrix)
+gegl_transform_matrix3_allow_fast_reflect_x (GeglMatrix3 *matrix)
{
GeglMatrix3 copy;
@@ -843,11 +843,11 @@ gegl_affine_matrix3_allow_fast_reflect_x (GeglMatrix3 *matrix)
return FALSE;
gegl_matrix3_copy_into (©, matrix);
copy.coeff[1][1] = 1.;
- return gegl_affine_matrix3_allow_fast_translate (©);
+ return gegl_transform_matrix3_allow_fast_translate (©);
}
static gboolean
-gegl_affine_matrix3_allow_fast_reflect_y (GeglMatrix3 *matrix)
+gegl_transform_matrix3_allow_fast_reflect_y (GeglMatrix3 *matrix)
{
GeglMatrix3 copy;
@@ -855,15 +855,15 @@ gegl_affine_matrix3_allow_fast_reflect_y (GeglMatrix3 *matrix)
return FALSE;
gegl_matrix3_copy_into (©, matrix);
copy.coeff[0][0] = 1.;
- return gegl_affine_matrix3_allow_fast_translate (©);
+ return gegl_transform_matrix3_allow_fast_translate (©);
}
static void
-gegl_affine_fast_reflect_x (GeglBuffer *dest,
- GeglBuffer *src,
- const GeglRectangle *dest_rect,
- const GeglRectangle *src_rect,
- gint level)
+gegl_transform_fast_reflect_x (GeglBuffer *dest,
+ GeglBuffer *src,
+ const GeglRectangle *dest_rect,
+ const GeglRectangle *src_rect,
+ gint level)
{
const Babl *format = gegl_buffer_get_format (src);
const gint px_size = babl_format_get_bytes_per_pixel (format),
@@ -896,11 +896,11 @@ gegl_affine_fast_reflect_x (GeglBuffer *dest,
}
static void
-gegl_affine_fast_reflect_y (GeglBuffer *dest,
- GeglBuffer *src,
- const GeglRectangle *dest_rect,
- const GeglRectangle *src_rect,
- gint level)
+gegl_transform_fast_reflect_y (GeglBuffer *dest,
+ GeglBuffer *src,
+ const GeglRectangle *dest_rect,
+ const GeglRectangle *src_rect,
+ gint level)
{
const Babl *format = gegl_buffer_get_format (src);
const gint px_size = babl_format_get_bytes_per_pixel (format),
@@ -942,20 +942,20 @@ gegl_affine_fast_reflect_y (GeglBuffer *dest,
}
static gboolean
-gegl_affine_process (GeglOperation *operation,
- GeglOperationContext *context,
- const gchar *output_prop,
- const GeglRectangle *result,
- gint level)
+gegl_transform_process (GeglOperation *operation,
+ GeglOperationContext *context,
+ const gchar *output_prop,
+ const GeglRectangle *result,
+ gint level)
{
GeglBuffer *input;
GeglBuffer *output;
GeglMatrix3 matrix;
- OpTransform *affine = (OpTransform *) operation;
+ OpTransform *transform = (OpTransform *) operation;
- gegl_affine_create_composite_matrix (affine, &matrix);
+ gegl_transform_create_composite_matrix (transform, &matrix);
- if (gegl_affine_is_intermediate_node (affine) ||
+ if (gegl_transform_is_intermediate_node (transform) ||
gegl_matrix3_is_identity (&matrix))
{
/* passing straight through (like gegl:nop) */
@@ -968,9 +968,9 @@ gegl_affine_process (GeglOperation *operation,
gegl_operation_context_take_object (context, "output", G_OBJECT (input));
}
- else if (gegl_affine_matrix3_allow_fast_translate (&matrix) ||
+ else if (gegl_transform_matrix3_allow_fast_translate (&matrix) ||
(gegl_matrix3_is_translate (&matrix) &&
- ! strcmp (affine->filter, "nearest")))
+ ! strcmp (transform->filter, "nearest")))
{
/* doing a buffer shifting trick, (enhanced nop) */
input = gegl_operation_context_get_source (context, "input");
@@ -992,7 +992,7 @@ gegl_affine_process (GeglOperation *operation,
if (input != NULL)
g_object_unref (input);
}
- else if (gegl_affine_matrix3_allow_fast_reflect_x (&matrix))
+ else if (gegl_transform_matrix3_allow_fast_reflect_x (&matrix))
{
GeglRectangle src_rect;
GeglSampler *sampler;
@@ -1011,19 +1011,19 @@ gegl_affine_process (GeglOperation *operation,
src_rect.y += 1;
sampler = gegl_buffer_sampler_new (input, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
context_rect = *gegl_sampler_get_context_rect (sampler);
src_rect.width -= context_rect.width;
src_rect.height -= context_rect.height;
- gegl_affine_fast_reflect_x (output, input, result, &src_rect, context->level);
+ gegl_transform_fast_reflect_x (output, input, result, &src_rect, context->level);
g_object_unref (sampler);
if (input != NULL)
g_object_unref (input);
}
- else if (gegl_affine_matrix3_allow_fast_reflect_y (&matrix))
+ else if (gegl_transform_matrix3_allow_fast_reflect_y (&matrix))
{
GeglRectangle src_rect;
GeglSampler *sampler;
@@ -1042,13 +1042,13 @@ gegl_affine_process (GeglOperation *operation,
src_rect.x += 1;
sampler = gegl_buffer_sampler_new (input, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
context_rect = *gegl_sampler_get_context_rect (sampler);
src_rect.width -= context_rect.width;
src_rect.height -= context_rect.height;
- gegl_affine_fast_reflect_y (output, input, result, &src_rect, context->level);
+ gegl_transform_fast_reflect_y (output, input, result, &src_rect, context->level);
g_object_unref (sampler);
if (input != NULL)
@@ -1063,15 +1063,15 @@ gegl_affine_process (GeglOperation *operation,
output = gegl_operation_context_get_target (context, "output");
sampler = gegl_buffer_sampler_new (input, babl_format("RaGaBaA float"),
- gegl_sampler_type_from_string (affine->filter));
+ gegl_sampler_type_from_string (transform->filter));
if (gegl_matrix3_is_affine (&matrix))
{
- affine_affine (output, input, &matrix, sampler, context->level);
+ transform_affine (output, input, &matrix, sampler, context->level);
}
else
{
- affine_generic (output, input, &matrix, sampler, context->level);
+ transform_generic (output, input, &matrix, sampler, context->level);
}
g_object_unref (sampler);
diff --git a/operations/transform/transform-core.h b/operations/transform/transform-core.h
index a5200af..0a00811 100644
--- a/operations/transform/transform-core.h
+++ b/operations/transform/transform-core.h
@@ -1,17 +1,17 @@
-#ifndef __OP_AFFINE_H__
-#define __OP_AFFINE_H__
+#ifndef __OP_TRANSFORM_H__
+#define __OP_TRANSFORM_H__
#include "gegl-buffer-private.h"
#include <gegl-matrix.h>
G_BEGIN_DECLS
-#define TYPE_OP_AFFINE (op_affine_get_type ())
-#define OP_AFFINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OP_AFFINE, OpTransform))
-#define OP_AFFINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OP_AFFINE, OpTransformClass))
-#define IS_OP_AFFINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OP_AFFINE))
-#define IS_OP_AFFINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OP_AFFINE))
-#define OP_AFFINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OP_AFFINE, OpTransformClass))
+#define TYPE_OP_TRANSFORM (op_transform_get_type ())
+#define OP_TRANSFORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OP_TRANSFORM, OpTransform))
+#define OP_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OP_TRANSFORM, OpTransformClass))
+#define IS_OP_TRANSFORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OP_TRANSFORM))
+#define IS_OP_TRANSFORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OP_TRANSFORM))
+#define OP_TRANSFORM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OP_TRANSFORM, OpTransformClass))
typedef struct _OpTransform OpTransform;
@@ -31,11 +31,11 @@ struct _OpTransformClass
{
GeglOperationFilterClass parent_class;
- void (* create_matrix) (OpTransform *affine,
+ void (* create_matrix) (OpTransform *transform,
GeglMatrix3 *matrix);
};
-GType op_affine_get_type (void) G_GNUC_CONST;
+GType op_transform_get_type (void) G_GNUC_CONST;
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]