Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxBeaver authored Jan 25, 2023
1 parent 739a008 commit 5621d4a
Show file tree
Hide file tree
Showing 10 changed files with 350 additions and 0 deletions.
Binary file added Image_files_Beaver_used/caustics.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Image_files_Beaver_used/yellow_blue3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

You need to build clay.so/dll zzmediangraph.so/dll and zzopacity.so/dll and put them in /gegl-0.4/plug-ins
## Compiling and Installing

### Linux

To compile and install you will need the GEGL header files (`libgegl-dev` on
Debian based distributions or `gegl` on Arch Linux) and meson (`meson` on
most distributions).

```bash
meson setup --buildtype=release build
ninja -C build

```

If you have an older version of gegl you may need to copy to `~/.local/share/gegl-0.3/plug-ins`
instead (on Ubuntu 18.04 for example).



### Windows

The easiest way to compile this project on Windows is by using msys2. Download
and install it from here: https://www.msys2.org/

Open a msys2 terminal with `C:\msys64\mingw64.exe`. Run the following to
install required build dependencies:

```bash
pacman --noconfirm -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-meson mingw-w64-x86_64-gegl
```

Then build the same way you would on Linux:

```bash
meson setup --buildtype=release build
ninja -C build
```



4 changes: 4 additions & 0 deletions build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash


meson setup --buildtype=release build && ninja -C build
39 changes: 39 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Autogenerated by the Meson build system.
* Do not edit, your changes will be lost.
*/

#pragma once

#define ARCH_X86 1

#define ARCH_X86_64 1

#define GEGL_LIBRARY "gegl-0.4"

#define GEGL_MAJOR_VERSION 0

#define GEGL_MICRO_VERSION 34

#define GEGL_MINOR_VERSION 4

#undef GEGL_UNSTABLE

#define GETTEXT_PACKAGE "gegl-0.4"

#define HAVE_EXECINFO_H

#define HAVE_FSYNC

#undef HAVE_GEXIV2

#undef HAVE_LUA

#define HAVE_MALLOC_TRIM

#undef HAVE_MRG

#define HAVE_STRPTIME

#define HAVE_UNISTD_H

23 changes: 23 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project('ssg', 'c',
version : '0.1',
license : 'GPL-3.0-or-later')

# These arguments are only used to build the shared library
# not the executables that use the library.
lib_args = ['-DBUILDING_GEGLACTIONLINES']

gegl = dependency('gegl-0.3', required : false)
if not gegl.found()
gegl = dependency('gegl-0.4')
endif
shlib = shared_library('ssg', 'ssg.c', 'config.h',
c_args : lib_args,
dependencies : gegl,
name_prefix : '',
)

# Make this library usable as a Meson subproject.
stroke_dep = declare_dependency(
include_directories: include_directories('.'),
link_with : shlib)

Binary file added preview1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
242 changes: 242 additions & 0 deletions ssg.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
/* 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 (GEGL SSG (stroke, shadow, glow) )
*/

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

#ifdef GEGL_PROPERTIES


/* Should correspond to GeglMedianBlurNeighborhood in median-blur.c */
enum_start (gegl_stroke_grow_shape2)
enum_value (GEGL_stroke_GROW_SHAPE_SQUARE2, "square", N_("Square"))
enum_value (GEGL_stroke_GROW_SHAPE_CIRCLE2, "circle", N_("Circle"))
enum_value (GEGL_stroke_GROW_SHAPE_DIAMOND2, "diamond", N_("Diamond"))
enum_end (GeglstrokeGrowShape2)

property_enum (grow_shape, _("Grow shape"),
GeglstrokeGrowShape2, gegl_stroke_grow_shape2,
GEGL_stroke_GROW_SHAPE_CIRCLE2)
description (_("The shape to expand or contract the stroke in"))



property_color (color, _("Color"), "#000000")
ui_meta ("role", "output-extent")

property_color (colorssg, _("Color Overlay"), "#ffffff")



property_double (x, _("Horizontal position of SSG"), 0.0)
description (_("Horizontal shadow offset"))
ui_range (-40, 40)
ui_steps (-40, 40)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "x")

property_double (y, _("Vertical position of SSG"), 0.0)
description (_("Vertical shadow offset"))
ui_range (-40, 40)
ui_steps (-40, 40)
ui_meta ("unit", "pixel-distance")
ui_meta ("axis", "y")



property_double (blurstroke, _("Blur to create Shadow or Glow"), 0.5)
value_range (0.0, G_MAXDOUBLE)
ui_range (0.0, 100.0)
ui_steps (1, 5)
ui_gamma (1.5)
ui_meta ("unit", "pixel-distance")


property_double (stroke, _("Grow radius of SSG"), 9.0)
value_range (0, 300.0)
ui_range (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/shadow before blurring; a negative value will contract the shadow instead"))


property_double (opacity, _("Opacity"), 2)
value_range (0.0, 4.0)
ui_steps (0.0, 4.0)
ui_meta ("role", "output-extent")

property_double (alpha_percentile, _("Alpha percentile"), 0)
value_range (0, 100)
description (_("Neighborhood alpha percentile"))
ui_meta ("role", "output-extent")

property_int (radius, _("Make the SSG go inward or outward"), 1)
value_range (-250, 10)
ui_range (0, 2)
description (_("Hidden Settings are meant for Graphs and removing edge pixels with the erase or split blend mode"))


property_double (blur, _("Smooth SSG"), 0.0)
description (_("A light blur to smooth the rough edges"))
value_range (0, 1.5)
ui_range (0, 1.5)
ui_gamma (3.5)
ui_meta ("role", "output-extent")


property_file_path(image, _("Image file overlay"), "")
description (_("Source image file path (png, jpg, raw, svg, bmp, tif, ...)"))



property_double (blur2, _("Blur Image file Overlay"), 0.0)
description (_("A light blur to smooth the rough edges"))
value_range (0, 40.0)
ui_range (0, 40.0)
ui_gamma (1.5)

property_double (opacityssg, _("Opacity for everything"), 2)
value_range (0.0, 4.0)
ui_steps (0.0, 4.0)

property_double (hue, _("Hue Rotation for everything - will over ride original color"), 0.0)
description (_("Color rotation that adjust all GEGL nodes below it'"))
value_range (-180.0, 180.0)



#else

#define GEGL_OP_META
#define GEGL_OP_NAME ssg
#define GEGL_OP_C_SOURCE ssg.c

#include "gegl-op.h"

static void attach (GeglOperation *operation)
{
GeglNode *gegl = operation->node;
GeglNode *input, *output, *median, *blur, *id1, *ssg, *xor, *color, *atop, *image, *blur2, *opacity, *hue;


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);


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


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

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


median = gegl_node_new_child (gegl,
"operation", "gegl:median-blur",
NULL);

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

blur = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);

blur2 = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);

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

hue = gegl_node_new_child (gegl,
"operation", "gegl:hue-chroma",
NULL);

xor = gegl_node_new_child (gegl,
"operation", "gimp:layer-mode", "layer-mode", 60, NULL);

gegl_operation_meta_redirect (operation, "colorssg", color, "value");
gegl_operation_meta_redirect (operation, "color", ssg, "color");
gegl_operation_meta_redirect (operation, "opacity", ssg, "value");
gegl_operation_meta_redirect (operation, "opacityssg", opacity, "value");
gegl_operation_meta_redirect (operation, "stroke", ssg, "grow-radius");
gegl_operation_meta_redirect (operation, "blurstroke", ssg, "radius");
gegl_operation_meta_redirect (operation, "x", ssg, "x");
gegl_operation_meta_redirect (operation, "y", ssg, "y");
gegl_operation_meta_redirect (operation, "grow_shape", ssg, "grow-shape");
gegl_operation_meta_redirect (operation, "alpha_percentile", median, "alpha-percentile");
gegl_operation_meta_redirect (operation, "radius", median, "radius");
gegl_operation_meta_redirect (operation, "image", image, "src");
gegl_operation_meta_redirect (operation, "hue", hue, "hue");
gegl_operation_meta_redirect (operation, "blur", blur, "std-dev-x");
gegl_operation_meta_redirect (operation, "blur", blur, "std-dev-y");
gegl_operation_meta_redirect (operation, "blur2", blur2, "std-dev-x");
gegl_operation_meta_redirect (operation, "blur2", blur2, "std-dev-y");




gegl_node_link_many (input, median, blur, id1, ssg, xor, color, atop, opacity, hue, output, NULL);
gegl_node_link_many (image, blur2, NULL);
gegl_node_connect_from (xor, "aux", id1, "output");
gegl_node_connect_from (atop, "aux", blur2, "output");





}

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

operation_class = GEGL_OPERATION_CLASS (klass);

operation_class->attach = attach;

gegl_operation_class_set_keys (operation_class,
"name", "gegl:ssg",
"title", _("Add a Stroke, Shadow or Glow"),
"categories", "Artistic",
"reference-hash", "3ado316vg22a00x03vv5sb2ac",
"description", _("Make a duplicate layer of image you want to apply SSG to, then apply SSG to the top or bottom duplicate layer. SSG is an enhanced fork of the drop shadow filter that starts as a outline, knocks out the original image and allows image file overlays. "
""),
NULL);
}

#endif

0 comments on commit 5621d4a

Please sign in to comment.