Skip to content

Commit 6781bde

Browse files
authored
Add files via upload
1 parent 46363e2 commit 6781bde

5 files changed

Lines changed: 230 additions & 0 deletions

File tree

compile_bevel_here/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
## Compiling and Installing
3+
4+
### Linux
5+
6+
To compile and install you will need the GEGL header files (`libgegl-dev` on
7+
Debian based distributions or `gegl` on Arch Linux) and meson (`meson` on
8+
most distributions).
9+
10+
```bash
11+
meson setup --buildtype=release build
12+
ninja -C build
13+
14+
```
15+
16+
If you have an older version of gegl you may need to copy to `~/.local/share/gegl-0.3/plug-ins`
17+
instead (on Ubuntu 18.04 for example).
18+
19+
20+
21+
### Windows
22+
23+
The easiest way to compile this project on Windows is by using msys2. Download
24+
and install it from here: https://www.msys2.org/
25+
26+
Open a msys2 terminal with `C:\msys64\mingw64.exe`. Run the following to
27+
install required build dependencies:
28+
29+
```bash
30+
pacman --noconfirm -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-meson mingw-w64-x86_64-gegl
31+
```
32+
33+
Then build the same way you would on Linux:
34+
35+
```bash
36+
meson setup --buildtype=release build
37+
ninja -C build
38+
```
39+
40+
41+

compile_bevel_here/bevel.c

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/* This file is an image processing operation for GEGL
2+
*
3+
* GEGL is free software; you can redistribute it and/or
4+
* modify it under the terms of the GNU Lesser General Public
5+
* License as published by the Free Software Foundation; either
6+
* version 3 of the License, or (at your option) any later version.
7+
*
8+
* GEGL is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11+
* Lesser General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU Lesser General Public
14+
* License along with GEGL; if not, see <https://www.gnu.org/licenses/>.
15+
*
16+
* Copyright 2006 Øyvind Kolås <pippin@gimp.org>
17+
*/
18+
19+
#include "config.h"
20+
#include <glib/gi18n-lib.h>
21+
22+
#ifdef GEGL_PROPERTIES
23+
24+
25+
26+
property_double (radius1, _("Radius"), 7.0)
27+
value_range (1.0, 40.0)
28+
ui_range (1.0, 12)
29+
ui_gamma (1.5)
30+
31+
32+
33+
property_double (bevel1, _("Depth Angle"), 90.0)
34+
description (_("Elevation angle (degrees)"))
35+
value_range (0, 180)
36+
ui_meta ("unit", "degree")
37+
38+
property_int (bevel2, _("Depth"), 40)
39+
description (_("Filter width"))
40+
value_range (1, 100)
41+
42+
43+
property_double (th, _("Threshold of the Bevel's Transparency'"), 0.100)
44+
value_range (0.0, 1.0)
45+
ui_range (0.0, 0.5)
46+
47+
property_double (azimuth, _("Rotate Lighting"), 40.0)
48+
description (_("Light angle (degrees)"))
49+
value_range (0, 350)
50+
ui_meta ("unit", "degree")
51+
ui_meta ("direction", "ccw")
52+
53+
54+
#else
55+
56+
#define GEGL_OP_META
57+
#define GEGL_OP_NAME bevel
58+
#define GEGL_OP_C_SOURCE bevel.c
59+
60+
#include "gegl-op.h"
61+
62+
static void attach (GeglOperation *operation)
63+
{
64+
GeglNode *gegl = operation->node;
65+
GeglNode *input, *output, *blur, *emb, *th;
66+
67+
input = gegl_node_get_input_proxy (gegl, "input");
68+
output = gegl_node_get_output_proxy (gegl, "output");
69+
70+
blur = gegl_node_new_child (gegl,
71+
"operation", "gegl:gaussian-blur",
72+
NULL);
73+
74+
75+
emb = gegl_node_new_child (gegl,
76+
"operation", "gegl:emboss",
77+
NULL);
78+
79+
th = gegl_node_new_child (gegl,
80+
"operation", "gimp:threshold-alpha",
81+
NULL);
82+
83+
84+
85+
gegl_node_link_many (input, blur, emb, th, output, NULL);
86+
87+
gegl_operation_meta_redirect (operation, "radius1", blur, "std-dev-x");
88+
gegl_operation_meta_redirect (operation, "radius1", blur, "std-dev-y");
89+
90+
gegl_operation_meta_redirect (operation, "bevelhidden", emb, "");
91+
92+
gegl_operation_meta_redirect (operation, "bevel1", emb, "elevation");
93+
94+
gegl_operation_meta_redirect (operation, "bevel2", emb, "depth");
95+
96+
gegl_operation_meta_redirect (operation, "azimuth", emb, "azimuth");
97+
98+
99+
gegl_operation_meta_redirect (operation, "th", th, "value");
100+
101+
102+
}
103+
104+
static void
105+
gegl_op_class_init (GeglOpClass *klass)
106+
{
107+
GeglOperationClass *operation_class;
108+
109+
operation_class = GEGL_OPERATION_CLASS (klass);
110+
111+
operation_class->attach = attach;
112+
113+
gegl_operation_class_set_keys (operation_class,
114+
"name", "gegl:bevel",
115+
"title", _("Bevel"),
116+
"categories", "Aristic",
117+
"reference-hash", "45ed5656a28a512570f0f25sb2ac",
118+
"description", _("Bevel Images using GEGL. Use the multiply blend mode "
119+
""),
120+
NULL);
121+
}
122+
123+
#endif

compile_bevel_here/build_linux.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
4+
meson setup --buildtype=release build && ninja -C build

compile_bevel_here/config.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Autogenerated by the Meson build system.
3+
* Do not edit, your changes will be lost.
4+
*/
5+
6+
#pragma once
7+
8+
#define ARCH_X86 1
9+
10+
#define ARCH_X86_64 1
11+
12+
#define GEGL_LIBRARY "gegl-0.4"
13+
14+
#define GEGL_MAJOR_VERSION 0
15+
16+
#define GEGL_MICRO_VERSION 34
17+
18+
#define GEGL_MINOR_VERSION 4
19+
20+
#undef GEGL_UNSTABLE
21+
22+
#define GETTEXT_PACKAGE "gegl-0.4"
23+
24+
#define HAVE_EXECINFO_H
25+
26+
#define HAVE_FSYNC
27+
28+
#undef HAVE_GEXIV2
29+
30+
#undef HAVE_LUA
31+
32+
#define HAVE_MALLOC_TRIM
33+
34+
#undef HAVE_MRG
35+
36+
#define HAVE_STRPTIME
37+
38+
#define HAVE_UNISTD_H
39+

compile_bevel_here/meson.build

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
project('bevel', 'c',
2+
version : '0.1',
3+
license : 'GPL-3.0-or-later')
4+
5+
# These arguments are only used to build the shared library
6+
# not the executables that use the library.
7+
lib_args = ['-DBUILDING_EFFECTS']
8+
9+
gegl = dependency('gegl-0.3', required : false)
10+
if not gegl.found()
11+
gegl = dependency('gegl-0.4')
12+
endif
13+
shlib = shared_library('bevel', 'bevel.c', 'config.h',
14+
c_args : lib_args,
15+
dependencies : gegl,
16+
name_prefix : '',
17+
)
18+
19+
# Make this library usable as a Meson subproject.
20+
stroke_dep = declare_dependency(
21+
include_directories: include_directories('.'),
22+
link_with : shlib)
23+

0 commit comments

Comments
 (0)