Sun Feb 25, 2024 12:00 am
Sun Feb 25, 2024 12:04 am
Sun Feb 25, 2024 12:50 am
/* 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
Sun Feb 25, 2024 12:59 am
|
../gaussian-blur.c:475:8: error: unknown type name ‘gegl_cl_run_data’
475 | static gegl_cl_run_data *cl_data = NULL;
| ^~~~~~~~~~~~~~~~
../gaussian-blur.c: In function ‘cl_gaussian_blur’:
../gaussian-blur.c:501:15: warning: assignment to ‘int *’ from incompatible pointer type ‘GeglClRunData *’ [-Wincompatible-pointer-types]
501 | cl_data = gegl_cl_compile_and_build (kernel_source, kernel_name);
| ^
../gaussian-blur.c:529:40: error: request for member ‘kernel’ in something not a structure or union
529 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 0, sizeof(cl_mem), (void*)&in_tex);
| ^~
../gaussian-blur.c:530:40: error: request for member ‘kernel’ in something not a structure or union
530 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 1, sizeof(cl_int), (void*)&src_rect->width);
| ^~
../gaussian-blur.c:531:40: error: request for member ‘kernel’ in something not a structure or union
531 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 2, sizeof(cl_mem), (void*)&aux_tex);
| ^~
../gaussian-blur.c:532:40: error: request for member ‘kernel’ in something not a structure or union
532 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 3, sizeof(cl_mem), (void*)&cl_matrix_x);
| ^~
../gaussian-blur.c:533:40: error: request for member ‘kernel’ in something not a structure or union
533 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 4, sizeof(cl_int), (void*)&matrix_length_x);
| ^~
../gaussian-blur.c:534:40: error: request for member ‘kernel’ in something not a structure or union
534 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[1], 5, sizeof(cl_int), (void*)&xoff);
| ^~
../gaussian-blur.c:538:47: error: request for member ‘kernel’ in something not a structure or union
538 | cl_data->kernel[1], 2,
| ^~
../gaussian-blur.c:548:40: error: request for member ‘kernel’ in something not a structure or union
548 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 0, sizeof(cl_mem), (void*)&aux_tex);
| ^~
../gaussian-blur.c:549:40: error: request for member ‘kernel’ in something not a structure or union
549 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 1, sizeof(cl_int), (void*)&aux_rect->width);
| ^~
../gaussian-blur.c:550:40: error: request for member ‘kernel’ in something not a structure or union
550 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 2, sizeof(cl_mem), (void*)&out_tex);
| ^~
../gaussian-blur.c:551:40: error: request for member ‘kernel’ in something not a structure or union
551 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 3, sizeof(cl_mem), (void*)&cl_matrix_y);
| ^~
../gaussian-blur.c:552:40: error: request for member ‘kernel’ in something not a structure or union
552 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 4, sizeof(cl_int), (void*)&matrix_length_y);
| ^~
../gaussian-blur.c:553:40: error: request for member ‘kernel’ in something not a structure or union
553 | cl_err |= gegl_clSetKernelArg(cl_data->kernel[0], 5, sizeof(cl_int), (void*)&yoff);
| ^~
../gaussian-blur.c:557:47: error: request for member ‘kernel’ in something not a structure or union
557 | cl_data->kernel[0], 2,
Sun Feb 25, 2024 11:17 am
Tue Feb 27, 2024 12:53 am
Tue Feb 27, 2024 1:36 am