It is currently Sat Jun 22, 2024 9:39 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 10  Next
Author Message
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Jun 29, 2022 10:00 pm  (#61) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
A Gimp Developer helped me make the checkbox for Gradient and Inner Glow. Credit goes to Liam Quin.









The GEGL Effects download provided by Mr Q in June 2022 is VERY OUTDATED. PLEASE GO HERE FOR THE UPDATED VERSION
https://github.com/LinuxBeaver/GEGL-Eff ... L/releases


Last edited by contrast_ on Thu Dec 28, 2023 5:20 am, edited 1 time in total.

Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Jun 29, 2022 10:42 pm  (#62) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
For the new option (gradient), replace gegleffects.dll with the new file in the attachment.

@Beaver.

Image

The download zip file still contains the older version (not sure if it is generated automatically or if you are packing it personally?).
I downloaded gegleffects.c as a RAW file.


Attachments:
New options gradient.jpg
New options gradient.jpg [ 194.39 KiB | Viewed 22633 times ]
gegleffects_dll_Win64bit.zip [40.09 KiB]
Downloaded 521 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Jun 29, 2022 11:42 pm  (#63) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
I updated it. What happened is I put the .c file in the wrong directory.


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Thu Jun 30, 2022 1:40 am  (#64) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 787
Location: SEA - South East Asia
contrast_ wrote:
I updated it.


@contrast_ :clap :bigthup

Image

_________________
Patrice


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Thu Jun 30, 2022 8:20 am  (#65) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
I shouldn't have to say this but setting the opacity of outline to 0 removes the stroke entirely and the shadow will take over.

Setting the opacity of shadow/glow to 0 removes the shadow


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Thu Jun 30, 2022 8:21 am  (#66) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Thank you for all the appreciation @PixLab


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sat Jul 23, 2022 3:12 pm  (#67) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
GEGL Effects got an update that does nothing except remove the trivial gegl:stroke filter.

GEGL stroke is gone and dropshadow is doing its job. No noticeable changes exist


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sat Jul 23, 2022 3:26 pm  (#68) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Okay. I might be able to make it where the stroke has a gradient and a bevel of its own but that would make things super confusing and there is no way I know to make the GUI compact.

I hope to see a day where stroke has its own tabs for limited movability, bevel, image overlay, and a gradient.


I know how to do this but the GUI would be horrifying.


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sun Jul 24, 2022 6:56 am  (#69) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
A little fog and effects from GEGL :)

Attachment:
Gimp-GEGL-Fog-and-effects.jpg
Gimp-GEGL-Fog-and-effects.jpg [ 44.2 KiB | Viewed 22555 times ]


Thx for these great filters! :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sun Aug 28, 2022 7:22 pm  (#70) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Image

ANNOUNCEMENT -- GEGL EFFECTS REQUIRES CHECKING THE CHAIN ICON BEFORE IMPORTING TEXT FILE PRESETS


If you import a text file preset of a shadow or gradient that has an uneven X Y coordinate. GEGL Effects will not remember that part and load the X Y coordinates as the same. Leading to a scenario where the text style is not as intended.

Checking the chain icon before importing solves the problem. Saved Presets do not have this problem only imports.


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sun Aug 28, 2022 7:26 pm  (#71) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Gimp's dropshadow has the same problem. The chain icon is not remembered in text file presets. Bug filed.

Image


Last edited by contrast_ on Fri Feb 23, 2024 12:26 am, edited 1 time in total.

Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Thu Sep 15, 2022 5:14 pm  (#72) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
GEGL Effects got an important update with feature changes
https://github.com/LinuxBeaver/GEGL-Eff ... sing-GEGL/

1. No hidden zz-operations. But it does come with two full fledge filters.

2. It now ships with GEGL InnerGlow. Along with GEGL Bevel; which it has shipped with for a long time. InnerGlow and Bevel are both full filters of their own and have more options on their own.

3. The Bevels angle can now be changed to give it a realistic bevel effect with a new slider I added.

4. Shadow and Outline are disabled by default and can be re-enabled by moving up their opacity sliders. Which are labelled. Unlike InnerGlow and Gradient. They are still loaded into memory when opacity is hidden. This makes it much more like Adobe's layer effects.

5. GEGL InnerGlow was updated to be faster. This effects stand alone innerglow as well

The bad news is that GEGL is not capable of doing tabs in its filters. So GEGL Styles will not come as i wouldn't be giving it justice. I will just continue to improve GEGL Effects.

Preview of the new bevel update change.
Image

InnerGlow will be slightly faster
Image
The next update has plans to give the inner glow its own blend modes but that might take a lot of work.


Last edited by contrast_ on Fri Feb 23, 2024 12:27 am, edited 1 time in total.

Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Fri Sep 16, 2022 1:15 am  (#73) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Windows 64 bit files attached in zip file.
inner-glow
bevel
gegleffects


INSTALL INSTRUCTIONS
-------------------------------
Unzip the file
Place ALL 3 of the DLL files into your C:\\Users\<YOUR NAME>\AppData\Local\gegl-0.4\plug-ins folder and Restart Gimp.

Attachment:

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Fri Sep 16, 2022 2:10 am  (#74) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Attachment:
GEGL-Effects_RD-2022-09-16_030117.jpg
GEGL-Effects_RD-2022-09-16_030117.jpg [ 354.78 KiB | Viewed 22547 times ]


Attachment:
GEGL-Inner-Glow_RD-2022-09-16_030117.jpg
GEGL-Inner-Glow_RD-2022-09-16_030117.jpg [ 329.48 KiB | Viewed 22547 times ]


Did you add the scroll bars contrast? I don't remember them being there before. :bigthup


Attachments:
GEGL-Bevel_RD-2022-09-16_025822.jpg
GEGL-Bevel_RD-2022-09-16_025822.jpg [ 331.35 KiB | Viewed 22547 times ]

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."
Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Sun Sep 18, 2022 8:33 pm  (#75) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
TLDR GEGL Effects is making progress in using blend modes for inner glow, gradient, bevel ect... It will likely happen soon and we are getting list that will fragment the filter.


The version of GEGL Effects on my computer (not released) was optimized to make gradient and image file overlay use different "virtual layers" which are basically
two separate node_link lines.
      gegl_node_link_many (state->nopg, state->gradient, NULL);
      gegl_node_link_many (state->nopimage, state->image, NULL);


as opposed to just one.
      gegl_node_link_many (state->nop, state->gradient, state->image, NULL);


As a result I now have it where gradient and image file overlay can fuse with blend modes. It is official. Gradient, Image file overlay, Color Overlay, Bevel and Inner Glow have the potential to fuse with blend modes of both Gimp and GEGL. And I am going to implement this soon along with a list that works like GEGL longshadow to separate parts of GEGL Effects. Listed filter parts will be able to fuse with blend modes and the fill will be broken apart with a list to select what one wants to work on. The list may contain "image, color & gradient " "stroke/glow" "inner glow and bevel" sub sections. 3 in total.

Stay tuned. Here is previews of GEGL Effects fusing with blend modes.

Gradient fusing with Overlay inside unreleased version of GEGL Effects
Image


InnerGlow fusing with Overlay inside unreleased version of GEGL Effects

Image


Last edited by contrast_ on Fri Feb 23, 2024 12:26 am, edited 1 time in total.

Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Mon Sep 19, 2022 1:05 am  (#76) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Awesome! Can't wait for the release. :bigthup

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Tue Sep 20, 2022 4:18 pm  (#77) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Pay attention to "Part of filter to be displayed"

https://streamable.com/471nc6


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Sep 21, 2022 12:05 am  (#78) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
contrast_ wrote:
Pay attention to "Part of filter to be displayed"

https://streamable.com/471nc6

So you were able to add a drop down selection menu for each filter. :) NICE!

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Sep 21, 2022 9:14 pm  (#79) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
https://cdn.discordapp.com/attachments/ ... 220953.mp4

The blend mode for Bevel can now change in this unreleased version. I can't release it until all blend modes (bevel, gradient, image file and innerglow) are done as every enum list I add breaks all presets.


Top
 Post subject: Re: GEGL Layer Effects and Text Styling filter
PostPosted: Wed Sep 21, 2022 9:45 pm  (#80) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1442
Compile the unreleased version of GEGL Effects and test it yourself. Save it as a C file before compiling.

Changes so far

1. The filter is fragmented into three parts that can be accesed using an enum list.
The parts are "outline and shadow" "bevel and innerglow" "image file and gradient"

2. Bevel has internal blend modes that can be swapped.

3. Outline can be moved to create a opaque softness free dropshadow effect.

4. Bevel has a radius option

/* 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 <https://www.gnu.org/licenses/>.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
*2022 Beaver GEGL Effects
* 2022 Liam (for helping give Inner Glow a disable checkbox)
*/

#include "config.h"
#include <glib/gi18n-lib.h>





#ifdef GEGL_PROPERTIES

enum_start (gegl_blend_mode_type_effects)
  enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLY,      "Multiply",
              N_("Multiply"))
  enum_value (GEGL_BLEND_MODE_TYPE_GRAINMERGE,      "Grain Merge",
              N_("Grain Merge"))
  enum_value (GEGL_BLEND_MODE_TYPE_SUBTRACT,      "Subtract",
              N_("Subtract"))
  enum_value (GEGL_BLEND_MODE_TYPE_GRAINEXTRACT,      "Grain Extract",
              N_("Grain Extract"))
enum_end (GeglBlendModeType)







enum_start (guichangeenum)
enum_value   (BEAVER_UI_STROKESHADOW, "strokeshadow", N_("Outline and Shadow"))
enum_value   (BEAVER_UI_INNERGLOWBEVEL, "innerglowbevel", N_("Bevel and Inner Glow"))
enum_value   (BEAVER_UI_IMAGEGRADIENT, "imagegradient", N_("Image file upload and Gradient"))
  enum_end (guiend)



property_enum(guichange, _("Part of filter to be displayed"),
    guiend, guichangeenum,
    BEAVER_UI_STROKESHADOW)
  description(_("Change the GUI option"))

property_enum (blendmode, _("Blend Mode of Bevel's emboss'"),
    GeglBlendModeType, gegl_blend_mode_type_effects,
    GEGL_BLEND_MODE_TYPE_MULTIPLY)
  ui_meta ("visible", "guichange {innerglowbevel}")



property_file_path(src, _("Optional image file overlay upload "), "")
    description (_("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"))
ui_meta ("visible", "guichange {imagegradient}")

property_color  (optioncolor, _("Optional Color Overlay"), "#ffffff")
  ui_meta ("visible", "guichange {strokeshadow}")



property_int (depth, _("Bevel Depth --ENABLE BEVEL"), 1)
    description (_("Filter width"))
    value_range (1, 70)
  ui_meta ("visible", "guichange {innerglowbevel}")

property_double (bevel1, _("Rotate Bevel Lighting (90 resets)"), 90.0)
    description (_("Elevation angle (degrees)"))
    value_range (55, 125)
    ui_meta ("unit", "degree")
  ui_meta ("visible", "guichange {innerglowbevel}")


property_double (radius1, _("Radius of Bevel"), 7.0)
  value_range (7, 12.0)
  ui_range (1.0, 12)
  ui_gamma (1.5)
  ui_meta ("visible", "guichange {innerglowbevel}")




property_double (opacitystroke, _("Outline's Opacity --ENABLE OUTLINE"), 0.0)
  value_range   (0.0, 1.0)
  ui_steps      (0.01, 0.10)
  ui_meta ("visible", "guichange {strokeshadow}")


/* Should correspond to GeglMedianBlurNeighborhood in median-blur.c */
enum_start (gegl_stroke_grow_shape)
  enum_value (GEGL_stroke_GROW_SHAPE_SQUARE,  "square",  N_("Square"))
  enum_value (GEGL_stroke_GROW_SHAPE_CIRCLE,  "circle",  N_("Circle"))
  enum_value (GEGL_stroke_GROW_SHAPE_DIAMOND, "diamond", N_("Diamond"))
enum_end (GeglstrokeGrowShape)


property_double (xstroke, _("Outline X Position"), 0.0)
  description   (_("Horizontal shadow offset"))
  ui_range      (-10.0, 10.0)
  ui_steps      (1, 10)
  ui_meta ("visible", "guichange {strokeshadow}")



property_double (ystroke, _("Outline Y Position"), 0.0)
  description   (_("Vertical shadow offset"))
  ui_range      (-10.0, 10.0)
  ui_steps      (1, 10)
  ui_meta ("visible", "guichange {strokeshadow}")





property_enum   (grow_shape, _("Grow shape"),
                 GeglstrokeGrowShape, gegl_stroke_grow_shape,
                 GEGL_stroke_GROW_SHAPE_CIRCLE)
  description   (_("The shape to expand or contract the stroke in"))
  ui_meta ("visible", "guichange {strokeshadow}")

property_double (radiusstroke, _("Outline's Blur radius"), 0.0)
  value_range   (0.0, 2)
  ui_range      (0.0, 300.0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  ui_meta ("visible", "guichange {strokeshadow}")


property_double (grow_radiusstroke, _("Outline's Grow radius"), 12.0)
  value_range   (0.0, 100.0)
  ui_range      (0.0, 50.0)
  ui_digits     (0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  description (_("The distance to expand the stroke before blurring; a negative value will contract the stroke instead"))
  ui_meta ("visible", "guichange {strokeshadow}")




property_color  (colorstroke, _("Outline's Color"), "#k")
    /* TRANSLATORS: the string 'black' should not be translated */
  description   (_("The shadow's color (defaults to 'black')"))
    ui_meta     ("role", "color-primary")
  ui_meta ("visible", "guichange {strokeshadow}")

property_double (opacity, _("Shadow/Glow Opacity --ENABLE SHADOW/GLOW"), 0.0)
  value_range   (0.0, 1.0)
  ui_steps      (0.01, 0.10)
  ui_meta ("visible", "guichange {strokeshadow}")







property_double (x, _("Shadow/Glow X"), 10.0)
  description   (_("Horizontal shadow offset"))
  ui_range      (-40.0, 40.0)
  ui_steps      (1, 10)
  ui_meta       ("unit", "pixel-distance")
  ui_meta       ("axis", "x")
  ui_meta ("visible", "guichange {strokeshadow}")

property_double (y, _("Shadow/Glow Y"), 10.0)
  description   (_("Vertical shadow offset"))
  ui_range      (-40.0, 40.0)
  ui_steps      (1, 10)
  ui_meta       ("unit", "pixel-distance")
  ui_meta       ("axis", "y")
  ui_meta ("visible", "guichange {strokeshadow}")


property_color  (color, _("Shadow/Glow Color"), "black")
    /* TRANSLATORS: the string 'black' should not be translated */
  description   (_("The shadow's color (defaults to 'black')"))
  ui_meta ("visible", "guichange {strokeshadow}")

/* It does make sense to sometimes have opacities > 1 (see GEGL logo
* for example)
*/




property_double (grow_radius, _("Shadow/Glow Grow radius"), 0.0)
  value_range   (0.0, 100.0)
  ui_range      (0.0, 50.0)
  ui_digits     (0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  description (_("The distance to expand the shadow before blurring; a negative value will contract the shadow instead"))
  ui_meta ("visible", "guichange {strokeshadow}")

property_double (radius, _("Shadow/Glow Blur radius"), 12.0)
  value_range   (0.0, G_MAXDOUBLE)
  ui_range      (0.0, 300.0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  ui_meta ("visible", "guichange {strokeshadow}")


property_boolean (innerglow, _("Enable Inner Glow"), FALSE)
  description   (_("Whether to add an inner glow effect, which can be slow"))
  ui_meta ("visible", "guichange {innerglowbevel}")


property_double (innergradius, _("Inner Glow's Blur radius"), 13.0)
  value_range   (0.0, 30.0)
  ui_range      (0.0, 30.0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  ui_meta ("visible", "guichange {innerglowbevel}")


property_double (innerggrow_radius, _("Inner Glow's Grow radius"), 5)
  value_range   (1, 30.0)
  ui_range      (1, 30.0)
  ui_digits     (0)
  ui_steps      (1, 5)
  ui_gamma      (1.5)
  ui_meta       ("unit", "pixel-distance")
  description (_("The distance to expand the shadow before blurring; a negative value will contract the shadow instead"))
  ui_meta ("visible", "guichange {innerglowbevel}")

property_double (innergopacity, _("Inner Glow's opacity"), 1.4)
  value_range   (0.0, 2.0)
  ui_steps      (0.01, 0.10)
  ui_meta ("visible", "guichange {innerglowbevel}")



property_color (innergvalue, _("Inner Glow's Color"), "#ff8f00")
    description (_("The color to paint over the input"))
  ui_meta ("visible", "guichange {innerglowbevel}")


property_double  (fixoutline, _("Fix Inner Glow outline with median blur"), 69)
  value_range (50, 79)
  description (_("Neighborhood alpha percentile"))
  ui_meta ("visible", "guichange {innerglowbevel}")


property_boolean (gradient, _("Enable Gradient"), FALSE)
  description   (_("Whether to add Gradient overlay"))
ui_meta ("visible", "guichange {imagegradient}")


property_double (start_x, _("Gradient X1"), 659.0)
    ui_meta("unit", "pixel-coordinate")
    ui_meta("axis", "x")
ui_meta ("visible", "guichange {imagegradient}")


property_double (start_y, _("Gradient Y1"), 49.0)
    ui_meta("unit", "pixel-coordinate")
    ui_meta("axis", "y")
ui_meta ("visible", "guichange {imagegradient}")

property_double (end_x, _("Gradient X2"), 647.0)
    ui_meta("unit", "pixel-coordinate")
    ui_meta("axis", "x")
ui_meta ("visible", "guichange {imagegradient}")

property_double (end_y, _("Gradient Y2"), 572.0)
    ui_meta ("unit", "pixel-coordinate")
    ui_meta ("axis", "y")
ui_meta ("visible", "guichange {imagegradient}")

property_color (start_color, _("Gradient Start Color"), "#34ebd6")
    description (_("The color at (x1, y1)"))
ui_meta ("visible", "guichange {imagegradient}")


property_color  (end_color, _("Gradient End Color"), "#fe18f2")
    description (_("The color at (x2, y2)"))
ui_meta ("visible", "guichange {imagegradient}")




#else

#define GEGL_OP_META
#define GEGL_OP_NAME     gegleffects
#define GEGL_OP_C_SOURCE gegleffects.c

#include "gegl-op.h"

/* Typedef Structure for Bevel's blend mode switching '*/

typedef struct
{
  GeglNode *input;
  GeglNode *atopi;
  GeglNode *atopg;
  GeglNode *over;
  GeglNode *crop;
  GeglNode *mbd;
  GeglNode *mcol;
  GeglNode *nopig;
  GeglNode *nopm;
  GeglNode *nopb;
  GeglNode *nopg;
  GeglNode *nopimage;
  GeglNode *multiply;
  GeglNode *subtract;
  GeglNode *addition;
  GeglNode *grainextract;
  GeglNode *grainmerge;
  GeglNode *multiplyb;
  GeglNode *innerglow;
  GeglNode *stroke;
  GeglNode *ds;
  GeglNode *output;
  GeglNode *image;
  GeglNode *gradient;
} State;

static void
update_graph (GeglOperation *operation)
{
  GeglProperties *o = GEGL_PROPERTIES (operation);
  State *state = o->user_data;
  GeglNode *multiplyb;

  if (!state) return;

  multiplyb = state->multiply; /* the default */
  switch (o->blendmode) {
    case GEGL_BLEND_MODE_TYPE_MULTIPLY: multiplyb = state->multiplyb; break;
    case GEGL_BLEND_MODE_TYPE_GRAINMERGE: multiplyb = state->grainmerge; break;
    case GEGL_BLEND_MODE_TYPE_SUBTRACT: multiplyb = state->subtract; break;
    case GEGL_BLEND_MODE_TYPE_GRAINEXTRACT: multiplyb = state->grainextract; break;
  }

  if (o->innerglow)
  {
    if (o->gradient)
    {
      /* both innerglow and gradient */
         gegl_node_link_many (state->input, state->nopimage, state->atopi, state->nopg, state->atopg,  state->crop, state->nopb, multiplyb, state->nopm, state->multiply,  state->nopig, state->over, state->stroke, state->ds, state->output, NULL);
      gegl_node_link_many (state->nopg, state->gradient, NULL);
      gegl_node_link_many (state->nopimage, state->image, NULL);
      gegl_node_link_many (state->nopig, state->innerglow, NULL);
      gegl_node_link_many (state->nopb, state->mbd, NULL);
      gegl_node_link_many (state->nopm, state->mcol, NULL);
      gegl_node_connect_from (multiplyb, "aux", state->mbd, "output");
      gegl_node_connect_from (state->multiply, "aux", state->mcol, "output");
      gegl_node_connect_from (state->over, "aux", state->innerglow, "output");
      gegl_node_connect_from (state->atopg, "aux", state->gradient, "output");
      gegl_node_connect_from (state->atopi, "aux", state->image, "output");
    }
    else
    {
      /* innerglow but no gradient */
         gegl_node_link_many (state->input, state->nopimage, state->atopi,  state->crop, state->nopb, multiplyb, state->nopm, state->multiply,  state->nopig, state->over, state->stroke, state->ds, state->output, NULL);
      gegl_node_link_many (state->nopimage, state->image, NULL);
      gegl_node_link_many (state->nopig, state->innerglow, NULL);
      gegl_node_link_many (state->nopb, state->mbd, NULL);
      gegl_node_link_many (state->nopm, state->mcol, NULL);
      gegl_node_connect_from (multiplyb, "aux", state->mbd, "output");
      gegl_node_connect_from (state->multiply, "aux", state->mcol, "output");
      gegl_node_connect_from (state->over, "aux", state->innerglow, "output");
      gegl_node_connect_from (state->atopi, "aux", state->image, "output");
    }
  }
  else
  {
    if (o->gradient)
    {
      /* gradient but no innerglow */
         gegl_node_link_many (state->input, state->nopimage, state->atopi, state->nopg, state->atopg,  state->crop, state->nopb, multiplyb, state->nopm, state->multiply, state->stroke, state->ds, state->output, NULL);
      gegl_node_link_many (state->nopg, state->gradient, NULL);
      gegl_node_link_many (state->nopimage, state->image, NULL);
      gegl_node_link_many (state->nopb, state->mbd, NULL);
      gegl_node_link_many (state->nopm, state->mcol, NULL);
      gegl_node_connect_from (multiplyb, "aux", state->mbd, "output");
      gegl_node_connect_from (state->multiply, "aux", state->mcol, "output");
      gegl_node_connect_from (state->atopg, "aux", state->gradient, "output");
      gegl_node_connect_from (state->atopi, "aux", state->image, "output");
    }
    else
    {
      /* neither gradient nor innerglow */
   gegl_node_link_many (state->input, state->nopimage, state->atopi, state->crop, state->nopb, multiplyb, state->nopm, state->multiply, state->stroke, state->ds, state->output, NULL);
      gegl_node_link_many (state->nopimage, state->image, NULL);
      gegl_node_link_many (state->nopb, state->mbd, NULL);
      gegl_node_link_many (state->nopm, state->mcol, NULL);
      gegl_node_connect_from (multiplyb, "aux", state->mbd, "output");
      gegl_node_connect_from (state->multiply, "aux", state->mcol, "output");
      gegl_node_connect_from (state->atopi, "aux", state->image, "output");
    }
  }
}


/* End of Typedef Structure for Bevel's blend mode switching '*/



/*Typedef Structure for InnerGlow and Gradient Checkboxes '*/



static void attach (GeglOperation *operation)
{
  GeglNode *gegl = operation->node;
  GeglProperties *o = GEGL_PROPERTIES (operation);
  GeglNode *input, *output, *image, *mbd, *nopig, *multiplyb, *nopm, *over, *multiply, *grainextract, *grainmerge, *addition, *subtract,  *nopb, *mcol, *stroke, *innerglow, *gradient, *crop, *ds,  *nopimage, *atopi, *nopg, *atopg;

  input    = gegl_node_get_input_proxy (gegl, "input");
  output   = gegl_node_get_output_proxy (gegl, "output");

  image = gegl_node_new_child (gegl,
                                  "operation", "gegl:layer",
                                  NULL);

  stroke = gegl_node_new_child (gegl,
                                  "operation", "gegl:dropshadow",
                                  NULL);

  ds = gegl_node_new_child (gegl,
                                  "operation", "gegl:dropshadow",
                                  NULL);

  innerglow = gegl_node_new_child (gegl,
                                  "operation", "gegl:innerglow",
                                  NULL);

  /*atopi is the blend mode that will need to be switchable for gegl:layer src=*/


  atopi = gegl_node_new_child (gegl,
                                  "operation", "gegl:src-atop",
                                  NULL);

  /*atopg is the blend mode that will need to be switchable for gegl:linear-gradient*/

  atopg = gegl_node_new_child (gegl,
                                  "operation", "gegl:src-atop",
                                  NULL);

/*When we finally get around to adding an enum list so blend modes can change*/

  /*atopg = gegl_node_new_child (gegl,
                                 "operation", "gimp:layer-mode", "layer-mode", 23,  "composite-mode", 0, NULL);*/


  mbd = gegl_node_new_child (gegl,
                                  "operation", "gegl:bevel",
                                  NULL);



  mcol = gegl_node_new_child (gegl,
                                  "operation", "gegl:color-overlay",
                                  NULL);

  nopm = gegl_node_new_child (gegl,
                                  "operation", "gegl:nop",
                                  NULL);

  nopimage = gegl_node_new_child (gegl,
                                  "operation", "gegl:nop",
                                  NULL);

  nopb = gegl_node_new_child (gegl,
                                  "operation", "gegl:nop",
                                  NULL);

  nopig = gegl_node_new_child (gegl,
                                  "operation", "gegl:nop",
                                  NULL);

  nopg = gegl_node_new_child (gegl,
                                  "operation", "gegl:nop",
                                  NULL);


  /*multiply is the blend mode that will need to be switchable for gegl:color-overlay*/

  multiply = gegl_node_new_child (gegl,
                                  "operation", "gegl:multiply",
                                  NULL);

  /*multiplyb is the blend mode that will need to be switchable for gegl:bevel*/

  multiplyb = gegl_node_new_child (gegl,
                                  "operation", "gegl:multiply",
                                  NULL);

  gradient = gegl_node_new_child (gegl,
                                  "operation", "gegl:linear-gradient",
                                  NULL);

    /* 0 is Gimp blend mode (Normal) */
    /* 47 is Gimp blend mode (Grain Merge) */
    /* 23 is Gimp blend mode (Overlay) */

  /*over = gegl_node_new_child (gegl,
                              "operation", "gimp:layer-mode", "layer-mode", 0, "composite-mode", 0, NULL);*/

  /*over is the blend mode that will need to be switchable for gegl:innerglow*/

  over = gegl_node_new_child (gegl,
                                  "operation", "gegl:src-atop",
                                  NULL);
  crop = gegl_node_new_child (gegl,
                                  "operation", "gegl:crop",
                                  NULL);

grainextract = gegl_node_new_child (gegl,
                              "operation", "gimp:layer-mode", "layer-mode", 46, "composite-mode", 0, NULL);


grainmerge = gegl_node_new_child (gegl,
                              "operation", "gimp:layer-mode", "layer-mode", 47, "composite-mode", 0, NULL);

subtract = gegl_node_new_child (gegl,
                              "operation", "gimp:layer-mode", "layer-mode", 34, "composite-mode", 0, NULL);







  gegl_node_link_many (input, nopimage, atopi, nopg, atopg, crop, nopb, multiplyb, nopm, multiply, nopig, over, stroke, ds, output, NULL);
  gegl_node_link_many (nopimage, image, NULL);
  gegl_node_link_many (nopg, gradient, NULL);
gegl_node_link_many (nopig, innerglow, NULL);
gegl_node_link_many (nopb, mbd, NULL);
gegl_node_link_many (nopm, mcol, NULL);
  gegl_node_connect_from (multiplyb, "aux", mbd, "output");
  gegl_node_connect_from (multiply, "aux", mcol, "output");
  gegl_node_connect_from (over, "aux", innerglow, "output");
  gegl_node_connect_from (atopi, "aux", image, "output");
  gegl_node_connect_from (atopg, "aux", gradient, "output");

  gegl_operation_meta_redirect (operation, "string", image, "string");
  gegl_operation_meta_redirect (operation, "x", ds, "x");
  gegl_operation_meta_redirect (operation, "y", ds, "y");
  gegl_operation_meta_redirect (operation, "ystroke", stroke, "y");
  gegl_operation_meta_redirect (operation, "xstroke", stroke, "x");
  gegl_operation_meta_redirect (operation, "opacity", ds, "opacity");
  gegl_operation_meta_redirect (operation, "grow_radius", ds, "grow-radius");
  gegl_operation_meta_redirect (operation, "radius", ds, "radius");
  gegl_operation_meta_redirect (operation, "color", ds, "color");
  gegl_operation_meta_redirect (operation, "grow_shape", stroke, "grow-shape");
  gegl_operation_meta_redirect (operation, "opacitystroke", stroke, "opacity");
  gegl_operation_meta_redirect (operation, "radiusstroke", stroke, "radius");
  gegl_operation_meta_redirect (operation, "grow_radiusstroke", stroke, "grow-radius");
  gegl_operation_meta_redirect (operation, "colorstroke", stroke, "color");
  gegl_operation_meta_redirect (operation, "depth", mbd, "bevel2");
  gegl_operation_meta_redirect (operation, "radius1", mbd, "radius1");
  gegl_operation_meta_redirect (operation, "bevel1", mbd, "bevel1");
  gegl_operation_meta_redirect (operation, "optioncolor", mcol, "value");
  gegl_operation_meta_redirect (operation, "src", image, "src");
  gegl_operation_meta_redirect (operation, "innerggrow_radius", innerglow, "grow-radius");
  gegl_operation_meta_redirect (operation, "innergradius", innerglow, "radius");
  gegl_operation_meta_redirect (operation, "innergopacity", innerglow, "opacity");
  gegl_operation_meta_redirect (operation, "innergvalue", innerglow, "value2");
  gegl_operation_meta_redirect (operation, "fixoutline", innerglow, "fixoutline");
  gegl_operation_meta_redirect (operation, "start_x", gradient, "start-x");
  gegl_operation_meta_redirect (operation, "start_y", gradient, "start-y");
  gegl_operation_meta_redirect (operation, "end_x", gradient, "end-x");
  gegl_operation_meta_redirect (operation, "end_y", gradient, "end-y");
  gegl_operation_meta_redirect (operation, "start_color", gradient, "start-color");
  gegl_operation_meta_redirect (operation, "end_color", gradient, "end-color");


  /* Now save points to the various gegl nodes so we can rewire them in
   * update_graph() later
   */
  State *state = g_malloc0 (sizeof (State));
  o->user_data = state;

  state->input = input;
  state->atopi = atopi;
  state->atopg = atopg;
  state->multiply = multiply;
  state->multiplyb = multiplyb;
  state->addition = addition;
  state->subtract = subtract;
  state->grainmerge = grainmerge;
  state->grainextract = grainextract;
  state->nopb = nopb;
  state->nopg = nopg;
  state->nopimage = nopimage;
  state->nopm = nopm;
  state->nopig = nopig;
  state->over = over;
  state->crop = crop;
  state->mbd = mbd;
  state->mcol = mcol;
  state->innerglow = innerglow;
  state->stroke = stroke;
  state->ds = ds;
  state->output = output;
  state->image = image;
  state->gradient = gradient;
}



static void
gegl_op_class_init (GeglOpClass *klass)
{
  GeglOperationClass *operation_class;

  operation_class = GEGL_OPERATION_CLASS (klass);
  GeglOperationMetaClass *operation_meta_class = GEGL_OPERATION_META_CLASS (klass);

  operation_class->attach = attach;
  operation_meta_class->update = update_graph;

  gegl_operation_class_set_keys (operation_class,
    "name",        "gegl:effects",
    "title",       _("GEGL Effects"),
    "categories",  "Generic",
    "reference-hash", "45ed565h8500fca01b2ac",
    "description", _("GEGL text stying and speciality image outlining filter. Text recoloring only works if the color is white "
                     ""),
    NULL);
}

#endif


Top
Post new topic Reply to topic  [ 190 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7 ... 10  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) GEGL Text Styling effects on individual Gimp layers

11

No new posts Attachment(s) GEGL Effects Experimental plugin (super advance text styling) is back

0

No new posts Attachment(s) GEGL STONE TEXT STYLING FILTER

21

No new posts Attachment(s) New GEGL Glossy Balloon Text styling filter.

23

No new posts Attachment(s) GEGL Neon Border text styling filter.

15



* Login  



Powered by phpBB3 © phpBB Group