|
GimpChat Member |
|
Joined: Oct 31, 2020 Posts: 1450
|
The legacy GEGL plugin from 2012 is compiled. Now I have to compile the legacy operations it depends on like legacy gaussian-blur, legacy emboss, and box-max, ect.. Here is the code /* This file is an image processing operation for GEGL * * GEGL is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * GEGL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with GEGL; if not, see <http://www.gnu.org/licenses/>. * * Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* 2024 Beaver, Exercise to make a simple GEGL plugin (a hard light bevel) using legacy GEGL 0.2 from 2012 The goal is to show off that It was possible to make GEGL plugins long ago. I could not not get any earlier GEGL version to work in Gimp 2.10, before 2012. Perhaps one day I will try this on Gimp 2.6 */
#include "config.h" #include <glib/gi18n-lib.h>
#ifdef GEGL_CHANT_PROPERTIES
gegl_chant_double (tweakbevel, _("Square Pixel formation Tweak"), 0.0, 2.0, 0.0, _("This will add a faint pixelize effect and possibly fix a bug with gegl:opacity"))
gegl_chant_double (expandbevel, _("Size of bevel"), 1.0, 3.0, 2.0, _("Size of Bevel"))
gegl_chant_double (hyperopacity, _("Hyper Opacity"), 4.0, 10.0, 5.0, _("Global opacity for the bevel."))
gegl_chant_double (azimuth, _("Azimuth"), 0.0, 360.0, 30.0, _("The value of bevel's azimuth"))
gegl_chant_double (elevation, _("Elevation"), 0.0, 180.0, 45.0, _("The value of bevel's elevation"))
gegl_chant_int (depth, _("Depth"), 1, 100, 20, _("The bevel's depth"))
#else
#define GEGL_CHANT_TYPE_META #define GEGL_CHANT_C_FILE "legacybevel.c"
#include "gegl-chant.h"
typedef struct _Priv Priv; struct _Priv { GeglNode *self; GeglNode *input; GeglNode *output;
GeglNode *over; GeglNode *hardlight; GeglNode *opacity; GeglNode *fix; GeglNode *idref; GeglNode *blur; GeglNode *emboss; };
static void attach (GeglOperation *operation) { GeglChantO *o = GEGL_CHANT_PROPERTIES (operation); Priv *priv = g_new0 (Priv, 1);
o->chant_data = (void*) priv;
if (!priv->blur) { GeglNode *gegl; gegl = operation->node;
priv->input = gegl_node_get_input_proxy (gegl, "input"); priv->output = gegl_node_get_output_proxy (gegl, "output");
priv->hardlight = gegl_node_new_child (gegl, "operation", "legacy:hard-light", NULL);
priv->opacity = gegl_node_new_child (gegl, "operation", "legacy:opacity", NULL);
priv->blur = gegl_node_new_child (gegl, "operation", "legacy:gaussian-blur", NULL);
priv->emboss = gegl_node_new_child (gegl, "operation", "legacy:emboss", NULL);
priv->fix = gegl_node_new_child (gegl, "operation", "legacy:box-max", NULL);
priv->idref = gegl_node_new_child (gegl, "operation", "legacy:nop", NULL);
gegl_node_link_many (priv->input, priv->blur, priv->idref, priv->hardlight, priv->opacity, priv->fix, priv->output, NULL); gegl_node_link (priv->idref, priv->emboss); gegl_node_connect_from (priv->hardlight, "aux", priv->emboss, "output");
gegl_operation_meta_redirect (operation, "azimuth", priv->emboss, "azimuth"); gegl_operation_meta_redirect (operation, "depth", priv->emboss, "depth"); gegl_operation_meta_redirect (operation, "elevation", priv->emboss, "elevation"); gegl_operation_meta_redirect (operation, "expandbevel", priv->blur, "std-dev-x"); gegl_operation_meta_redirect (operation, "expandbevel", priv->blur, "std-dev-y"); gegl_operation_meta_redirect (operation, "hyperopacity", priv->opacity, "value"); gegl_operation_meta_redirect (operation, "tweakbevel", priv->fix, "radius");
} }
static void gegl_chant_class_init (GeglChantClass *klass) { GeglOperationClass *operation_class;
operation_class = GEGL_OPERATION_CLASS (klass); operation_class->attach = attach;
gegl_operation_class_set_keys (operation_class, "name" , "lb:legacy-bevel", "categories" , "meta:edge", "description", _("Legacy Bevel"), NULL); }
#endif
|
|