From 3895dc07a95195a7ed5fcc30aa2ddc4f2deafd01 Mon Sep 17 00:00:00 2001 From: Ell Date: Wed, 29 May 2019 04:37:29 -0400 Subject: [PATCH] app: add gimp_gegl_create_transform_node() ... which takes a GimpMatrix3, and returns a corresponding gegl:transform node. --- app/gegl/gimp-gegl-nodes.c | 16 ++++++++++++++++ app/gegl/gimp-gegl-nodes.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c index 197109d8be..0dde5199c6 100644 --- a/app/gegl/gimp-gegl-nodes.c +++ b/app/gegl/gimp-gegl-nodes.c @@ -126,6 +126,22 @@ gimp_gegl_create_apply_opacity_node (GeglBuffer *mask, return node; } +GeglNode * +gimp_gegl_create_transform_node (const GimpMatrix3 *matrix) +{ + GeglNode *node; + + g_return_val_if_fail (matrix != NULL, NULL); + + node = gegl_node_new_child (NULL, + "operation", "gegl:transform", + NULL); + + gimp_gegl_node_set_matrix (node, matrix); + + return node; +} + GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent, GeglBuffer *buffer, diff --git a/app/gegl/gimp-gegl-nodes.h b/app/gegl/gimp-gegl-nodes.h index 55c033e32f..67a191a253 100644 --- a/app/gegl/gimp-gegl-nodes.h +++ b/app/gegl/gimp-gegl-nodes.h @@ -29,6 +29,8 @@ GeglNode * gimp_gegl_create_apply_opacity_node (GeglBuffer *mask, gint mask_offset_x, gint mask_offset_y, gdouble opacity); +GeglNode * gimp_gegl_create_transform_node (const GimpMatrix3 *matrix); + GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent, GeglBuffer *buffer, gint offset_x,