Skip to content

Commit 36e3594

Browse files
authored
Add files via upload
GEGL Effects July 22 2023 Release. Bevel got an update that gives it a new sharp bevel mode that is also in GEGL Effects. Also, like many other filters GEGL Effects got a update to show up in Gimp 2.99/3's main menu via "gimp:menu-path", and gimp:menu-label. This will only be applied in 2.99/3 and not Gimp 2.10. 2.10 users will have the sharp bevel of course but not the filter appearing in the menu.
1 parent 121b66a commit 36e3594

6 files changed

Lines changed: 171 additions & 47 deletions

File tree

compile_bevel_here/bevel_bump.c

Lines changed: 133 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,75 @@
2323
/*
2424
Graph here to test without installing.
2525
26+
"normal bevel"
2627
id=1 gimp:layer-mode layer-mode=normal composite-mode=clip-to-backdrop aux=[color value=#ffffff opacity value=0.1 ]
2728
gaussian-blur std-dev-x=2 std-dev-y=2
2829
emboss azimuth=44 depth=9
2930
gimp:threshold-alpha value=0.03
30-
*/
3131
32-
#include "config.h"
33-
#include <glib/gi18n-lib.h>
32+
"alt emboss graph"
33+
id=1 gimp:layer-mode layer-mode=normal composite-mode=clip-to-backdrop aux=[color value=#ffffff opacity value=0.1 ]
34+
gaussian-blur std-dev-x=2 std-dev-y=2
35+
emboss azimuth=44 depth=9
3436
35-
#ifdef GEGL_PROPERTIES
3637
37-
property_boolean (effectsswitchbevel, _("Enable Bevel (FOR GEGL EFFECTS ONLY)"), TRUE)
38-
description (_("This switch exist for GEGL Effects testing. You won't find it in stand alone bevel. Or even in current *June 7th 2023 GEGL Effects.'"))
39-
ui_meta ("role", "output-extent")
38+
"alt sharp bevel graph"
39+
median-blur radius=3 alpha-percentile=100 id=0 src aux=[ ref=0 median-blur radius=0 distance-transform color-to-alpha opacity-threshold=0.1 color=black emboss depth=4
40+
]
41+
levels in-high=1.3 in-low=0.33
42+
bilateral-filter blur-radius=3*/
4043

41-
property_boolean (embossmode, _("Emboss Mode (use Gimp's layer Grain Merge blend mode)"), FALSE)
42-
description (_("Make an embossed bevel'"))
4344

45+
#define EMBEDDEDGRAPH \
46+
" color-to-alpha opacity-threshold=0.1 color=black "\
47+
48+
49+
#include "config.h"
50+
#include <glib/gi18n-lib.h>
51+
52+
#ifdef GEGL_PROPERTIES
4453

54+
property_enum (type, _("Type of Bevel"),
55+
GeglBlendModeTypebeavbevel, gegl_blend_mode_typebeavbevel,
56+
GEGL_BEVEL_NORMAL)
57+
description (_("Sharp Bevel mode requires the user to change the depth angle to less then 70 or above 115 for it to work proper."))
4558

4659
property_double (radius1, _("Radius Normal Bevel"), 7.0)
4760
value_range (0.5, 40.0)
4861
ui_range (1.0, 9.0)
4962
ui_gamma (1.5)
63+
ui_meta ("visible", "!type {sharpbevel}" )
64+
description (_("Make a normal bevel bump map using Gaussian Blur"))
5065

51-
property_int (radius2, _("Radius Sharp Bevel"), 0)
52-
description(_("Box Blur -0 means disabled by default"))
66+
67+
68+
property_int (radius2, _("Radius Sharper Bevel"), 0)
69+
description (_("Make a sharper bevel bump map using Box Blur - this is not the same as --sharp bevel mode--. Box Blur 0 is the default setting which disables this effect by default. Both normal bevel and sharp bevel sliders can be used together to hybridiz the bevel. "))
5370
value_range (0, 10.0)
5471
ui_range (0, 9.0)
5572
ui_gamma (1.5)
73+
ui_meta ("visible", "!type {sharpbevel}" )
74+
5675

5776

58-
property_double (bevel1, _("Depth Angle"), 90.0)
77+
property_double (bevel1, _("Depth Angle"), 45.0)
5978
description (_("Elevation angle (degrees)"))
6079
value_range (0, 180)
6180
ui_meta ("unit", "degree")
6281

82+
6383
property_int (bevel2, _("Depth"), 40)
64-
description (_("Filter width"))
84+
description (_("Emboss depth -Brings out depth and detail of the bevel"))
6585
value_range (1, 100)
6686

6787

6888
property_double (th, _("Bevel's coverage threshold."), 0.100)
69-
description (_("Lower covers more and higher covers less."))
89+
description (_("Internal Threshold Alpha. Lower covers more and higher covers less."))
7090
value_range (0.0, 1.0)
7191
ui_range (0.0, 0.5)
72-
ui_meta ("sensitive", "! embossmode")
92+
ui_meta ("visible", "type {normalbevel}" )
93+
94+
7395

7496
property_double (azimuth, _("Rotate Lighting"), 40.0)
7597
description (_("Light angle (degrees)"))
@@ -78,12 +100,38 @@ property_double (azimuth, _("Rotate Lighting"), 40.0)
78100
ui_meta ("direction", "ccw")
79101

80102

103+
81104
property_double (slideupblack, _("Black Bevel/Image Bevel mode."), 0.00)
82105
description (_("This slider allows GEGL bevel to works on black Bevels; but the user must still manually select blend modes like Grain Merge and Hardlight that are known to work with very dark Bevels. This also allows bevel to be applied on image file overlays without conforming to an image's details."))
83106
value_range (0.00, 0.999)
84107
ui_steps (0.01, 0.50)
85108

86109

110+
property_enum (metric, _("Distance Map Setting"),
111+
GeglDistanceMetric, gegl_distance_metric, GEGL_DISTANCE_METRIC_CHEBYSHEV)
112+
description (_("Distance Map has three settings that alter the structure of the sharp bevel. Chebyshev is the default; due to it being the best. But try the other two. "))
113+
ui_meta ("visible", "type {sharpbevel}" )
114+
115+
property_double (smooth, _("Smooth Roughness "), 2.5)
116+
description(_("Bilateral blur smoothes roughness of the sharp bevel but is resource intensive at high values."))
117+
value_range (0.0, 10.0)
118+
ui_range (0.0, 10.0)
119+
ui_gamma (1.5)
120+
ui_meta ("visible", "type {sharpbevel}" )
121+
122+
123+
124+
125+
126+
enum_start (gegl_blend_mode_typebeavbevel)
127+
enum_value (GEGL_BEVEL_NORMAL, "normalbevel",
128+
N_("Normal Bevel"))
129+
enum_value (GEGL_BEVEL_SHARP, "sharpbevel",
130+
N_("Sharp Bevel"))
131+
enum_value (GEGL_BEVEL_EMBOSS_MODE, "embossmode",
132+
N_("Emboss Bevel (requires Gimp Layers)"))
133+
enum_end (GeglBlendModeTypebeavbevel)
134+
87135

88136
#else
89137

@@ -105,6 +153,14 @@ typedef struct
105153
GeglNode *normallayer;
106154
GeglNode *slideupblack;
107155
GeglNode *fix;
156+
GeglNode *dt;
157+
GeglNode *c2a;
158+
GeglNode *nop;
159+
GeglNode *levels;
160+
GeglNode *replace;
161+
GeglNode *median;
162+
GeglNode *median2;
163+
GeglNode *bilateral;
108164
GeglNode *output;
109165
} State;
110166

@@ -113,7 +169,7 @@ static void attach (GeglOperation *operation)
113169
{
114170
GeglNode *gegl = operation->node;
115171
GeglProperties *o = GEGL_PROPERTIES (operation);
116-
GeglNode *input, *output, *boxblur, *blur, *emb, *th, *fix, *whitecolor, *normallayer, *slideupblack;
172+
GeglNode *input, *output, *boxblur, *blur, *emb, *th, *levels, *dt, *median, *median2, *replace, *bilateral, *nop, *c2a, *fix, *whitecolor, *normallayer, *slideupblack;
117173
GeglColor *white_color = gegl_color_new ("#ffffff");
118174

119175
input = gegl_node_get_input_proxy (gegl, "input");
@@ -153,6 +209,37 @@ normallayer = gegl_node_new_child (gegl,
153209
"operation", "gegl:crop",
154210
NULL);
155211

212+
nop = gegl_node_new_child (gegl,
213+
"operation", "gegl:nop",
214+
NULL);
215+
216+
replace = gegl_node_new_child (gegl, "operation", "gegl:src", NULL);
217+
218+
levels = gegl_node_new_child (gegl,
219+
"operation", "gegl:levels", "in-high", 1.3, "in-low", 0.33,
220+
NULL);
221+
222+
dt = gegl_node_new_child (gegl,
223+
"operation", "gegl:distance-transform", "metric", 2,
224+
NULL);
225+
226+
bilateral = gegl_node_new_child (gegl,
227+
"operation", "gegl:bilateral-filter", "edge-preservation", 0.0,
228+
NULL);
229+
230+
231+
c2a = gegl_node_new_child (gegl,
232+
"operation", "gegl:gegl", "string", EMBEDDEDGRAPH,
233+
NULL);
234+
235+
median = gegl_node_new_child (gegl,
236+
"operation", "gegl:median-blur", "radius", 3, "alpha-percentile", 100.0,
237+
NULL);
238+
239+
median2 = gegl_node_new_child (gegl,
240+
"operation", "gegl:median-blur", "radius", 0,
241+
NULL);
242+
156243
gegl_operation_meta_redirect (operation, "radius1", blur, "std-dev-x");
157244
gegl_operation_meta_redirect (operation, "radius1", blur, "std-dev-y");
158245
gegl_operation_meta_redirect (operation, "bevel1", emb, "elevation");
@@ -161,6 +248,9 @@ normallayer = gegl_node_new_child (gegl,
161248
gegl_operation_meta_redirect (operation, "radius2", boxblur, "radius");
162249
gegl_operation_meta_redirect (operation, "th", th, "value");
163250
gegl_operation_meta_redirect (operation, "slideupblack", slideupblack, "value");
251+
gegl_operation_meta_redirect (operation, "smooth", bilateral, "blur-radius");
252+
gegl_operation_meta_redirect (operation, "metric", dt, "metric");
253+
164254

165255

166256
/* Now save points to the various gegl nodes so we can rewire them in
@@ -176,37 +266,46 @@ normallayer = gegl_node_new_child (gegl,
176266
state->normallayer = normallayer;
177267
state->slideupblack = slideupblack;
178268
state->fix = fix;
269+
state->median = median;
270+
state->median2 = median2;
271+
state->levels = levels;
272+
state->nop = nop;
273+
state->replace = replace;
274+
state->bilateral = bilateral;
275+
state->c2a = c2a;
276+
state->dt = dt;
179277
state->output = output;
180278
o->user_data = state;
181279
}
182280

183281
static void
282+
184283
update_graph (GeglOperation *operation)
185284
{
186285
GeglProperties *o = GEGL_PROPERTIES (operation);
187286
State *state = o->user_data;
188-
if (!state) return;
189287

190-
if (o->effectsswitchbevel)
191-
if (o->embossmode)
192-
{
193-
gegl_node_link_many (state->input, state->normallayer, state->blur, state->boxblur, state->emb, state->fix, state->output, NULL);
288+
switch (o->type) {
289+
break;
290+
case GEGL_BEVEL_NORMAL:
291+
gegl_node_link_many (state->input, state->normallayer, state->blur, state->boxblur, state->emb, state->th, state->fix, state->output, NULL);
292+
gegl_node_link_many (state->input, state->whitecolor, state->slideupblack, NULL);
293+
gegl_node_connect_from (state->normallayer, "aux", state->slideupblack, "output");
294+
break;
295+
case GEGL_BEVEL_SHARP:
296+
gegl_node_link_many (state->input, state->normallayer, state->median, state->nop, state->replace, state->levels, state->bilateral, state->output, NULL);
297+
gegl_node_link_many (state->nop, state->median2, state->dt, state->c2a, state->emb, NULL);
298+
gegl_node_connect_from (state->replace, "aux", state->emb, "output");
194299
gegl_node_link_many (state->input, state->whitecolor, state->slideupblack, NULL);
195300
gegl_node_connect_from (state->normallayer, "aux", state->slideupblack, "output");
196-
}
197-
else
198-
{
199-
gegl_node_link_many (state->input, state->normallayer, state->blur, state->boxblur, state->emb, state->th, state->fix, state->output, NULL);
301+
break;
302+
case GEGL_BEVEL_EMBOSS_MODE:
303+
gegl_node_link_many (state->input, state->normallayer, state->blur, state->boxblur, state->emb, state->fix, state->output, NULL);
200304
gegl_node_link_many (state->input, state->whitecolor, state->slideupblack, NULL);
201305
gegl_node_connect_from (state->normallayer, "aux", state->slideupblack, "output");
202-
}
203-
else
204-
{
205-
gegl_node_link_many (state->input, state->output, NULL);
206-
}
306+
}
207307
}
208308

209-
210309
static void
211310
gegl_op_class_init (GeglOpClass *klass)
212311
{
@@ -219,10 +318,11 @@ gegl_op_class_init (GeglOpClass *klass)
219318
gegl_operation_class_set_keys (operation_class,
220319
"name", "lb:bevel",
221320
"title", _("Bevel (to blend)"),
222-
"categories", "Artistic",
223321
"reference-hash", "45ed5656a28a512570f0f25sb2ac",
224-
"description", _("You are expected to use GEGL or Gimp blend modes with this plugin. Works best with blend modes multiply and grain merge. Emboss mode requires non-GEGL Gimp blend modes"
322+
"description", _("User is expected to use blending options with this plugin. Works best with blend modes multiply, hardlight and grain merge with varying opacities. Emboss mode requires non-GEGL Gimp layer blend modes."
225323
""),
324+
"gimp:menu-path", "<Image>/Filters/Text Styling",
325+
"gimp:menu-label", _("Bevel (to blend)..."),
226326
NULL);
227327
}
228328

compile_gegl_effects_here/gegleffectspending.c

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,29 @@ property_double (slideupblack, _("Black Bevel and Image Bevel mode. "), 0.00)
476476
ui_meta ("visible", "guichange {innerglowbevel}")
477477

478478

479+
479480
property_double (bevelopacity, _("Bevel's Opacity"), 0.999)
480481
value_range (0.15, 0.999)
481482
ui_steps (0.01, 0.50)
482483
ui_meta ("visible", "guichange {innerglowbevel}")
483484

485+
486+
property_enum (typebevel, _("Type of Bevel"),
487+
GeglBlendModeTypebeavbeveleffects, gegl_blend_mode_typebeavbeveleffects,
488+
GEGL_BEVEL_NORMAL)
489+
description (_("Change between normal bevel and a sharp bevel style. Sharp bevel style has no radius so that slider will do nothing when sharp bevel is enabled. Black Bevel when used with sharp bevel will work on some blend modes (notably screen) but in a different way, where even its most miniscule value will enable the black bevel effect. The reason for this is because sharp bevels code is different from normal bevel. "))
490+
ui_meta ("visible", "guichange {innerglowbevel}")
491+
492+
enum_start (gegl_blend_mode_typebeavbeveleffects)
493+
enum_value (GEGL_BEVEL_NORMAL, "normalbevel",
494+
N_("Normal Bevel"))
495+
enum_value (GEGL_BEVEL_SHARP, "sharpbevel",
496+
N_("Sharp Bevel"))
497+
enum_end (GeglBlendModeTypebeavbeveleffects)
498+
499+
500+
501+
484502
property_enum (blendmodebevel2, _("Select blend or Enable/Disable Bevel"),
485503
GeglBlendModeTypezz, gegl_blend_mode_type_effectszz,
486504
GEGL_BLEND_MODE_TYPE_BEVELOFF)
@@ -1247,6 +1265,8 @@ Bevel use to only work Multiply and Grain Merge until beaver solved a bug relate
12471265
case GEGL_BLEND_MODE_TYPE_LCHCOLORG: atopg = state->lchcolorg; break;
12481266

12491267
}
1268+
1269+
12501270
/* Second full Node listing. (contains four GEGL graphs for each checkbox) Nodes must be listed in proper orders. This is the GEGL Graph */
12511271
if (o->innerglow)
12521272
{
@@ -1413,7 +1433,7 @@ static void attach (GeglOperation *operation)
14131433
gegl effects use to use the default drop shadow until Beaver realized that the only way to give GEGL Effects styles seen in Adobe's layer effects was to abandon gegl:dropshadow and
14141434
make a enhanced version of it. */
14151435
stroke = gegl_node_new_child (gegl,
1416-
"operation", "gegl:zzstrokebevelimage",
1436+
"operation", "lb:zzstrokebevelimage",
14171437
NULL);
14181438

14191439
strokebehind = gegl_node_new_child (gegl,
@@ -1435,7 +1455,7 @@ strokebehind = gegl_node_new_child (gegl,
14351455
gegl effects use to use the default drop shadow until Beaver realized that the only way to give GEGL Effects styles seen in Adobe's layer effects was to abandon gegl:dropshadow and
14361456
make a enhanced version of it. */
14371457
ds = gegl_node_new_child (gegl,
1438-
"operation", "gegl:zzstrokebevelimage",
1458+
"operation", "lb:zzstrokebevelimage",
14391459
NULL);
14401460

14411461
dsbehind = gegl_node_new_child (gegl,
@@ -1541,7 +1561,7 @@ additioncolor = gegl_node_new_child (gegl,
15411561
/* All nodes relating to the bevel start here*/
15421562

15431563
mbd = gegl_node_new_child (gegl,
1544-
"operation", "lb:bevel", "th", 0.100,
1564+
"operation", "lb:bevel", "th", 0.100,
15451565
NULL);
15461566
/*The Threshold Alpha setting of the bevel is being baked in so it isn't present in the GUI.*/
15471567

@@ -1726,7 +1746,7 @@ lchcolorg = gegl_node_new_child (gegl,
17261746
gegl effects use to use the default drop shadow until Beaver realized that the only way to give GEGL Effects styles seen in Adobe's layer effects was to abandon gegl:dropshadow and
17271747
make a enhanced version of it. */
17281748
extrassg = gegl_node_new_child (gegl,
1729-
"operation", "gegl:zzstrokebevelimage",
1749+
"operation", "lb:zzstrokebevelimage",
17301750
NULL);
17311751

17321752
behindextrassg = gegl_node_new_child (gegl,
@@ -1804,7 +1824,7 @@ additionimage = gegl_node_new_child (gegl,
18041824

18051825
/*This is the hidden operation shiny text. Which is literally gegl:sinus on a specific setting, with a blend mode switcher and checkbox. */
18061826
shiny = gegl_node_new_child (gegl,
1807-
"operation", "gegl:shinytext",
1827+
"operation", "lb:shinytext",
18081828
NULL);
18091829

18101830
microblur = gegl_node_new_child (gegl,
@@ -1829,7 +1849,7 @@ drop shadow is applied in a gegl graph below them.*/
18291849

18301850
/* All nodes relating to glass on text begin here */
18311851
glassovertext = gegl_node_new_child (gegl,
1832-
"operation", "gegl:glassovertext",
1852+
"operation", "lb:glassovertext",
18331853
NULL);
18341854

18351855

@@ -1891,6 +1911,7 @@ drop shadow is applied in a gegl graph below them.*/
18911911
gegl_operation_meta_redirect (operation, "slideupblack", mbd, "slideupblack");
18921912
gegl_operation_meta_redirect (operation, "bevelopacity", mbdopacity, "value");
18931913
gegl_operation_meta_redirect (operation, "th", mbd, "th");
1914+
gegl_operation_meta_redirect (operation, "typebevel", mbd, "type");
18941915
/*End of Bevel's GUI asociations*/
18951916

18961917
/*Beginning of Image file Overlay's GUI asociations*/
@@ -2141,11 +2162,12 @@ gegl_op_class_init (GeglOpClass *klass)
21412162

21422163
gegl_operation_class_set_keys (operation_class,
21432164
"name", "gegl:layereffectscontinual",
2144-
"title", _("GEGL Effects Continual Version"),
2145-
"categories", "Generic",
2165+
"title", _("GEGL Effects Continual Edition"),
21462166
"reference-hash", "continual45ed565h8500fca01b2ac",
2147-
"description", _("GEGL text styling and specialty image outlining filter. June 24th 2023 Stable Build "
2167+
"description", _("GEGL text styling and specialty image outlining filter. July 22th 2023 Stable Build"
21482168
""),
2169+
"gimp:menu-path", "<Image>/Filters/Text Styling",
2170+
"gimp:menu-label", _("GEGL Effects CE..."),
21492171
NULL);
21502172
}
21512173

0 commit comments

Comments
 (0)