Thu Oct 12, 2023 10:56 am
levels out-low=0.00
id=1
dst-out aux=[ ref=1
median-blur radius=5 alpha-percentile=0
ssg radius=0 stroke=7
ssg radius=0 stroke=7
ssg radius=0 stroke=7
ssg radius=0 stroke=7
median-blur radius=0
]
custom-bevel depth=4 gaus=1
dst-over aux=[ ref=1 custom-bevel depth=1 gaus=1 ]
state->bevel = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 4.0, "gaus", 1.0,
NULL);
state->bevel2 = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 1.0, "gaus", 1.0,
NULL);
state->erase = gegl_node_new_child (gegl,
"operation", "gegl:dst-out",
NULL);
state->behind = gegl_node_new_child (gegl,
"operation", "gegl:dst-over",
NULL);
state->idref = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->nop1 = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->nop2 = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->nop3 = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->nop4 = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->fix = gegl_node_new_child (gegl,
"operation", "gegl:median-blur", "radius", 0,
NULL);
state->levels = gegl_node_new_child (gegl,
"operation", "gegl:levels",
NULL);
state->s1 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s2 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s3 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s4 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->median = gegl_node_new_child (gegl,
"operation", "gegl:median-blur", "radius", 5, "alpha-percentile", 0.0,
NULL);
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, ringnumber, ringnumber2, ringnumber3, ringnumber4, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
Thu Oct 12, 2023 11:02 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 <https://www.gnu.org/licenses/>.
*
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
* 2023 Beaver, Ringed Bevel
You can test plugin without installing by pasting this syntax into Gimp's GEGL graph (This graph requires other plugins 'ssg' and 'custom-bevel' this filter ships with those two plugins)
levels out-low=0.00
id=1
dst-out aux=[ ref=1
median-blur radius=5 alpha-percentile=0
ssg radius=0 stroke=7
ssg radius=0 stroke=7
ssg radius=0 stroke=7
ssg radius=0 stroke=7
median-blur radius=0
]
custom-bevel depth=4 gaus=1
dst-over aux=[ ref=1 custom-bevel depth=1 gaus=1 ]
*/
#include "config.h"
#include <glib/gi18n-lib.h>
#ifdef GEGL_PROPERTIES
property_boolean(advanced_options, _("Detailed options"), FALSE)
description (_("Show all settings for this plugin."))
enum_start (ring_time)
enum_value (ONE_RING, "onering",
N_("One Ring"))
enum_value (TWO_RINGS, "tworings",
N_("Two Rings"))
enum_value (THREE_RINGS, "threerings",
N_("Three Rings"))
enum_value (FOUR_RINGS, "fourrings",
N_("Four Rings"))
enum_end (ringtime)
/* This ENUM list has a unique name to avoid conflicts with other plugins or Gimp filters*/
property_enum (rings, _("Amount of Rings"),
ringtime, ring_time,
FOUR_RINGS)
description (_("Choose the amount of rings 1-4"))
property_int (size, _("Size of the Bevel"), 3)
value_range (1, 9)
ui_range (1, 9)
ui_meta ("unit", "pixel-distance")
description (_("Median Radius to control the size of the bevel"))
property_double (azimuth, _("Azimuth"), 67.0)
description (_("Light angle (degrees)"))
value_range (20, 90)
ui_meta ("unit", "degree")
ui_meta ("direction", "ccw")
property_double (elevation, _("Elevation"), 35.0)
description (_("Elevation angle (degrees). This appears to rotate the brightest pixels."))
value_range (7, 70)
ui_meta ("unit", "degree")
property_int (depth, _("Depth and or detail"), 24)
description (_("Brings out depth and or detail of the bevel depending on the blend mode"))
value_range (8, 45)
property_double (sharpen, _("Sharpen Radius"), 0.0)
description (_("Unsharp mask radius that helps the bevel apper to have depth and structure to it."))
value_range (0, 5)
ui_range (0, 5)
ui_meta ("visible", "advanced_options")
#else
#define GEGL_OP_META
#define GEGL_OP_NAME ringbevel
#define GEGL_OP_C_SOURCE ringbevel.c
#include "gegl-op.h"
typedef struct
{
GeglNode *input;
GeglNode *levels;
GeglNode *erase;
GeglNode *s1;
GeglNode *s2;
GeglNode *s3;
GeglNode *s4;
GeglNode *bevel;
GeglNode *behind;
GeglNode *median;
GeglNode *bevel2;
GeglNode *over;
GeglNode *idref;
GeglNode *fix;
GeglNode *output;
}State;
static void attach (GeglOperation *operation)
{
GeglNode *gegl = operation->node;
GeglProperties *o = GEGL_PROPERTIES (operation);
State *state = o->user_data = g_malloc0 (sizeof (State));
state->input = gegl_node_get_input_proxy (gegl, "input");
state->output = gegl_node_get_output_proxy (gegl, "output");
state->bevel = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 4.0, "gaus", 1.0,
NULL);
state->bevel2 = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 1.0, "gaus", 1.0,
NULL);
state->erase = gegl_node_new_child (gegl,
"operation", "gegl:dst-out",
NULL);
state->behind = gegl_node_new_child (gegl,
"operation", "gegl:dst-over",
NULL);
state->idref = gegl_node_new_child (gegl,
"operation", "gegl:nop",
NULL);
state->fix = gegl_node_new_child (gegl,
"operation", "gegl:median-blur", "radius", 0,
NULL);
state->levels = gegl_node_new_child (gegl,
"operation", "gegl:levels",
NULL);
state->s1 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s2 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s3 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->s4 = gegl_node_new_child (gegl,
"operation", "gegl:ssg", "radius", 0, "stroke", 7.0,
NULL);
state->median = gegl_node_new_child (gegl,
"operation", "gegl:median-blur", "radius", 5, "alpha-percentile", 0.0,
NULL);
static void update_graph (GeglOperation *operation)
{
GeglProperties *o = GEGL_PROPERTIES (operation);
State *state = o->user_data;
if (!state) return;
GeglNode *ringnumber = state->s4; /* the default */
switch (o->rings) {
case ONE_RING: ringnumber = state->s1; break;
case TWO_RINGS: ringnumber = state->s2; break;
case THREE_RINGS: ringnumber = state->s3; break;
case FOUR_RINGS: ringnumber = state->s4; break;
default: ringnumber = state->s4;
}
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, ringnumber, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
}
gegl_operation_meta_redirect (operation, "azimuth", state->bevel, "azimuth");
static void
gegl_op_class_init (GeglOpClass *klass)
{
GeglOperationClass *operation_class;
GeglOperationMetaClass *operation_meta_class = GEGL_OPERATION_META_CLASS (klass);
operation_class = GEGL_OPERATION_CLASS (klass);
operation_meta_class->update = update_graph;
operation_class->attach = attach;
gegl_operation_class_set_keys (operation_class,
"name", "lb:ringbevel",
"title", _("Ring Bevel"),
"reference-hash", "r34jghavetheringrightherejfj3",
"description", _("Make a Ringed Bevel effect"),
"gimp:menu-path", "<Image>/Filters/Text Styling",
"gimp:menu-label", _("Ringed Bevel..."),
NULL);
}
#endif
Thu Oct 12, 2023 2:15 pm
switch (o->rings) {
break;
case onering:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case tworings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case threerings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case fourrings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
}
}
enum_start (ring_time)
enum_value (onering, "onering",
N_("One Ring"))
enum_value (tworings, "tworings",
N_("Two Rings"))
enum_value (threerings, "threerings",
N_("Three Rings"))
enum_value (fourrings, "fourrings",
N_("Four Rings"))
enum_end (ringtime)
/* This ENUM list has a unique name to avoid conflicts with other plugins or Gimp filters*/
property_enum (rings, _("Amount of Rings"),
ringtime, ring_time,
fourrings)
description (_("Choose the amount of rings 1-4"))
Thu Oct 12, 2023 2:27 pm
Thu Oct 12, 2023 5:20 pm
switch (o->rings) {
break;
case onering:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case tworings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case threerings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
break;
case fourrings:
gegl_node_link_many (state->input, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
}
}
gegl_node_connect_from (state->behind, "aux", state->bevel, "output");
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
state->bevel = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 4.0, "gaus", 1.0,
NULL);
state->bevel2 = gegl_node_new_child (gegl,
"operation", "gegl:custom-bevel", "depth", 1.0, "gaus", 1.0,
NULL);
Thu Oct 12, 2023 5:48 pm
property_int (size, _("Size of the Bevel"), 3)
value_range (1, 9)
ui_range (1, 9)
ui_meta ("unit", "pixel-distance")
description (_("Median Radius to control the size of the bevel"))
property_double (elevation, _("Elevation"), 35.0)
description (_("Elevation angle (degrees). This appears to rotate the brightest pixels."))
value_range (7, 70)
ui_meta ("unit", "degree")
gegl_operation_meta_redirect (operation, "elevation", state->bevel, "elevation");
gegl_operation_meta_redirect (operation, "size", state->bevel, "size");
gegl_operation_meta_redirect (operation, "property_name_of_new_filter", state->nodename, "original_nodes_property_name");
Thu Oct 12, 2023 9:21 pm
/*This is a median blur's radius being called to make the bevel larger, I can't use custom bevel's size because that doesn't work in enlarging both custom bevels*/
gegl_operation_meta_redirect (operation, "bevelsize", state->mediandictator, "radius");
/*These list the azimuth, elevation and depth of my custom bevel plugin.*/
gegl_operation_meta_redirect (operation, "azimuth", state->bevel, "azimuth");
gegl_operation_meta_redirect (operation, "elevation", state->bevel, "elevation");
gegl_operation_meta_redirect (operation, "depth", state->bevel, "depth");
/*This controls the size of ALL ssg nodes*/
gegl_operation_meta_redirect (operation, "ringsize", state->s1, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s2, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s3, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s4, "stroke");
/*This controls the blend mode of the bevel and the rings*/
gegl_operation_meta_redirect (operation, "blendrings", state->bevel, "blendmode");
gegl_operation_meta_redirect (operation, "blendbevel", state->bevel2, "blendmode");
/*This controls the shape of the rings. It is gegl:ssg grow-shape=square,circle,diamond*/
gegl_operation_meta_redirect (operation, "ringshape", state->s1, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s2, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s3, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s4, "grow-shape");
/*Slide up if Bevel color is dark. This allows the bevel to work on dark colors*/
gegl_operation_meta_redirect (operation, "darkbevelslider", state->levels, "out-low");
enum_start (ring_time)
enum_value (onering, "onering",
N_("One Ring"))
enum_value (tworings, "tworings",
N_("Two Rings"))
enum_value (threerings, "threerings",
N_("Three Rings"))
enum_value (fourrings, "fourrings",
N_("Four Rings"))
enum_end (ringtime)
/* This ENUM list has a unique name to avoid conflicts with other plugins or Gimp filters*/
property_enum (rings, _("Amount of Rings"),
ringtime, ring_time,
fourrings)
description (_("Choose the amount of rings 1-4"))
property_int (bevelsize, _("Size of the Bevel"), 3)
value_range (1, 9)
ui_range (1, 9)
ui_meta ("unit", "pixel-distance")
description (_("Median Radius to control the size of the bevel"))
property_int (ringsize, _("Ring Size"), 6)
value_range (3, 9)
ui_range (3, 9)
ui_meta ("unit", "pixel-distance")
description (_("Control the size of the rings"))
property_double (azimuth, _("Azimuth of ring bevel"), 67.0)
description (_("Light angle (degrees)"))
value_range (20, 90)
ui_meta ("unit", "degree")
ui_meta ("direction", "ccw")
property_double (elevation, _("Elevation of ring bevel"), 35.0)
description (_("Elevation angle (degrees). This appears to rotate the brightest pixels."))
value_range (7, 70)
ui_meta ("unit", "degree")
property_int (depth, _("Depth and or detail of ring bevel"), 24)
description (_("Brings out depth and or detail of the bevel depending on the blend mode"))
value_range (8, 45)
enum_start (under_bevel_blend_mode)
enum_value (GEGL_BLEND_MODE_TYPE_HARDLIGHT, "Hardlight",
N_("HardLight"))
enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLY, "Multiply",
N_("Multiply"))
enum_value (GEGL_BLEND_MODE_TYPE_COLORDODGE, "ColorDodge",
N_("ColorDodge"))
enum_value (GEGL_BLEND_MODE_TYPE_PLUS, "Plus",
N_("Plus"))
enum_value (GEGL_BLEND_MODE_TYPE_DARKEN, "Darken",
N_("Darken"))
enum_value (GEGL_BLEND_MODE_TYPE_LIGHTEN, "Lighten",
N_("Lighten"))
enum_value (GEGL_BLEND_MODE_TYPE_OVERLAY, "Overlay",
N_("Overlay"))
enum_value (GEGL_BLEND_MODE_TYPE_GRAINMERGE, "GrainMerge",
N_("Grain Merge"))
enum_value (GEGL_BLEND_MODE_TYPE_SOFTLIGHT, "Softlight",
N_("Soft Light"))
enum_value (GEGL_BLEND_MODE_TYPE_ADDITION, "Addition",
N_("Addition"))
enum_end (underbevelblendmode)
property_enum (blendbevel, _("Under Bevel Blend Mode"),
underbevelblendmode, under_bevel_blend_mode,
GEGL_BLEND_MODE_TYPE_HARDLIGHT)
ui_meta ("axis", "blendbevel")
description (_("Blend mode of the bevel under the rings"))
enum_start (ring_bevel_blend_mode)
enum_value (GEGL_BLEND_MODE_TYPE_HARDLIGHTX, "Hardlight",
N_("HardLight"))
enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLYX, "Multiply",
N_("Multiply"))
enum_value (GEGL_BLEND_MODE_TYPE_COLORDODGEX, "ColorDodge",
N_("ColorDodge"))
enum_value (GEGL_BLEND_MODE_TYPE_PLUSX, "Plus",
N_("Plus"))
enum_value (GEGL_BLEND_MODE_TYPE_DARKENX, "Darken",
N_("Darken"))
enum_value (GEGL_BLEND_MODE_TYPE_LIGHTENX, "Lighten",
N_("Lighten"))
enum_value (GEGL_BLEND_MODE_TYPE_OVERLAYX, "Overlay",
N_("Overlay"))
enum_value (GEGL_BLEND_MODE_TYPE_GRAINMERGEX, "GrainMerge",
N_("Grain Merge"))
enum_value (GEGL_BLEND_MODE_TYPE_SOFTLIGHTX, "Softlight",
N_("Soft Light"))
enum_value (GEGL_BLEND_MODE_TYPE_ADDITIONX, "Addition",
N_("Addition"))
enum_end (ringbevelblendmode)
property_enum (blendrings, _("Ring Bevel Blend Mode"),
ringbevelblendmode, ring_bevel_blend_mode,
GEGL_BLEND_MODE_TYPE_HARDLIGHTX)
description (_("Blend mode of the ring bevel"))
enum_start (shape_of_ring)
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_SQUARE, "square", N_("Square"))
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_CIRCLE, "circle", N_("Circle"))
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_DIAMOND, "diamond", N_("Diamond"))
enum_end (shapeofring)
property_enum (ringshape, _("Shape of Ring"),
shapeofring, shape_of_ring,
GEGL_MEDIAN_BLUR_NEIGHBORHOOD_CIRCLE)
description (_("Shape of the Rings that internally uses Median Blur's neighborhood setting (square, circle, diamond)"))
property_double (darkbevelslider, _("Dark Color Bevel Fix"), 0.0)
description (_("Elevation "))
value_range (0.0, 0.20)
ui_meta ("unit", "degree")
description (_("Slide up if the Bevel is a dark color and the dark color will conform to the bevel. If not the dark color will not look proper. If this slider is up on a light color then it will modify it in a potential unwanted way."))
/*Let's analysis what is going on below
The same idref is called 3 times. The first is a bookmark (the id=bookmark) the second is a (ref=bookmark) inside the erase blend mode. THe third is a (ref=bookmark) inside the behind blend mode.
Remember. idref is a gegl:nop (no operation).
There are two blend modes being called "erase blend mode" gegl:dst-out, and the behind blend mode and "gegl:dst-over" The blend modes that the bevels call are baked inside custom-bevel's .c file
not this. They are being called by bevel1 and bevel2, but so is every other property name of custom bevel.
Fix is a median blur radius=0 at the end that resets internal values in the graph from a known bug where the drop shadow filter glitches out. median blur at 0 makes 0 changes to an image.
This shows all the nodes and composers "erase" and "behind"
gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
This is the content inside the erase blend mode. Their can be up to 3 more SSGs but this graph only has 1; s1.
gegl_node_link_many (state->idref, state->median, state->s1, (potentially three other SSGs) state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
This is the content inside the behind blend mode.
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
Fri Oct 13, 2023 6:41 am
if (o->colormode)
switch (o->rings) {
break;
case onering:
gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case tworings:
gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case threerings:
gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case fourrings:
gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
}
else
switch (o->rings) {
break;
case onering:
gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case tworings:
gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case threerings:
gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
break;
case fourrings:
gegl_node_link_many (state->input, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->s2, state->s3, state->s4, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
}
}
property_boolean (colormode, _("Recolor bevel"), FALSE)
description (_("Recolor Bevel with whatever color you want. By default this is disabled."))
property_color (color, _("Color of bevel"), "#ff9f00")
description (_("Optional Color Overlay for Ringed Bevel. Is only enabled if its checkbox is on."))
ui_meta ("sensitive", "colormode")
Fri Oct 13, 2023 6:47 am
/*This is a median blur's radius being called to make the bevel larger, I can't use custom bevel's size because that doesn't work in enlarging both custom bevels*/
gegl_operation_meta_redirect (operation, "bevelsize", state->mediandictator, "radius");
/*These list the azimuth, elevation and depth of my custom bevel plugin.*/
gegl_operation_meta_redirect (operation, "azimuth", state->bevel, "azimuth");
gegl_operation_meta_redirect (operation, "elevation", state->bevel, "elevation");
gegl_operation_meta_redirect (operation, "depth", state->bevel, "depth");
/*This controls the size of ALL ssg nodes*/
gegl_operation_meta_redirect (operation, "ringsize", state->s1, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s2, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s3, "stroke");
gegl_operation_meta_redirect (operation, "ringsize", state->s4, "stroke");
/*This controls the blend mode of the bevel and the rings*/
gegl_operation_meta_redirect (operation, "blendrings", state->bevel, "blendmode");
gegl_operation_meta_redirect (operation, "blendbevel", state->bevel2, "blendmode");
/*This controls the shape of the rings. It is gegl:ssg grow-shape=square,circle,diamond*/
gegl_operation_meta_redirect (operation, "ringshape", state->s1, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s2, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s3, "grow-shape");
gegl_operation_meta_redirect (operation, "ringshape", state->s4, "grow-shape");
/*Slide up if Bevel color is dark. This allows the bevel to work on dark colors*/
gegl_operation_meta_redirect (operation, "darkbevelslider", state->levels, "out-low");
/*Recolor node that only kicks in with the checkbox*/
gegl_operation_meta_redirect (operation, "color", state->color, "value");
enum_start (ring_time)
enum_value (onering, "onering",
N_("One Ring"))
enum_value (tworings, "tworings",
N_("Two Rings"))
enum_value (threerings, "threerings",
N_("Three Rings"))
enum_value (fourrings, "fourrings",
N_("Four Rings"))
enum_end (ringtime)
/* This ENUM list has a unique name to avoid conflicts with other plugins or Gimp filters*/
property_enum (rings, _("Amount of rings"),
ringtime, ring_time,
fourrings)
description (_("Choose the amount of rings 1-4"))
property_int (bevelsize, _("Size of the bevel"), 3)
value_range (1, 9)
ui_range (1, 9)
ui_meta ("unit", "pixel-distance")
description (_("Median Radius to control the size of the bevel"))
property_int (ringsize, _("Ring size"), 6)
value_range (3, 9)
ui_range (3, 9)
ui_meta ("unit", "pixel-distance")
description (_("Control the size of the rings"))
property_double (azimuth, _("Azimuth of ring bevel"), 67.0)
description (_("Light angle (degrees)"))
value_range (20, 90)
ui_meta ("unit", "degree")
ui_meta ("direction", "ccw")
property_double (elevation, _("Elevation of ring bevel"), 35.0)
description (_("Elevation angle (degrees). This appears to rotate the brightest pixels."))
value_range (7, 70)
ui_meta ("unit", "degree")
property_int (depth, _("Depth and or detail of ring bevel"), 24)
description (_("Brings out depth and or detail of the bevel depending on the blend mode"))
value_range (8, 45)
enum_start (under_bevel_blend_mode)
enum_value (GEGL_BLEND_MODE_TYPE_HARDLIGHT, "Hardlight",
N_("HardLight"))
enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLY, "Multiply",
N_("Multiply"))
enum_value (GEGL_BLEND_MODE_TYPE_COLORDODGE, "ColorDodge",
N_("ColorDodge"))
enum_value (GEGL_BLEND_MODE_TYPE_PLUS, "Plus",
N_("Plus"))
enum_value (GEGL_BLEND_MODE_TYPE_DARKEN, "Darken",
N_("Darken"))
enum_value (GEGL_BLEND_MODE_TYPE_LIGHTEN, "Lighten",
N_("Lighten"))
enum_value (GEGL_BLEND_MODE_TYPE_OVERLAY, "Overlay",
N_("Overlay"))
enum_value (GEGL_BLEND_MODE_TYPE_GRAINMERGE, "GrainMerge",
N_("Grain Merge"))
enum_value (GEGL_BLEND_MODE_TYPE_SOFTLIGHT, "Softlight",
N_("Soft Light"))
enum_value (GEGL_BLEND_MODE_TYPE_ADDITION, "Addition",
N_("Addition"))
enum_end (underbevelblendmode)
property_enum (blendbevel, _("Under bevel blend mode"),
underbevelblendmode, under_bevel_blend_mode,
GEGL_BLEND_MODE_TYPE_HARDLIGHT)
ui_meta ("axis", "blendbevel")
description (_("Blend mode of the bevel under the rings"))
enum_start (ring_bevel_blend_mode)
enum_value (GEGL_BLEND_MODE_TYPE_HARDLIGHTX, "Hardlight",
N_("HardLight"))
enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLYX, "Multiply",
N_("Multiply"))
enum_value (GEGL_BLEND_MODE_TYPE_COLORDODGEX, "ColorDodge",
N_("ColorDodge"))
enum_value (GEGL_BLEND_MODE_TYPE_PLUSX, "Plus",
N_("Plus"))
enum_value (GEGL_BLEND_MODE_TYPE_DARKENX, "Darken",
N_("Darken"))
enum_value (GEGL_BLEND_MODE_TYPE_LIGHTENX, "Lighten",
N_("Lighten"))
enum_value (GEGL_BLEND_MODE_TYPE_OVERLAYX, "Overlay",
N_("Overlay"))
enum_value (GEGL_BLEND_MODE_TYPE_GRAINMERGEX, "GrainMerge",
N_("Grain Merge"))
enum_value (GEGL_BLEND_MODE_TYPE_SOFTLIGHTX, "Softlight",
N_("Soft Light"))
enum_value (GEGL_BLEND_MODE_TYPE_ADDITIONX, "Addition",
N_("Addition"))
enum_end (ringbevelblendmode)
property_enum (blendrings, _("Ring bevel blend mode"),
ringbevelblendmode, ring_bevel_blend_mode,
GEGL_BLEND_MODE_TYPE_HARDLIGHTX)
description (_("Blend mode of the ring bevel"))
enum_start (shape_of_ring)
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_SQUARE, "square", N_("Square"))
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_CIRCLE, "circle", N_("Circle"))
enum_value (GEGL_MEDIAN_BLUR_NEIGHBORHOOD_DIAMOND, "diamond", N_("Diamond"))
enum_end (shapeofring)
property_enum (ringshape, _("Shape of ring"),
shapeofring, shape_of_ring,
GEGL_MEDIAN_BLUR_NEIGHBORHOOD_CIRCLE)
description (_("Shape of the Rings that internally uses Median Blur's neighborhood setting (square, circle, diamond)"))
property_double (darkbevelslider, _("Dark color bevel fix"), 0.0)
description (_("Elevation "))
value_range (0.0, 0.12)
ui_meta ("unit", "degree")
description (_("Slide up if the Bevel is a dark color and the dark color will conform to the bevel. If not the dark color will not look proper. If this slider is up on a light color then it will modify it in a potential unwanted way."))
property_boolean (colormode, _("Recolor bevel"), FALSE)
description (_("Recolor Bevel with whatever color you want. By default this is disabled."))
property_color (color, _("Color of bevel"), "#ff9f00")
description (_("Optional Color Overlay for Ringed Bevel. Is only enabled if its checkbox is on."))
ui_meta ("sensitive", "colormode")
state->levels = gegl_node_new_child (gegl,
"operation", "gegl:levels",
NULL);
Fri Oct 13, 2023 6:58 am
property_color (color, _("Color of bevel"), "#ff9f00")
description (_("Optional Color Overlay for Ringed Bevel. Is only enabled if its checkbox is on."))
ui_meta ("sensitive", "colormode")
Fri Oct 13, 2023 9:47 am
gegl_node_link_many (state->input, state->color, state->mediandictator, state->levels, state->idref, state->erase, state->bevel, state->behind, state->idrefimage, state->multiply, state->output, NULL);
gegl_node_link_many (state->idref, state->median, state->s1, state->fix, NULL);
gegl_node_connect_from (state->erase, "aux", state->fix, "output");
gegl_node_link_many (state->idref, state->bevel2, NULL);
gegl_node_connect_from (state->behind, "aux", state->bevel2, "output");
gegl_node_link_many (state->idrefimage, state->image, NULL);
gegl_node_connect_from (state->multiply, "aux", state->image, "output");
Fri Oct 13, 2023 10:04 am
Fri Oct 13, 2023 2:25 pm
Fri Oct 13, 2023 4:06 pm
Sat Oct 14, 2023 9:51 pm