1414 * License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
1515 *
1616 * Copyright 2006 Øyvind Kolås <pippin@gimp.org>
17- * 2023 Beaver (GEGL ZZStrokeBevelImageOverlay a hidden operation to give GEGL Effects outline the ability to add a bevel, image file overlay and more )
17+ * 2023 Beaver (GEGL ZZStrokeBevelImageOverlay a hidden operation fork of drop shadow to give GEGL Effects outline the ability to add a bevel, image file overlay and more. May 16 23 it now gives GEGL Effects drop shadow a blurred image file overlay. May 17 2023 it now has an aura seed option for shadow glow )
1818 */
1919
2020#include "config.h"
2121#include <glib/gi18n-lib.h>
2222
2323#ifdef GEGL_PROPERTIES
2424
25+
26+ property_double (tile_size , _ ("Glow Aura Intensity" ), 10 )
27+ description (_ ("Average diameter of each tile (in pixels)" ))
28+ value_range (0.0 , 10.0 )
29+ ui_meta ("unit" , "pixel-distance" )
30+
31+ property_double (tile_saturation , _ ("Glow Spacing" ), 2.5 )
32+ description (_ ("Expand tiles by this amount" ))
33+ value_range (0.0 , 4.0 )
34+
35+ property_seed (seed , _ ("Seed of Glow Aura" ), rand )
36+
37+
38+
39+
40+ property_double (blurshadowimage , _ ("Blur Drop Shadow/Glow's Image file overlay" ), 0 )
41+ description (_ ("Standard deviation for the horizontal axis" ))
42+ value_range (0.0 , 40.0 )
43+ ui_range (0.24 , 40.0 )
44+ ui_gamma (3.0 )
45+ ui_meta ("unit" , "pixel-distance" )
46+
47+
48+
49+
50+
51+
2552enum_start (gegl_blend_mode_type_effectszzbevoutline )
2653 enum_value (GEGL_BLEND_MODE_TYPE_MULTIPLYGE , "MultiplyGE ",
2754 N_ ("Multiply "))
@@ -42,6 +69,8 @@ property_enum (blendmodebeveloutline, _("Blend Mode of Bevel's emboss'"),
4269 GeglBlendModeTypezzbevoutline , gegl_blend_mode_type_effectszzbevoutline ,
4370 GEGL_BLEND_MODE_TYPE_MULTIPLYGE )
4471
72+ property_boolean (enableaura , _ ("Enable Shadow/Glow Aura Mode" ), FALSE)
73+ description (_ ("Make Shadow Glow an Aura" ))
4574
4675
4776
@@ -76,20 +105,22 @@ property_color (color, _("Color"), "#ffffff")
76105
77106property_double (x , _ ("X" ), 0.0 )
78107 description (_ ("Horizontal shadow offset" ))
108+ value_range (-300 , 300.0 )
79109 ui_range (-15.0 , 15.0 )
80110 ui_steps (1 , 10 )
81111 ui_meta ("axis" , "x" )
82112
83113property_double (y , _ ("Y" ), 0.0 )
84114 description (_ ("Vertical shadow offset" ))
115+ value_range (-300 , 300.0 )
85116 ui_range (-15.0 , 15.0 )
86117 ui_steps (1 , 10 )
87118 ui_meta ("axis" , "y" )
88119
89120
90121property_double (blurstroke , _ ("Blur radius" ), 0.0 )
91- value_range (0.0 , 3 )
92- ui_range (0.0 , 3 .0 )
122+ value_range (0.0 , G_MAXDOUBLE )
123+ ui_range (0.0 , 30 .0 )
93124 ui_steps (1 , 5 )
94125 ui_gamma (1.5 )
95126 ui_meta ("unit" , "pixel-distance" )
@@ -109,6 +140,12 @@ property_double (opacity, _("Opacity"), 1)
109140 value_range (0.0 , 1.0 )
110141 ui_steps (0.01 , 0.10 )
111142
143+ property_double (opacitybevel , _ ("Opacity Bevel Outline" ), 1 )
144+ value_range (0.2 , 1.0 )
145+ ui_steps (0.01 , 0.10 )
146+
147+
148+
112149
113150
114151property_double (radius1 , _ ("Bevel Radius" ), 7.0 )
@@ -163,6 +200,7 @@ typedef struct
163200 GeglNode * input ;
164201 GeglNode * behind ;
165202 GeglNode * bevel ;
203+ GeglNode * opacitybevel ;
166204 GeglNode * multiplyge ;
167205 GeglNode * atop ;
168206 GeglNode * layer ;
@@ -174,8 +212,13 @@ typedef struct
174212 GeglNode * colordodgege ;
175213 GeglNode * shinygmge ;
176214 GeglNode * grainmergege ;
177- GeglNode * errorremover ;
215+ GeglNode * opacity ;
178216 GeglNode * disablebevel ;
217+ GeglNode * blurshadowimage ;
218+ GeglNode * median ;
219+ GeglNode * gaussian ;
220+ GeglNode * cubismglow ;
221+ GeglNode * move ;
179222 GeglNode * output ;
180223} State ;
181224
@@ -184,7 +227,7 @@ static void attach (GeglOperation *operation)
184227{
185228 GeglNode * gegl = operation -> node ;
186229 GeglProperties * o = GEGL_PROPERTIES (operation );
187- GeglNode * input , * output , * behind , * nop , * errorremover , * huelight , * bevel , * multiplyge , * disablebevel , * atop , * layer , * stroke , * hardlightge , * shinygmge , * grainmergege , * colordodgege , * color ;
230+ GeglNode * input , * output , * behind , * median , * cubismglow , * gaussian , * move , * nop , * opacity , * huelight , * opacitybevel , * bevel , * multiplyge , * disablebevel , * blurshadowimage , * atop , * layer , * stroke , * hardlightge , * shinygmge , * grainmergege , * colordodgege , * color ;
188231
189232
190233 input = gegl_node_get_input_proxy (gegl , "input" );
@@ -195,10 +238,31 @@ static void attach (GeglOperation *operation)
195238 "operation" , "gegl:color-overlay" ,
196239 NULL );
197240
241+ median = gegl_node_new_child (gegl , "operation" , "gegl:median-blur" ,
242+ "percentile" , 100.0 ,
243+ "alpha-percentile" , 100.0 ,
244+ "abyss-policy" , GEGL_ABYSS_NONE ,
245+ NULL );
246+
247+ gaussian = gegl_node_new_child (gegl , "operation" , "gegl:gaussian-blur" ,
248+ "clip-extent" , FALSE,
249+ "abyss-policy" , 0 ,
250+ NULL );
251+
252+ move = gegl_node_new_child (gegl ,
253+ "operation" , "gegl:translate" ,
254+ NULL );
255+
256+
198257 disablebevel = gegl_node_new_child (gegl ,
199258 "operation" , "gegl:dst" ,
200259 NULL );
201260
261+ blurshadowimage = gegl_node_new_child (gegl ,
262+ "operation" , "gegl:gaussian-blur" ,
263+ NULL );
264+
265+
202266
203267
204268 nop = gegl_node_new_child (gegl ,
@@ -215,9 +279,6 @@ static void attach (GeglOperation *operation)
215279 "operation" , "gegl:dropshadow" ,
216280 NULL );
217281
218- multiplyge = gegl_node_new_child (gegl ,
219- "operation" , "gegl:multiply" ,
220- NULL );
221282
222283 atop = gegl_node_new_child (gegl ,
223284 "operation" , "gegl:src-atop" ,
@@ -227,6 +288,11 @@ static void attach (GeglOperation *operation)
227288 "operation" , "gegl:layer" ,
228289 NULL );
229290
291+ cubismglow = gegl_node_new_child (gegl ,
292+ "operation" , "gegl:cubism" ,
293+ NULL );
294+
295+
230296 bevel = gegl_node_new_child (gegl ,
231297 "operation" , "gegl:bevel" ,
232298 NULL );
@@ -235,11 +301,17 @@ static void attach (GeglOperation *operation)
235301 "operation" , "gegl:hue-chroma" ,
236302 NULL );
237303
238- errorremover = gegl_node_new_child (gegl ,
304+ opacity = gegl_node_new_child (gegl ,
305+ "operation" , "gegl:opacity" ,
306+ NULL );
307+
308+ opacitybevel = gegl_node_new_child (gegl ,
239309 "operation" , "gegl:opacity" ,
240310 NULL );
241311
242312
313+ multiplyge = gegl_node_new_child (gegl ,
314+ "operation" , "gimp:layer-mode" , "layer-mode" , 30 , "composite-mode" , 0 , NULL );
243315
244316grainmergege = gegl_node_new_child (gegl ,
245317 "operation" , "gimp:layer-mode" , "layer-mode" , 47 , "composite-mode" , 0 , NULL );
@@ -255,31 +327,40 @@ hardlightge = gegl_node_new_child (gegl,
255327
256328
257329 gegl_node_link_many (input , behind , output , NULL );
258- gegl_node_link_many (input , errorremover , stroke , color , atop , multiplyge , NULL );
330+ gegl_node_link_many (input , median , gaussian , move , opacity , color , atop , multiplyge , NULL );
259331 /*gegl_node_link (layer, NULL);*/
260- gegl_node_link_many (atop , bevel , NULL );
332+ gegl_node_link_many (atop , bevel , opacitybevel , NULL );
261333
262334 gegl_node_connect_from (multiplyge , "aux" , bevel , "output" );
263335 gegl_node_connect_from (atop , "aux" , layer , "output" );
264336 gegl_node_connect_from (behind , "aux" , multiplyge , "output" );
265337
266338
339+ gegl_operation_meta_redirect (operation , "tile_saturation" , cubismglow , "tile-saturation" );
267340
341+ gegl_operation_meta_redirect (operation , "tile_size" , cubismglow , "tile-size" );
268342
269- gegl_operation_meta_redirect (operation , "stroke " , stroke , "grow-radius " );
343+ gegl_operation_meta_redirect (operation , "seed " , cubismglow , "seed " );
270344
271- gegl_operation_meta_redirect (operation , "blurstroke " , stroke , "radius " );
345+ gegl_operation_meta_redirect (operation , "blurshadowimage " , blurshadowimage , "std-dev-x " );
272346
273- gegl_operation_meta_redirect (operation , "x " , stroke , "x " );
347+ gegl_operation_meta_redirect (operation , "blurshadowimage " , blurshadowimage , "std-dev-y " );
274348
275- gegl_operation_meta_redirect (operation , "y " , stroke , "y " );
349+ gegl_operation_meta_redirect (operation , "stroke " , median , "radius " );
276350
277- gegl_operation_meta_redirect (operation , "grow_shape " , stroke , "grow-shape " );
351+ gegl_operation_meta_redirect (operation , "blurstroke " , gaussian , "std-dev-x " );
278352
279- gegl_operation_meta_redirect (operation , "opacity " , stroke , "opacity " );
353+ gegl_operation_meta_redirect (operation , "blurstroke " , gaussian , "std-dev-y " );
280354
281- gegl_operation_meta_redirect (operation , "opacity " , errorremover , "value " );
355+ gegl_operation_meta_redirect (operation , "x " , move , "x " );
282356
357+ gegl_operation_meta_redirect (operation , "y" , move , "y" );
358+
359+ gegl_operation_meta_redirect (operation , "grow_shape" , median , "neighborhood" );
360+
361+ gegl_operation_meta_redirect (operation , "opacity" , opacity , "value" );
362+
363+ gegl_operation_meta_redirect (operation , "opacitybevel" , opacitybevel , "value" );
283364
284365 gegl_operation_meta_redirect (operation , "color" , stroke , "color" );
285366
@@ -311,8 +392,11 @@ hardlightge = gegl_node_new_child (gegl,
311392 State * state = g_malloc0 (sizeof (State ));
312393 state -> input = input ;
313394 state -> behind = behind ;
395+ state -> cubismglow = cubismglow ;
314396 state -> bevel = bevel ;
397+ state -> opacitybevel = opacitybevel ;
315398 state -> disablebevel = disablebevel ;
399+ state -> blurshadowimage = blurshadowimage ;
316400 state -> multiplyge = multiplyge ;
317401 state -> atop = atop ;
318402 state -> layer = layer ;
@@ -324,8 +408,11 @@ hardlightge = gegl_node_new_child (gegl,
324408 state -> shinygmge = shinygmge ;
325409 state -> grainmergege = grainmergege ;
326410 state -> colordodgege = colordodgege ;
327- state -> errorremover = errorremover ;
411+ state -> opacity = opacity ;
328412 state -> output = output ;
413+ state -> median = median ;
414+ state -> gaussian = gaussian ;
415+ state -> move = move ;
329416 o -> user_data = state ;
330417}
331418
@@ -350,22 +437,32 @@ update_graph (GeglOperation *operation)
350437 }
351438
352439
353-
354440 if (o -> enableoutline )
355441 if (o -> specialoutline )
442+ if (o -> enableaura )
356443 {
357444 gegl_node_link_many (state -> input , state -> behind , state -> output , NULL );
358- gegl_node_link_many (state -> stroke , state -> color , state -> atop , multiplyge , NULL );
359- gegl_node_link_many (state -> nop , state -> layer , state -> huelight , NULL );
360- gegl_node_link_many (state -> atop , state -> bevel , NULL );
361- gegl_node_connect_from (multiplyge , "aux" , state -> bevel , "output" );
445+ gegl_node_link_many (state -> median , state -> cubismglow , state -> gaussian , state -> move , state -> opacity , state -> color , state -> atop , multiplyge , NULL );
446+ gegl_node_link_many (state -> nop , state -> layer , state -> blurshadowimage , state -> huelight , NULL );
447+ gegl_node_link_many (state -> atop , state -> bevel , state -> opacitybevel , NULL );
448+ gegl_node_connect_from (multiplyge , "aux" , state -> opacitybevel , "output" );
362449 gegl_node_connect_from (state -> atop , "aux" , state -> huelight , "output" );
363450 gegl_node_connect_from (state -> behind , "aux" , multiplyge , "output" );
364451 }
365452else
366453 {
367454 gegl_node_link_many (state -> input , state -> behind , state -> output , NULL );
368- gegl_node_link_many (state -> stroke , state -> color , NULL );
455+ gegl_node_link_many (state -> median , state -> gaussian , state -> move , state -> opacity , state -> color , state -> atop , multiplyge , NULL );
456+ gegl_node_link_many (state -> nop , state -> layer , state -> blurshadowimage , state -> huelight , NULL );
457+ gegl_node_link_many (state -> atop , state -> bevel , state -> opacitybevel , NULL );
458+ gegl_node_connect_from (multiplyge , "aux" , state -> opacitybevel , "output" );
459+ gegl_node_connect_from (state -> atop , "aux" , state -> huelight , "output" );
460+ gegl_node_connect_from (state -> behind , "aux" , multiplyge , "output" );
461+ }
462+ else
463+ {
464+ gegl_node_link_many (state -> input , state -> behind , state -> output , NULL );
465+ gegl_node_link_many (state -> median , state -> gaussian , state -> move , state -> opacity , state -> color , NULL );
369466 gegl_node_connect_from (state -> behind , "aux" , state -> color , "output" );
370467 }
371468else
376473
377474
378475
476+
379477static void
380478gegl_op_class_init (GeglOpClass * klass )
381479{
@@ -387,7 +485,7 @@ gegl_op_class_init (GeglOpClass *klass)
387485
388486 gegl_operation_class_set_keys (operation_class ,
389487 "name" , "gegl:zzstrokebevelimage" ,
390- "title" , _ ("Hidden Operation to bevel and image file overlay a stroke for GEGL Effects" ),
488+ "title" , _ ("Hidden Operation to bevel and image file overlay a stroke for GEGL Effects. GEGL Effects will not work at all without this hidden operation. " ),
391489 "categories" , "hidden" ,
392490 "reference-hash" , "33234v25str2ac" ,
393491 "description" , _ ("Hidden Operation for testing on GEGL Effects"
0 commit comments