It is currently Thu Jun 27, 2024 1:09 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Experimenting with GEGL and Gimp from (2012-2017) - WITH MY PLUGINS
PostPosted: Sun Feb 25, 2024 12:00 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
This thread shows me studying GEGL 0.2 from April 2012 just for fun so I can learn more about GEGL.


Below are operations that were never in Gimp and were abandoned from GEGL's workshop section long ago. In current day GEGL code they don't exist. Here is some facts about GEGL's history.


gegl:box-min, gegl:box-max, gegl:box-percentile, and gegl:disk-percentile were are fused together to make Median Blur
AKA gegl:median-blur.

gegl:color-reduction was cancelled and succeeded by gegl:channel-mixer as it did not exist them. Maybe its code was used to aid channel mixer, that I don't know. Though I am sure the filter above had its code used to aid Median.

max-rgb from 2012 that to my knowledge has no counterpart increased all rgb channels
gegl:max-rgb was cancelled and replaced by nothing, but maybe it was a precursor to gegl:channel-mixer

gegl:kuwahara (edge only smooth) was cancelled and replaced by nothing, and even earlier versions of GEGL in 2011 had gegl:kuwahara-min and gegl:kuwara-hara max. I cannot get these operations working


Preview of GEGL box radius that is like Median Blur on Square (but more intense and wide)

Image

Preview of GEGL max rgb

Image


Last edited by contrast_ on Tue Feb 27, 2024 1:50 pm, edited 2 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Experimenting with old GEGL and Gimp from (2012-2017) - WITH MY PLUGIN
PostPosted: Sun Feb 25, 2024 12:04 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
I am going to try making a GEGL plugin using GEGL code from 2012. It will be a text styler.

Many things are literally the same except for a legacy command called gegl-chant and something called priv-> needs to be in front of all node chaining filters. My goal is to prove it was possible to make GEGL plugins a decade ago, but no one did it. Now we can know what it would be like to make a GEGL filter like I do today but back in 2012.


Last edited by contrast_ on Tue Feb 27, 2024 1:49 pm, edited 1 time in total.

Top
 Post subject: Re: I compiled abandoned GEGL operations from 2012
PostPosted: Sun Feb 25, 2024 12:50 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
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


Top
 Post subject: Re: I compiled abandoned GEGL operations from 2012
PostPosted: Sun Feb 25, 2024 12:59 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
The project failed because gegl:gaussian-blur from 2012 is very different and will not compile on my machine. Without gaussian blur the plugin won't work.

      |
../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,




Well at least I tried making a GEGL plugin from 2012. Later I will see if I can compile 2012 GEGL and run it in a command line outside of Gimp


Top
 Post subject: Re: Study of legacy GEGL from 2012
PostPosted: Sun Feb 25, 2024 11:17 am  (#5) 
Offline
GimpChat Member

Joined: Dec 28, 2023
Posts: 34
contrast_: I think gegl:max-rgb was a recreation of GIMP's plug-in for max-RGB: https://docs.gimp.org/2.8/en/plug-in-max-rgb.html

It's been removed from 2.99 but still exists in 2.10 I think.


Top
 Post subject: Re: Study of legacy GEGL from 2012
PostPosted: Tue Feb 27, 2024 12:53 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
I configured everything yet still

an appimage of gimp 2.8 failed to detect the gegl plugin in /home/(USERNAME)/.local/share/gegl-0.2/plug-ins

It looks like it wasn't possible to make GEGL plugins for Gimp back then.


Top
 Post subject: Re: Study of legacy GEGL from 2012
PostPosted: Tue Feb 27, 2024 1:36 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1446
I have 3 executables of gimp 2.8.22 and only one of them has GEGL Graph syntax writing area in GEGL Operations > gegl. I tried it and the classic GEGL commands 'id and ref' crashed Gimp 2.8.


wow


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) About namespaces in GEGL Plugins (old GEGL effects will break)

3

No new posts Don't put GEGL plugins in seperate folders

0

No new posts Attachment(s) I need a Mac Dev to compile my Gimp GEGL Plugins on Mac

8

No new posts Attachment(s) Gimp 2.10.38 & 2.99.19 may break all my old GEGL plugins - update here

1

No new posts Officially compiled GEGL Filter plugins for Windows

8



* Login  



Powered by phpBB3 © phpBB Group