diff options
Diffstat (limited to 'plug-ins/script-fu/scripts')
64 files changed, 10945 insertions, 0 deletions
diff --git a/plug-ins/script-fu/scripts/Makefile.am b/plug-ins/script-fu/scripts/Makefile.am new file mode 100644 index 0000000..4cce60d --- /dev/null +++ b/plug-ins/script-fu/scripts/Makefile.am @@ -0,0 +1,70 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = images + +scriptdatadir = $(gimpdatadir)/scripts + +scripts = \ + script-fu.init \ + script-fu-compat.init \ + plug-in-compat.init \ + add-bevel.scm \ + addborder.scm \ + blend-anim.scm \ + burn-in-anim.scm \ + carve-it.scm \ + chrome-it.scm \ + circuit.scm \ + clothify.scm \ + coffee.scm \ + copy-visible.scm \ + difference-clouds.scm \ + distress-selection.scm \ + drop-shadow.scm \ + erase-rows.scm \ + font-map.scm \ + fuzzyborder.scm \ + gimp-online.scm \ + gradient-example.scm \ + grid-system.scm \ + guides-from-selection.scm \ + guides-new.scm \ + guides-new-percent.scm \ + guides-remove-all.scm \ + lava.scm \ + line-nova.scm \ + mkbrush.scm \ + old-photo.scm \ + palette-export.scm \ + paste-as-brush.scm \ + paste-as-pattern.scm \ + perspective-shadow.scm \ + predator.scm \ + reverse-layers.scm \ + ripply-anim.scm \ + round-corners.scm \ + script-fu-set-cmap.scm \ + script-fu-util.scm \ + select-to-brush.scm \ + select-to-image.scm \ + select-to-pattern.scm \ + selection-round.scm \ + slide.scm \ + spinning-globe.scm \ + spyrogimp.scm \ + tileblur.scm \ + unsharp-mask.scm \ + waves-anim.scm \ + weave.scm \ + xach-effect.scm + +test_scripts = \ + contactsheet.scm \ + test-sphere.scm \ + ts-helloworld.scm + + +scriptdata_DATA = $(scripts) + + +EXTRA_DIST = $(scripts) $(test_scripts) diff --git a/plug-ins/script-fu/scripts/Makefile.in b/plug-ins/script-fu/scripts/Makefile.in new file mode 100644 index 0000000..e448ee3 --- /dev/null +++ b/plug-ins/script-fu/scripts/Makefile.in @@ -0,0 +1,1043 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plug-ins/script-fu/scripts +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4macros/gtk-doc.m4 \ + $(top_srcdir)/m4macros/intltool.m4 \ + $(top_srcdir)/m4macros/libtool.m4 \ + $(top_srcdir)/m4macros/ltoptions.m4 \ + $(top_srcdir)/m4macros/ltsugar.m4 \ + $(top_srcdir)/m4macros/ltversion.m4 \ + $(top_srcdir)/m4macros/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/m4macros/alsa.m4 \ + $(top_srcdir)/m4macros/ax_compare_version.m4 \ + $(top_srcdir)/m4macros/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4macros/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4macros/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4macros/ax_prog_perl_version.m4 \ + $(top_srcdir)/m4macros/detectcflags.m4 \ + $(top_srcdir)/m4macros/pythondev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(scriptdatadir)" +DATA = $(scriptdata_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +AA_LIBS = @AA_LIBS@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALL_LINGUAS = @ALL_LINGUAS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +ALTIVEC_EXTRA_CFLAGS = @ALTIVEC_EXTRA_CFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPSTREAM_UTIL = @APPSTREAM_UTIL@ +AR = @AR@ +AS = @AS@ +ATK_CFLAGS = @ATK_CFLAGS@ +ATK_LIBS = @ATK_LIBS@ +ATK_REQUIRED_VERSION = @ATK_REQUIRED_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BABL_CFLAGS = @BABL_CFLAGS@ +BABL_LIBS = @BABL_LIBS@ +BABL_REQUIRED_VERSION = @BABL_REQUIRED_VERSION@ +BUG_REPORT_URL = @BUG_REPORT_URL@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +BZIP2_LIBS = @BZIP2_LIBS@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PDF_CFLAGS = @CAIRO_PDF_CFLAGS@ +CAIRO_PDF_LIBS = @CAIRO_PDF_LIBS@ +CAIRO_PDF_REQUIRED_VERSION = @CAIRO_PDF_REQUIRED_VERSION@ +CAIRO_REQUIRED_VERSION = @CAIRO_REQUIRED_VERSION@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CC_VERSION = @CC_VERSION@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DESKTOP_DATADIR = @DESKTOP_DATADIR@ +DESKTOP_FILE_VALIDATE = @DESKTOP_FILE_VALIDATE@ +DLLTOOL = @DLLTOOL@ +DOC_SHOOTER = @DOC_SHOOTER@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_AA = @FILE_AA@ +FILE_EXR = @FILE_EXR@ +FILE_HEIF = @FILE_HEIF@ +FILE_JP2_LOAD = @FILE_JP2_LOAD@ +FILE_MNG = @FILE_MNG@ +FILE_PDF_SAVE = @FILE_PDF_SAVE@ +FILE_PS = @FILE_PS@ +FILE_WMF = @FILE_WMF@ +FILE_XMC = @FILE_XMC@ +FILE_XPM = @FILE_XPM@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_REQUIRED_VERSION = @FONTCONFIG_REQUIRED_VERSION@ +FREETYPE2_REQUIRED_VERSION = @FREETYPE2_REQUIRED_VERSION@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +GDBUS_CODEGEN = @GDBUS_CODEGEN@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_CSOURCE = @GDK_PIXBUF_CSOURCE@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GDK_PIXBUF_REQUIRED_VERSION = @GDK_PIXBUF_REQUIRED_VERSION@ +GEGL = @GEGL@ +GEGL_CFLAGS = @GEGL_CFLAGS@ +GEGL_LIBS = @GEGL_LIBS@ +GEGL_MAJOR_MINOR_VERSION = @GEGL_MAJOR_MINOR_VERSION@ +GEGL_REQUIRED_VERSION = @GEGL_REQUIRED_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GEXIV2_CFLAGS = @GEXIV2_CFLAGS@ +GEXIV2_LIBS = @GEXIV2_LIBS@ +GEXIV2_REQUIRED_VERSION = @GEXIV2_REQUIRED_VERSION@ +GIMP_API_VERSION = @GIMP_API_VERSION@ +GIMP_APP_VERSION = @GIMP_APP_VERSION@ +GIMP_BINARY_AGE = @GIMP_BINARY_AGE@ +GIMP_COMMAND = @GIMP_COMMAND@ +GIMP_DATA_VERSION = @GIMP_DATA_VERSION@ +GIMP_FULL_NAME = @GIMP_FULL_NAME@ +GIMP_INTERFACE_AGE = @GIMP_INTERFACE_AGE@ +GIMP_MAJOR_VERSION = @GIMP_MAJOR_VERSION@ +GIMP_MICRO_VERSION = @GIMP_MICRO_VERSION@ +GIMP_MINOR_VERSION = @GIMP_MINOR_VERSION@ +GIMP_MKENUMS = @GIMP_MKENUMS@ +GIMP_MODULES = @GIMP_MODULES@ +GIMP_PACKAGE_REVISION = @GIMP_PACKAGE_REVISION@ +GIMP_PKGCONFIG_VERSION = @GIMP_PKGCONFIG_VERSION@ +GIMP_PLUGINS = @GIMP_PLUGINS@ +GIMP_PLUGIN_VERSION = @GIMP_PLUGIN_VERSION@ +GIMP_REAL_VERSION = @GIMP_REAL_VERSION@ +GIMP_SYSCONF_VERSION = @GIMP_SYSCONF_VERSION@ +GIMP_TOOL_VERSION = @GIMP_TOOL_VERSION@ +GIMP_UNSTABLE = @GIMP_UNSTABLE@ +GIMP_USER_VERSION = @GIMP_USER_VERSION@ +GIMP_VERSION = @GIMP_VERSION@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ +GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ +GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQUIRED_VERSION = @GLIB_REQUIRED_VERSION@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GS_LIBS = @GS_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_MAC_INTEGRATION_CFLAGS = @GTK_MAC_INTEGRATION_CFLAGS@ +GTK_MAC_INTEGRATION_LIBS = @GTK_MAC_INTEGRATION_LIBS@ +GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@ +GTK_UPDATE_ICON_CACHE = @GTK_UPDATE_ICON_CACHE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_REQUIRED_VERSION = @HARFBUZZ_REQUIRED_VERSION@ +HAVE_CXX14 = @HAVE_CXX14@ +HAVE_FINITE = @HAVE_FINITE@ +HAVE_ISFINITE = @HAVE_ISFINITE@ +HAVE_VFORK = @HAVE_VFORK@ +HOST_GLIB_COMPILE_RESOURCES = @HOST_GLIB_COMPILE_RESOURCES@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_REQUIRED_VERSION = @INTLTOOL_REQUIRED_VERSION@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +ISO_CODES_LOCALEDIR = @ISO_CODES_LOCALEDIR@ +ISO_CODES_LOCATION = @ISO_CODES_LOCATION@ +JPEG_LIBS = @JPEG_LIBS@ +JSON_GLIB_CFLAGS = @JSON_GLIB_CFLAGS@ +JSON_GLIB_LIBS = @JSON_GLIB_LIBS@ +LCMS_CFLAGS = @LCMS_CFLAGS@ +LCMS_LIBS = @LCMS_LIBS@ +LCMS_REQUIRED_VERSION = @LCMS_REQUIRED_VERSION@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBBACKTRACE_LIBS = @LIBBACKTRACE_LIBS@ +LIBHEIF_CFLAGS = @LIBHEIF_CFLAGS@ +LIBHEIF_LIBS = @LIBHEIF_LIBS@ +LIBHEIF_REQUIRED_VERSION = @LIBHEIF_REQUIRED_VERSION@ +LIBLZMA_REQUIRED_VERSION = @LIBLZMA_REQUIRED_VERSION@ +LIBMYPAINT_CFLAGS = @LIBMYPAINT_CFLAGS@ +LIBMYPAINT_LIBS = @LIBMYPAINT_LIBS@ +LIBMYPAINT_REQUIRED_VERSION = @LIBMYPAINT_REQUIRED_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBPNG_REQUIRED_VERSION = @LIBPNG_REQUIRED_VERSION@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIBUNWIND_REQUIRED_VERSION = @LIBUNWIND_REQUIRED_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ +MAIL = @MAIL@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MIME_INFO_CFLAGS = @MIME_INFO_CFLAGS@ +MIME_INFO_LIBS = @MIME_INFO_LIBS@ +MIME_TYPES = @MIME_TYPES@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MMX_EXTRA_CFLAGS = @MMX_EXTRA_CFLAGS@ +MNG_CFLAGS = @MNG_CFLAGS@ +MNG_LIBS = @MNG_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +MYPAINT_BRUSHES_CFLAGS = @MYPAINT_BRUSHES_CFLAGS@ +MYPAINT_BRUSHES_LIBS = @MYPAINT_BRUSHES_LIBS@ +NATIVE_GLIB_CFLAGS = @NATIVE_GLIB_CFLAGS@ +NATIVE_GLIB_LIBS = @NATIVE_GLIB_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ +OPENEXR_LIBS = @OPENEXR_LIBS@ +OPENEXR_REQUIRED_VERSION = @OPENEXR_REQUIRED_VERSION@ +OPENJPEG_CFLAGS = @OPENJPEG_CFLAGS@ +OPENJPEG_LIBS = @OPENJPEG_LIBS@ +OPENJPEG_REQUIRED_VERSION = @OPENJPEG_REQUIRED_VERSION@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@ +PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@ +PANGOCAIRO_REQUIRED_VERSION = @PANGOCAIRO_REQUIRED_VERSION@ +PATHSEP = @PATHSEP@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_REQUIRED_VERSION = @PERL_REQUIRED_VERSION@ +PERL_VERSION = @PERL_VERSION@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +POFILES = @POFILES@ +POPPLER_CFLAGS = @POPPLER_CFLAGS@ +POPPLER_DATA_CFLAGS = @POPPLER_DATA_CFLAGS@ +POPPLER_DATA_LIBS = @POPPLER_DATA_LIBS@ +POPPLER_DATA_REQUIRED_VERSION = @POPPLER_DATA_REQUIRED_VERSION@ +POPPLER_LIBS = @POPPLER_LIBS@ +POPPLER_REQUIRED_VERSION = @POPPLER_REQUIRED_VERSION@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PYBIN_PATH = @PYBIN_PATH@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGIMP_EXTRA_CFLAGS = @PYGIMP_EXTRA_CFLAGS@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_CODEGEN = @PYGTK_CODEGEN@ +PYGTK_DEFSDIR = @PYGTK_DEFSDIR@ +PYGTK_LIBS = @PYGTK_LIBS@ +PYLINK_LIBS = @PYLINK_LIBS@ +PYTHON = @PYTHON@ +PYTHON2_REQUIRED_VERSION = @PYTHON2_REQUIRED_VERSION@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@ +RT_LIBS = @RT_LIBS@ +SCREENSHOT_LIBS = @SCREENSHOT_LIBS@ +SED = @SED@ +SENDMAIL = @SENDMAIL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +SSE2_EXTRA_CFLAGS = @SSE2_EXTRA_CFLAGS@ +SSE4_1_EXTRA_CFLAGS = @SSE4_1_EXTRA_CFLAGS@ +SSE_EXTRA_CFLAGS = @SSE_EXTRA_CFLAGS@ +STRIP = @STRIP@ +SVG_CFLAGS = @SVG_CFLAGS@ +SVG_LIBS = @SVG_LIBS@ +SYMPREFIX = @SYMPREFIX@ +TIFF_LIBS = @TIFF_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WEBKIT_CFLAGS = @WEBKIT_CFLAGS@ +WEBKIT_LIBS = @WEBKIT_LIBS@ +WEBKIT_REQUIRED_VERSION = @WEBKIT_REQUIRED_VERSION@ +WEBPDEMUX_CFLAGS = @WEBPDEMUX_CFLAGS@ +WEBPDEMUX_LIBS = @WEBPDEMUX_LIBS@ +WEBPMUX_CFLAGS = @WEBPMUX_CFLAGS@ +WEBPMUX_LIBS = @WEBPMUX_LIBS@ +WEBP_CFLAGS = @WEBP_CFLAGS@ +WEBP_LIBS = @WEBP_LIBS@ +WEBP_REQUIRED_VERSION = @WEBP_REQUIRED_VERSION@ +WEB_PAGE = @WEB_PAGE@ +WIN32_LARGE_ADDRESS_AWARE = @WIN32_LARGE_ADDRESS_AWARE@ +WINDRES = @WINDRES@ +WMF_CFLAGS = @WMF_CFLAGS@ +WMF_CONFIG = @WMF_CONFIG@ +WMF_LIBS = @WMF_LIBS@ +WMF_REQUIRED_VERSION = @WMF_REQUIRED_VERSION@ +XDG_EMAIL = @XDG_EMAIL@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_REQUIRED_VERSION = @XGETTEXT_REQUIRED_VERSION@ +XMC_CFLAGS = @XMC_CFLAGS@ +XMC_LIBS = @XMC_LIBS@ +XMKMF = @XMKMF@ +XMLLINT = @XMLLINT@ +XMU_LIBS = @XMU_LIBS@ +XPM_LIBS = @XPM_LIBS@ +XSLTPROC = @XSLTPROC@ +XVFB_RUN = @XVFB_RUN@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gimpdatadir = @gimpdatadir@ +gimpdir = @gimpdir@ +gimplocaledir = @gimplocaledir@ +gimpplugindir = @gimpplugindir@ +gimpsysconfdir = @gimpsysconfdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +manpage_gimpdir = @manpage_gimpdir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +mypaint_brushes_dir = @mypaint_brushes_dir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = images +scriptdatadir = $(gimpdatadir)/scripts +scripts = \ + script-fu.init \ + script-fu-compat.init \ + plug-in-compat.init \ + add-bevel.scm \ + addborder.scm \ + blend-anim.scm \ + burn-in-anim.scm \ + carve-it.scm \ + chrome-it.scm \ + circuit.scm \ + clothify.scm \ + coffee.scm \ + copy-visible.scm \ + difference-clouds.scm \ + distress-selection.scm \ + drop-shadow.scm \ + erase-rows.scm \ + font-map.scm \ + fuzzyborder.scm \ + gimp-online.scm \ + gradient-example.scm \ + grid-system.scm \ + guides-from-selection.scm \ + guides-new.scm \ + guides-new-percent.scm \ + guides-remove-all.scm \ + lava.scm \ + line-nova.scm \ + mkbrush.scm \ + old-photo.scm \ + palette-export.scm \ + paste-as-brush.scm \ + paste-as-pattern.scm \ + perspective-shadow.scm \ + predator.scm \ + reverse-layers.scm \ + ripply-anim.scm \ + round-corners.scm \ + script-fu-set-cmap.scm \ + script-fu-util.scm \ + select-to-brush.scm \ + select-to-image.scm \ + select-to-pattern.scm \ + selection-round.scm \ + slide.scm \ + spinning-globe.scm \ + spyrogimp.scm \ + tileblur.scm \ + unsharp-mask.scm \ + waves-anim.scm \ + weave.scm \ + xach-effect.scm + +test_scripts = \ + contactsheet.scm \ + test-sphere.scm \ + ts-helloworld.scm + +scriptdata_DATA = $(scripts) +EXTRA_DIST = $(scripts) $(test_scripts) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plug-ins/script-fu/scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plug-ins/script-fu/scripts/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-scriptdataDATA: $(scriptdata_DATA) + @$(NORMAL_INSTALL) + @list='$(scriptdata_DATA)'; test -n "$(scriptdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(scriptdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(scriptdatadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(scriptdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(scriptdatadir)" || exit $$?; \ + done + +uninstall-scriptdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(scriptdata_DATA)'; test -n "$(scriptdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(scriptdatadir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(scriptdatadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-scriptdataDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-scriptdataDATA + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-scriptdataDATA install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-scriptdataDATA + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/plug-ins/script-fu/scripts/add-bevel.scm b/plug-ins/script-fu/scripts/add-bevel.scm new file mode 100644 index 0000000..6e0f951 --- /dev/null +++ b/plug-ins/script-fu/scripts/add-bevel.scm @@ -0,0 +1,202 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; add-bevel.scm version 1.04 +; Time-stamp: <2004-02-09 17:07:06 simon> +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Copyright (C) 1997 Andrew Donkin (ard@cs.waikato.ac.nz) +; Contains code from add-shadow.scm by Sven Neumann +; (neumanns@uni-duesseldorf.de) (thanks Sven). +; +; Adds a bevel to an image. See http://www.cs.waikato.ac.nz/~ard/gimp/ +; +; If there is a selection, it is bevelled. +; Otherwise if there is an alpha channel, the selection is taken from it +; and bevelled. +; Otherwise the part of the layer inside the image boundaries is bevelled. +; +; The selection is set on exit, so Select->Invert then Edit->Clear will +; leave a cut-out. Then use Sven's add-shadow for that +; floating-bumpmapped-texture cliche. + +; +; 1.01: now works on offset layers. +; 1.02: has crop-pixel-border option to trim one pixel off each edge of the +; bevelled image. Bumpmapping leaves edge pixels unchanged, which +; looks bad. Oddly, this is not apparent in GIMP - you have to +; save the image and load it into another viewer. First noticed in +; Nutscrape. +; Changed path (removed "filters/"). +; 1.03: adds one-pixel border before bumpmapping, and removes it after. +; Got rid of the crop-pixel-border option (no longer reqd). +; 1.04: Fixed undo handling, ensure that bumpmap is big enough, +; (instead of resizing the image). Removed references to outdated +; bumpmap plugin. (Simon) +; 1.05 When there is no selection, bevel the whole layer instead of the +; whole image (which was broken in the first place). +; Also fixed some bugs with setting the selection when there is no +; initial selection. (Barak Itkin) +; + +(define (script-fu-add-bevel img + drawable + thickness + work-on-copy + keep-bump-layer) + + (let* ( + (index 1) + (greyness 0) + (thickness (abs thickness)) + (type (car (gimp-drawable-type-with-alpha drawable))) + (image (if (= work-on-copy TRUE) (car (gimp-image-duplicate img)) img)) + (pic-layer (car (gimp-image-get-active-drawable image))) + (offsets (gimp-drawable-offsets pic-layer)) + (width (car (gimp-drawable-width pic-layer))) + (height (car (gimp-drawable-height pic-layer))) + + ; Bumpmap has a one pixel border on each side + (bump-layer (car (gimp-layer-new image + (+ width 2) + (+ height 2) + RGB-IMAGE + _"Bumpmap" + 100 + LAYER-MODE-NORMAL))) + + (selection-exists (car (gimp-selection-bounds image))) + (selection 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + ; disable undo on copy, start group otherwise + (if (= work-on-copy TRUE) + (gimp-image-undo-disable image) + (gimp-image-undo-group-start image) + ) + + (gimp-image-insert-layer image bump-layer 0 1) + + ; If the layer we're bevelling is offset from the image's origin, we + ; have to do the same to the bumpmap + (gimp-layer-set-offsets bump-layer (- (car offsets) 1) + (- (cadr offsets) 1)) + + ;------------------------------------------------------------ + ; + ; Set the selection to the area we want to bevel. + ; + (if (= selection-exists 0) + (gimp-image-select-item image CHANNEL-OP-REPLACE pic-layer) + ) + + ; Store it for later. + (set! selection (car (gimp-selection-save image))) + ; Try to lose the jaggies + (gimp-selection-feather image 2) + + ;------------------------------------------------------------ + ; + ; Initialise our bumpmap + ; + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-fill bump-layer FILL-BACKGROUND) + + (while (and (< index thickness) + (= (car (gimp-selection-is-empty image)) FALSE) + ) + (set! greyness (/ (* index 255) thickness)) + (gimp-context-set-background (list greyness greyness greyness)) + ;(gimp-selection-feather image 1) ;Stop the slopey jaggies? + (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND) + (gimp-selection-shrink image 1) + (set! index (+ index 1)) + ) + ; Now the white interior + (if (= (car (gimp-selection-is-empty image)) FALSE) + (begin + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill bump-layer FILL-BACKGROUND) + ) + ) + + ;------------------------------------------------------------ + ; + ; Do the bump. + ; + (gimp-selection-none image) + + ; To further lessen jaggies? + ;(plug-in-gauss-rle RUN-NONINTERACTIVE image bump-layer thickness TRUE TRUE) + + + ; + ; BUMPMAP INVOCATION: + ; + (plug-in-bump-map RUN-NONINTERACTIVE image pic-layer bump-layer 125 45 3 0 0 0 0 TRUE FALSE 1) + + ;------------------------------------------------------------ + ; + ; Restore things + ; + (if (= selection-exists 0) + (gimp-selection-none image) ; No selection to start with + (gimp-image-select-item image CHANNEL-OP-REPLACE selection) + ) + ; If they started with a selection, they can Select->Invert then + ; Edit->Clear for a cutout. + + ; clean up + (gimp-image-remove-channel image selection) + (if (= keep-bump-layer TRUE) + (gimp-item-set-visible bump-layer 0) + (gimp-image-remove-layer image bump-layer) + ) + + (gimp-image-set-active-layer image pic-layer) + + ; enable undo / end undo group + (if (= work-on-copy TRUE) + (begin + (gimp-display-new image) + (gimp-image-undo-enable image) + ) + (gimp-image-undo-group-end image) + ) + + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-add-bevel" + _"Add B_evel..." + _"Add a beveled border to an image" + "Andrew Donkin <ard@cs.waikato.ac.nz>" + "Andrew Donkin" + "1997/11/06" + "RGB*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Thickness" '(5 0 30 1 2 0 0) + SF-TOGGLE _"Work on copy" TRUE + SF-TOGGLE _"Keep bump layer" FALSE +) + +(script-fu-menu-register "script-fu-add-bevel" "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/addborder.scm b/plug-ins/script-fu/scripts/addborder.scm new file mode 100644 index 0000000..ed47feb --- /dev/null +++ b/plug-ins/script-fu/scripts/addborder.scm @@ -0,0 +1,177 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Copyright (C) 1997 Andy Thomas alt@picnic.demon.co.uk +; +; Version 0.2 10.6.97 Changed to new script-fu interface in 0.99.10 + +; Delta the color by the given amount. Check for boundary conditions +; If < 0 set to zero +; If > 255 set to 255 +; Return the new value + +(define (script-fu-addborder aimg adraw xsize ysize color dvalue) + + (define (deltacolor col delta) + (let* ((newcol (+ col delta))) + (if (< newcol 0) (set! newcol 0)) + (if (> newcol 255) (set! newcol 255)) + newcol + ) + ) + + (define (adjcolor col delta) + (mapcar (lambda (x) (deltacolor x delta)) col) + ) + + (define (gen_top_array xsize ysize owidth oheight width height) + (let* ((n_array (cons-array 10 'double))) + (aset n_array 0 0 ) + (aset n_array 1 0 ) + (aset n_array 2 xsize) + (aset n_array 3 ysize) + (aset n_array 4 (+ xsize owidth)) + (aset n_array 5 ysize) + (aset n_array 6 width) + (aset n_array 7 0 ) + (aset n_array 8 0 ) + (aset n_array 9 0 ) + n_array) + ) + + (define (gen_left_array xsize ysize owidth oheight width height) + (let* ((n_array (cons-array 10 'double))) + (aset n_array 0 0 ) + (aset n_array 1 0 ) + (aset n_array 2 xsize) + (aset n_array 3 ysize) + (aset n_array 4 xsize) + (aset n_array 5 (+ ysize oheight)) + (aset n_array 6 0 ) + (aset n_array 7 height ) + (aset n_array 8 0 ) + (aset n_array 9 0 ) + n_array) + ) + + (define (gen_right_array xsize ysize owidth oheight width height) + (let* ((n_array (cons-array 10 'double))) + (aset n_array 0 width ) + (aset n_array 1 0 ) + (aset n_array 2 (+ xsize owidth)) + (aset n_array 3 ysize) + (aset n_array 4 (+ xsize owidth)) + (aset n_array 5 (+ ysize oheight)) + (aset n_array 6 width) + (aset n_array 7 height) + (aset n_array 8 width ) + (aset n_array 9 0 ) + n_array) + ) + + (define (gen_bottom_array xsize ysize owidth oheight width height) + (let* ((n_array (cons-array 10 'double))) + (aset n_array 0 0 ) + (aset n_array 1 height) + (aset n_array 2 xsize) + (aset n_array 3 (+ ysize oheight)) + (aset n_array 4 (+ xsize owidth)) + (aset n_array 5 (+ ysize oheight)) + (aset n_array 6 width) + (aset n_array 7 height) + (aset n_array 8 0 ) + (aset n_array 9 height) + n_array) + ) + + (let* ((img (car (gimp-item-get-image adraw))) + (owidth (car (gimp-image-width img))) + (oheight (car (gimp-image-height img))) + (width (+ owidth (* 2 xsize))) + (height (+ oheight (* 2 ysize))) + (layer (car (gimp-layer-new img + width height + (car (gimp-drawable-type-with-alpha adraw)) + _"Border Layer" 100 LAYER-MODE-NORMAL)))) + + (gimp-context-push) + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + (gimp-context-set-antialias FALSE) + (gimp-context-set-feather FALSE) + + (gimp-image-undo-group-start img) + + (gimp-image-resize img + width + height + xsize + ysize) + + (gimp-image-insert-layer img layer 0 0) + (gimp-drawable-fill layer FILL-TRANSPARENT) + + (gimp-context-set-background (adjcolor color dvalue)) + (gimp-image-select-polygon img + CHANNEL-OP-REPLACE + 10 + (gen_top_array xsize ysize owidth oheight width height)) + (gimp-drawable-edit-fill layer FILL-BACKGROUND) + (gimp-context-set-background (adjcolor color (/ dvalue 2))) + (gimp-image-select-polygon img + CHANNEL-OP-REPLACE + 10 + (gen_left_array xsize ysize owidth oheight width height)) + (gimp-drawable-edit-fill layer FILL-BACKGROUND) + (gimp-context-set-background (adjcolor color (- 0 (/ dvalue 2)))) + (gimp-image-select-polygon img + CHANNEL-OP-REPLACE + 10 + (gen_right_array xsize ysize owidth oheight width height)) + + (gimp-drawable-edit-fill layer FILL-BACKGROUND) + (gimp-context-set-background (adjcolor color (- 0 dvalue))) + (gimp-image-select-polygon img + CHANNEL-OP-REPLACE + 10 + (gen_bottom_array xsize ysize owidth oheight width height)) + + (gimp-drawable-edit-fill layer FILL-BACKGROUND) + (gimp-selection-none img) + (gimp-image-undo-group-end img) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-addborder" + _"Add _Border..." + _"Add a border around an image" + "Andy Thomas <alt@picnic.demon.co.uk>" + "Andy Thomas" + "6/10/97" + "*" + SF-IMAGE "Input image" 0 + SF-DRAWABLE "Input drawable" 0 + SF-ADJUSTMENT _"Border X size" '(12 1 250 1 10 0 1) + SF-ADJUSTMENT _"Border Y size" '(12 1 250 1 10 0 1) + SF-COLOR _"Border color" '(38 31 207) + SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1) +) + +(script-fu-menu-register "script-fu-addborder" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/blend-anim.scm b/plug-ins/script-fu/scripts/blend-anim.scm new file mode 100644 index 0000000..517b1c5 --- /dev/null +++ b/plug-ins/script-fu/scripts/blend-anim.scm @@ -0,0 +1,242 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; blend-anim.scm version 1.03 1999/12/21 +; +; CHANGE-LOG: +; 1.00 - initial release +; 1.01 - some code cleanup, no real changes +; 1.02 - use gimp-message to output an error message if called +; with less than three layers +; 1.03 - only call blur plugin when blut-radius >= 1.0 +; +; Copyright (C) 1997-1999 Sven Neumann <sven@gimp.org> +; +; +; Blends two or more layers over a background, so that an animation can +; be saved. A minimum of three layers is required. + +(define (script-fu-blend-anim img + drawable + frames + max-blur + looped) + + (define (multi-raise-layer image layer times) + (while (> times 0) + (gimp-image-raise-item image layer) + (set! times (- times 1)) + ) + ) + + (let* ( + (max-blur (max max-blur 0)) + (frames (max frames 0)) + (image (car (gimp-image-duplicate img))) + (width (car (gimp-image-width image))) + (height (car (gimp-image-height image))) + (layers (gimp-image-get-layers image)) + (num-layers (car layers)) + (layer-array (cadr layers)) + (slots (- num-layers 2)) + (bg-layer (aref layer-array (- num-layers 1))) + (max-width 0) + (max-height 0) + (offset-x 0) + (offset-y 0) + ) + + (if (> num-layers 2) + (begin + (gimp-image-undo-disable image) + + (if (= looped TRUE) + ; add a copy of the lowest blend layer on top + (let* ((copy (car (gimp-layer-copy + (aref layer-array (- num-layers 2)) TRUE)))) + (gimp-image-insert-layer image copy 0 0) + (set! layers (gimp-image-get-layers image)) + (set! num-layers (car layers)) + (set! layer-array (cadr layers)) + (set! slots (- num-layers 2)) + (set! bg-layer (aref layer-array (- num-layers 1))))) + + ; make all layers invisible and check for sizes + (let* ((min-offset-x width) + (min-offset-y height) + (layer-count slots)) + (gimp-item-set-visible bg-layer FALSE) + (while (> layer-count -1) + (let* ((layer (aref layer-array layer-count)) + (layer-width (+ (car (gimp-drawable-width layer)) + (* max-blur 2))) + (layer-height (+ (car (gimp-drawable-height layer)) + (* max-blur 2))) + (layer-offsets (gimp-drawable-offsets layer)) + (layer-offset-x (- (car layer-offsets) max-blur)) + (layer-offset-y (- (cadr layer-offsets) max-blur))) + (gimp-item-set-visible layer FALSE) + (set! max-width (max max-width layer-width)) + (set! max-height (max max-height layer-height)) + (set! min-offset-x (min min-offset-x layer-offset-x)) + (set! min-offset-y (min min-offset-y layer-offset-y)) + (set! layer-count (- layer-count 1)))) + (set! offset-x (- (car (gimp-drawable-offsets bg-layer)) + min-offset-x)) + (set! offset-y (- (cadr (gimp-drawable-offsets bg-layer)) + min-offset-y))) + + ; create intermediate frames by merging copies of adjacent layers + ; with the background layer + (let* ((layer-count slots)) + (while (> layer-count 0) + (let* ((frame-count frames) + (lower-layer (aref layer-array layer-count)) + (upper-layer (aref layer-array (- layer-count 1)))) + (while (> frame-count 0) + (let* ((opacity (* (/ frame-count (+ frames 1)) 100)) + (blur (/ (* opacity max-blur) 100)) + (upper-copy (car (gimp-layer-copy upper-layer TRUE))) + (lower-copy (car (gimp-layer-copy lower-layer TRUE))) + (bg-copy (car (gimp-layer-copy bg-layer TRUE)))) + (gimp-image-insert-layer image bg-copy 0 0) + (gimp-image-insert-layer image lower-copy 0 0) + (gimp-image-insert-layer image upper-copy 0 0) + (gimp-item-set-visible upper-copy TRUE) + (gimp-item-set-visible lower-copy TRUE) + (gimp-item-set-visible bg-copy TRUE) + (gimp-layer-set-opacity upper-copy (- 100 opacity)) + (gimp-layer-set-opacity lower-copy opacity) + (gimp-layer-set-opacity bg-copy 100) + (if (> max-blur 0) + (let* ((layer-width (car (gimp-drawable-width upper-copy))) + (layer-height (car (gimp-drawable-height upper-copy)))) + (gimp-layer-set-lock-alpha upper-copy FALSE) + (gimp-layer-resize upper-copy + (+ layer-width (* blur 2)) + (+ layer-height (* blur 2)) + blur + blur) + (if (>= blur 1.0) + (plug-in-gauss-rle RUN-NONINTERACTIVE + image + upper-copy + blur + TRUE TRUE)) + (set! blur (- max-blur blur)) + (gimp-layer-set-lock-alpha lower-copy FALSE) + (set! layer-width (car (gimp-drawable-width + lower-copy))) + (set! layer-height (car (gimp-drawable-height + lower-copy))) + (gimp-layer-resize lower-copy + (+ layer-width (* blur 2)) + (+ layer-height (* blur 2)) + blur + blur) + (if (>= blur 1.0) + (plug-in-gauss-rle RUN-NONINTERACTIVE + image + lower-copy + blur + TRUE TRUE)))) + (gimp-layer-resize bg-copy + max-width + max-height + offset-x + offset-y) + (let* ((merged-layer (car (gimp-image-merge-visible-layers + image CLIP-TO-IMAGE)))) + (gimp-item-set-visible merged-layer FALSE)) + (set! frame-count (- frame-count 1)))) + (set! layer-count (- layer-count 1))))) + + ; merge all original blend layers but the lowest one + ; with copies of the background layer + (let* ((layer-count 0)) + (while (< layer-count slots) + (let* ((orig-layer (aref layer-array layer-count)) + (bg-copy (car (gimp-layer-copy bg-layer TRUE)))) + (gimp-image-insert-layer image + bg-copy + -1 + (* layer-count (+ frames 1))) + (multi-raise-layer image + orig-layer + (+ (* (- slots layer-count) frames) 1)) + (gimp-item-set-visible orig-layer TRUE) + (gimp-item-set-visible bg-copy TRUE) + (gimp-layer-resize bg-copy + max-width + max-height + offset-x + offset-y) + (let* ((merged-layer (car (gimp-image-merge-visible-layers + image CLIP-TO-IMAGE)))) + (gimp-item-set-visible merged-layer FALSE)) + (set! layer-count (+ layer-count 1))))) + + ; merge the lowest blend layer with the background layer + (let* ((orig-layer (aref layer-array (- num-layers 2)))) + (gimp-item-set-visible bg-layer TRUE) + (gimp-item-set-visible orig-layer TRUE) + (gimp-image-merge-visible-layers image CLIP-TO-IMAGE)) + + ; make all layers visible again + (let* ((result-layers (gimp-image-get-layers image)) + (num-result-layers (car result-layers)) + (result-layer-array (cadr result-layers)) + (layer-count (- num-result-layers 1))) + (while (> layer-count -1) + (let* ((layer (aref result-layer-array layer-count)) + (name (string-append _"Frame" " " + (number->string + (- num-result-layers layer-count) 10)))) + (gimp-item-set-visible layer TRUE) + (gimp-item-set-name layer name) + (set! layer-count (- layer-count 1)))) + + (if (= looped TRUE) + ; remove the topmost layer + (gimp-image-remove-layer image (aref result-layer-array 0)))) + + (gimp-image-undo-enable image) + (gimp-display-new image) + (gimp-displays-flush) + ) + + (gimp-message _"Blend Animation needs at least three source layers") + ) + ) +) + +(script-fu-register "script-fu-blend-anim" + _"_Blend..." + _"Create intermediate layers to blend two or more layers over a background as an animation" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "1999/12/21" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Intermediate frames" '(3 1 1024 1 10 0 1) + SF-ADJUSTMENT _"Max. blur radius" '(0 0 1024 1 10 0 1) + SF-TOGGLE _"Looped" TRUE +) + +(script-fu-menu-register "script-fu-blend-anim" + "<Image>/Filters/Animation/Animators") diff --git a/plug-ins/script-fu/scripts/burn-in-anim.scm b/plug-ins/script-fu/scripts/burn-in-anim.scm new file mode 100644 index 0000000..a1bdcd0 --- /dev/null +++ b/plug-ins/script-fu/scripts/burn-in-anim.scm @@ -0,0 +1,243 @@ +; +; burn-in-anim.scm V2.1 - script-fu for GIMP 1.1 and higher +; +; Copyright (C) 9/2000 Roland Berger +; roland@fuchur.leute.server.de +; http://fuchur.leute.server.de +; +; Let text appear and fade out with a "burn-in" like SFX. +; Works on an image with a text and a background layer +; +; Copying Policy: GNU Public License http://www.gnu.org +; + +(define (script-fu-burn-in-anim org-img + org-layer + glow-color + fadeout + bl-width + corona-width + after-glow + show-glow + optimize + speed) + + (let* ( + ;--- main variable: "bl-x" runs from 0 to layer-width + (bl-x 0) + (frame-nr 0) + (img 0) + (source-layer 0) + (bg-source-layer 0) + (source-layer-width 0) + (bg-layer 0) + (bg-layer-name 0) + (bl-layer 0) + (bl-layer-name 0) + (bl-mask 0) + (bl-layer-width 0) + (bl-height 0) + (bl-x-off 0) + (bl-y-off 0) + (nofadeout-bl-x-off 0) + (nofadeout-bl-width 0) + (blended-layer 0) + (img-display 0) + ) + + (if (< speed 1) + (set! speed (* -1 speed)) ) + + ;--- check image and work on a copy + (if (and (= (car (gimp-image-get-layers org-img)) 2) + (= (car (gimp-image-get-floating-sel org-img)) -1)) + + ;--- main program structure starts here, begin of "if-1" + (begin + (gimp-context-push) + (gimp-context-set-defaults) + + (set! img (car (gimp-image-duplicate org-img))) + (gimp-image-undo-disable img) + (if (> (car (gimp-drawable-type org-layer)) 1 ) + (gimp-image-convert-rgb img)) + (set! source-layer (aref (cadr (gimp-image-get-layers img)) 0 )) + (set! bg-source-layer (aref (cadr (gimp-image-get-layers img)) 1 )) + (set! source-layer-width (car (gimp-drawable-width source-layer))) + + ;--- hide layers, cause we want to "merge visible layers" later + (gimp-item-set-visible source-layer FALSE) + (gimp-item-set-visible bg-source-layer FALSE) + + ;--- process image horizontal with pixel-speed + (while (< bl-x (+ source-layer-width bl-width)) + (set! bl-layer (car (gimp-layer-copy source-layer TRUE))) + (set! bl-layer-name (string-append "fr-nr" + (number->string frame-nr 10) ) ) + + (gimp-image-insert-layer img bl-layer 0 -2) + (gimp-item-set-name bl-layer bl-layer-name) + (gimp-item-set-visible bl-layer TRUE) + (gimp-layer-set-lock-alpha bl-layer TRUE) + (gimp-layer-add-alpha bl-layer) + + ;--- add an alpha mask for blending and select it + (gimp-image-select-item img CHANNEL-OP-REPLACE bl-layer) + (set! bl-mask (car (gimp-layer-create-mask bl-layer ADD-MASK-BLACK))) + (gimp-layer-add-mask bl-layer bl-mask) + + ;--- handle layer geometry + (set! bl-layer-width source-layer-width) + (set! bl-height (car (gimp-drawable-height bl-layer))) + (set! bl-x-off (- bl-x bl-width)) + (set! bl-x-off (+ bl-x-off (car (gimp-drawable-offsets bl-layer)))) + (set! bl-y-off (cadr (gimp-drawable-offsets bl-layer))) + + ;--- select a rectangular area to blend + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE bl-x-off bl-y-off bl-width bl-height) + ;--- select at least 1 pixel! + (gimp-image-select-rectangle img CHANNEL-OP-ADD bl-x-off bl-y-off (+ bl-width 1) bl-height) + + (if (= fadeout FALSE) + (begin + (set! nofadeout-bl-x-off (car (gimp-drawable-offsets bl-layer))) + (set! nofadeout-bl-width (+ nofadeout-bl-x-off bl-x)) + (set! nofadeout-bl-width (max nofadeout-bl-width 1)) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE + nofadeout-bl-x-off bl-y-off + nofadeout-bl-width bl-height) + ) + ) + + ;--- alpha blending text to trans (fadeout) + (gimp-context-set-foreground '(255 255 255)) + (gimp-context-set-background '( 0 0 0)) + (if (= fadeout TRUE) + (begin + ; blend with 20% offset to get less transparency in the front + (gimp-context-set-gradient-fg-bg-rgb) + (gimp-drawable_edit-gradient-fill bl-mask + GRADIENT-LINEAR 20 + FALSE 0 0 + TRUE + (+ bl-x-off bl-width) 0 + bl-x-off 0) + ) + ) + + (if (= fadeout FALSE) + (begin + (gimp-context-set-foreground '(255 255 255)) + (gimp-drawable-edit-fill bl-mask FILL-FOREGROUND) + ) + ) + + (gimp-layer-remove-mask bl-layer MASK-APPLY) + + ;--- add bright glow in front + (if (= show-glow TRUE) + (begin + ;--- add some brightness to whole text + (if (= fadeout TRUE) + (gimp-drawable-brightness-contrast bl-layer 0.787 0) + ) + + ;--- blend glow color inside the letters + (gimp-context-set-foreground glow-color) + (gimp-context-set-gradient-fg-transparent) + (gimp-drawable-edit-gradient-fill bl-layer + GRADIENT-LINEAR 0 + FALSE 0 0 + TRUE + (+ bl-x-off bl-width) 0 + (- (+ bl-x-off bl-width) after-glow) 0) + + ;--- add corona effect + (gimp-image-select-item img CHANNEL-OP-REPLACE bl-layer) + (gimp-selection-sharpen img) + (gimp-selection-grow img corona-width) + (gimp-layer-set-lock-alpha bl-layer FALSE) + (gimp-selection-feather img corona-width) + (gimp-context-set-foreground glow-color) + (gimp-drawable-edit-gradient-fill bl-layer + GRADIENT-LINEAR 0 + FALSE 0 0 + TRUE + (- (+ bl-x-off bl-width) corona-width) 0 + (- (+ bl-x-off bl-width) after-glow) 0) + ) + ) + + ;--- merge with bg layer + (set! bg-layer (car (gimp-layer-copy bg-source-layer FALSE))) + (gimp-image-insert-layer img bg-layer 0 -1) + (gimp-image-lower-item img bg-layer) + (set! bg-layer-name (string-append "bg-" + (number->string frame-nr 10))) + (gimp-item-set-name bg-layer bg-layer-name) + (gimp-item-set-visible bg-layer TRUE) + (set! blended-layer (car (gimp-image-merge-visible-layers img + CLIP-TO-IMAGE))) + ;(set! blended-layer bl-layer) + (gimp-item-set-visible blended-layer FALSE) + + ;--- end of "while" loop + (set! frame-nr (+ frame-nr 1)) + (set! bl-x (+ bl-x speed)) + ) + + ;--- finalize the job + (gimp-selection-none img) + (gimp-image-remove-layer img source-layer) + (gimp-image-remove-layer img bg-source-layer) + + (gimp-image-set-filename img "burn-in") + + (if (= optimize TRUE) + (begin + (gimp-image-convert-indexed img CONVERT-DITHER-FS CONVERT-PALETTE-WEB 250 FALSE TRUE "") + (set! img-out (car (plug-in-animationoptimize RUN-NONINTERACTIVE + img + bl-layer))) + ) + ) + + (gimp-item-set-visible (aref (cadr (gimp-image-get-layers img)) 0) + TRUE) + (gimp-image-undo-enable img) + (gimp-image-clean-all img) + (set! img-display (car (gimp-display-new img))) + + (gimp-displays-flush) + + (gimp-context-pop) + ) + + ;--- false form of "if-1" + (gimp-message _"The Burn-In script needs two layers in total. A foreground layer with transparency and a background layer.") + ) + ) +) + + +(script-fu-register "script-fu-burn-in-anim" + _"B_urn-In..." + _"Create intermediate layers to produce an animated 'burn-in' transition between two layers" + "Roland Berger roland@fuchur.leute.server.de" + "Roland Berger" + "January 2001" + "RGBA GRAYA INDEXEDA" + SF-IMAGE "The image" 0 + SF-DRAWABLE "Layer to animate" 0 + SF-COLOR _"Glow color" "white" + SF-TOGGLE _"Fadeout" FALSE + SF-VALUE _"Fadeout width" "100" + SF-VALUE _"Corona width" "7" + SF-VALUE _"After glow" "50" + SF-TOGGLE _"Add glowing" TRUE + SF-TOGGLE _"Prepare for GIF" FALSE + SF-VALUE _"Speed (pixels/frame)" "50" +) + +(script-fu-menu-register "script-fu-burn-in-anim" + "<Image>/Filters/Animation/Animators") diff --git a/plug-ins/script-fu/scripts/carve-it.scm b/plug-ins/script-fu/scripts/carve-it.scm new file mode 100644 index 0000000..a88fa08 --- /dev/null +++ b/plug-ins/script-fu/scripts/carve-it.scm @@ -0,0 +1,205 @@ +; CARVE-IT +; Carving, embossing, & stamping +; Process taken from "The Photoshop 3 WOW! Book" +; http://www.peachpit.com +; This script requires a grayscale image containing a single layer. +; This layer is used as the mask for the carving effect +; NOTE: This script requires the image to be carved to either be an +; RGB color or grayscale image with a single layer. An indexed file +; can not be used due to the use of gimp-drawable-histogram and +; gimp-drawable-levels. + + +(define (carve-scale val scale) + (* (sqrt val) scale)) + +(define (calculate-inset-gamma img layer) + (let* ((stats (gimp-drawable-histogram layer 0 0.0 1.0)) + (mean (car stats))) + (cond ((< mean 127) (+ 1.0 (* 0.5 (/ (- 127 mean) 127.0)))) + ((>= mean 127) (- 1.0 (* 0.5 (/ (- mean 127) 127.0))))))) + + +(define (copy-layer-carve-it dest-image dest-drawable source-image source-drawable) + (gimp-selection-all dest-image) + (gimp-drawable-edit-clear dest-drawable) + (gimp-selection-none dest-image) + (gimp-selection-all source-image) + (gimp-edit-copy source-drawable) + (let ((floating-sel (car (gimp-edit-paste dest-drawable FALSE)))) + (gimp-floating-sel-anchor floating-sel))) + + + +(define (script-fu-carve-it mask-img mask-drawable bg-layer carve-white) + (let* ( + (width (car (gimp-drawable-width mask-drawable))) + (height (car (gimp-drawable-height mask-drawable))) + (type (car (gimp-drawable-type bg-layer))) + (img (car (gimp-image-new width height (cond ((= type RGB-IMAGE) RGB) + ((= type RGBA-IMAGE) RGB) + ((= type GRAY-IMAGE) GRAY) + ((= type GRAYA-IMAGE) GRAY) + ((= type INDEXED-IMAGE) INDEXED) + ((= type INDEXEDA-IMAGE) INDEXED))))) + (size (min width height)) + (offx (carve-scale size 0.33)) + (offy (carve-scale size 0.25)) + (feather (carve-scale size 0.3)) + (brush-size (carve-scale size 0.3)) + (brush-name (car (gimp-brush-new "Carve It"))) + (mask-fs 0) + (mask (car (gimp-channel-new img width height "Engraving Mask" 50 '(0 0 0)))) + (inset-gamma (calculate-inset-gamma (car (gimp-item-get-image bg-layer)) bg-layer)) + (mask-fat 0) + (mask-emboss 0) + (mask-highlight 0) + (mask-shadow 0) + (shadow-layer 0) + (highlight-layer 0) + (cast-shadow-layer 0) + (csl-mask 0) + (inset-layer 0) + (il-mask 0) + (bg-width (car (gimp-drawable-width bg-layer))) + (bg-height (car (gimp-drawable-height bg-layer))) + (bg-type (car (gimp-drawable-type bg-layer))) + (bg-image (car (gimp-item-get-image bg-layer))) + (layer1 (car (gimp-layer-new img bg-width bg-height bg-type "Layer1" 100 LAYER-MODE-NORMAL))) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable img) + + (gimp-image-insert-layer img layer1 0 0) + + (gimp-selection-all img) + (gimp-drawable-edit-clear layer1) + (gimp-selection-none img) + (copy-layer-carve-it img layer1 bg-image bg-layer) + + (gimp-edit-copy mask-drawable) + (gimp-image-insert-channel img mask -1 0) + + (plug-in-tile RUN-NONINTERACTIVE img layer1 width height FALSE) + (set! mask-fs (car (gimp-edit-paste mask FALSE))) + (gimp-floating-sel-anchor mask-fs) + (if (= carve-white FALSE) + (gimp-drawable-invert mask FALSE)) + + (set! mask-fat (car (gimp-channel-copy mask))) + (gimp-image-insert-channel img mask-fat -1 0) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat) + + (gimp-brush-set-shape brush-name BRUSH-GENERATED-CIRCLE) + (gimp-brush-set-spikes brush-name 2) + (gimp-brush-set-hardness brush-name 1.0) + (gimp-brush-set-spacing brush-name 25) + (gimp-brush-set-aspect-ratio brush-name 1) + (gimp-brush-set-angle brush-name 0) + (cond (<= brush-size 17) (gimp-brush-set-radius brush-name (\ brush-size 2)) + (else gimp-brush-set-radius brush-name (\ 19 2))) + (gimp-context-set-brush brush-name) + + (gimp-context-set-foreground '(255 255 255)) + (gimp-drawable-edit-stroke-selection mask-fat) + (gimp-selection-none img) + + (set! mask-emboss (car (gimp-channel-copy mask-fat))) + (gimp-image-insert-channel img mask-emboss -1 0) + (plug-in-gauss-rle RUN-NONINTERACTIVE img mask-emboss feather TRUE TRUE) + (plug-in-emboss RUN-NONINTERACTIVE img mask-emboss 315.0 45.0 7 TRUE) + + (gimp-context-set-background '(180 180 180)) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask-fat) + (gimp-selection-invert img) + (gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask) + (gimp-drawable-edit-fill mask-emboss FILL-BACKGROUND) + (gimp-selection-none img) + + (set! mask-highlight (car (gimp-channel-copy mask-emboss))) + (gimp-image-insert-channel img mask-highlight -1 0) + (gimp-drawable-levels mask-highlight 0 + 0.7056 1.0 TRUE + 1.0 + 0.0 1.0 TRUE) + + (set! mask-shadow mask-emboss) + (gimp-drawable-levels mask-shadow 0 + 0.0 0.70586 TRUE + 1.0 + 0.0 1.0 TRUE) + + (gimp-edit-copy mask-shadow) + (set! shadow-layer (car (gimp-edit-paste layer1 FALSE))) + (gimp-floating-sel-to-layer shadow-layer) + (gimp-layer-set-mode shadow-layer LAYER-MODE-MULTIPLY) + + (gimp-edit-copy mask-highlight) + (set! highlight-layer (car (gimp-edit-paste shadow-layer FALSE))) + (gimp-floating-sel-to-layer highlight-layer) + (gimp-layer-set-mode highlight-layer LAYER-MODE-SCREEN) + + (gimp-edit-copy mask) + (set! cast-shadow-layer (car (gimp-edit-paste highlight-layer FALSE))) + (gimp-floating-sel-to-layer cast-shadow-layer) + (gimp-layer-set-mode cast-shadow-layer LAYER-MODE-MULTIPLY) + (gimp-layer-set-opacity cast-shadow-layer 75) + (plug-in-gauss-rle RUN-NONINTERACTIVE img cast-shadow-layer feather TRUE TRUE) + (gimp-item-transform-translate cast-shadow-layer offx offy) + + (set! csl-mask (car (gimp-layer-create-mask cast-shadow-layer ADD-MASK-BLACK))) + (gimp-layer-add-mask cast-shadow-layer csl-mask) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask) + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill csl-mask FILL-BACKGROUND) + + (set! inset-layer (car (gimp-layer-copy layer1 TRUE))) + (gimp-image-insert-layer img inset-layer 0 1) + + (set! il-mask (car (gimp-layer-create-mask inset-layer ADD-MASK-BLACK))) + (gimp-layer-add-mask inset-layer il-mask) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask) + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill il-mask FILL-BACKGROUND) + (gimp-selection-none img) + (gimp-selection-none bg-image) + (gimp-drawable-levels inset-layer 0 0.0 1.0 TRUE inset-gamma 0.0 1.0 TRUE) + (gimp-image-remove-channel img mask) + (gimp-image-remove-channel img mask-fat) + (gimp-image-remove-channel img mask-highlight) + (gimp-image-remove-channel img mask-shadow) + + (gimp-item-set-name layer1 _"Carved Surface") + (gimp-item-set-name shadow-layer _"Bevel Shadow") + (gimp-item-set-name highlight-layer _"Bevel Highlight") + (gimp-item-set-name cast-shadow-layer _"Cast Shadow") + (gimp-item-set-name inset-layer _"Inset") + + (gimp-brush-delete brush-name) + + (gimp-display-new img) + (gimp-image-undo-enable img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-carve-it" + _"Stencil C_arve..." + _"Use the specified drawable as a stencil to carve from the specified image." + "Spencer Kimball" + "Spencer Kimball" + "1997" + "GRAY" + SF-IMAGE "Mask image" 0 + SF-DRAWABLE "Mask drawable" 0 + SF-DRAWABLE _"Image to carve" 0 + SF-TOGGLE _"Carve white areas" TRUE +) + +(script-fu-menu-register "script-fu-carve-it" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/chrome-it.scm b/plug-ins/script-fu/scripts/chrome-it.scm new file mode 100644 index 0000000..761ac47 --- /dev/null +++ b/plug-ins/script-fu/scripts/chrome-it.scm @@ -0,0 +1,252 @@ +; CHROME-IT +; State of the art chrome effect for user-specified mask +; This script requires a grayscale image containing a single layer. +; This layer is used as the mask for the SOTA chrome effect + +(define (script-fu-sota-chrome-it mask-img mask-drawable chrome-saturation + chrome-lightness chrome-factor env-map hc cc carve-white) + + (define (set-pt a index x y) + (begin + (aset a (* index 2) x) + (aset a (+ (* index 2) 1) y) + ) + ) + + (define (spline-chrome-it) + (let* ((a (cons-array 18 'double))) + (set-pt a 0 0.0 0.0) + (set-pt a 1 0.125 0.9216) + (set-pt a 2 0.25 0.0902) + (set-pt a 3 0.375 0.9020) + (set-pt a 4 0.5 0.0989) + (set-pt a 5 0.625 0.9549) + (set-pt a 6 0.75 00784) + (set-pt a 7 0.875 0.9412) + (set-pt a 8 1.0 0.1216) + a + ) + ) + + + (define (shadows val) + (/ (* 0.96 val) 2.55) + ) + + (define (midtones val) + (/ val 2.55) + ) + + (define (highlights val) + ; The result is used as "gimp-drawable-color-balance" color parameter + ; and thus must be restricted to -100.0 <= highlights <= 100.0. + (min (/ (* 1.108 val) 2.55) 100.0) + ) + + (define (rval col) + (car col) + ) + + (define (gval col) + (cadr col) + ) + + (define (bval col) + (caddr col) + ) + + (define (sota-scale val scale chrome-factor) + (* (sqrt val) (* scale chrome-factor)) + ) + + (define (copy-layer-chrome-it dest-image dest-drawable source-image source-drawable) + (gimp-selection-all dest-image) + (gimp-drawable-edit-clear dest-drawable) + (gimp-selection-none dest-image) + (gimp-selection-all source-image) + (gimp-edit-copy source-drawable) + (let ( + (floating-sel (car (gimp-edit-paste dest-drawable FALSE))) + ) + (gimp-floating-sel-anchor floating-sel) + ) + ) + + (let* ( + (banding-img (car (gimp-file-load RUN-NONINTERACTIVE env-map env-map))) + (banding-layer (car (gimp-image-get-active-drawable banding-img))) + (banding-height (car (gimp-drawable-height banding-layer))) + (banding-width (car (gimp-drawable-width banding-layer))) + (banding-type (car (gimp-drawable-type banding-layer))) + (width (car (gimp-drawable-width mask-drawable))) + (height (car (gimp-drawable-height mask-drawable))) + (img (car (gimp-image-new width height GRAY))) + (size (min width height)) + (offx1 (sota-scale size 0.33 chrome-factor)) + (offy1 (sota-scale size 0.25 chrome-factor)) + (offx2 (sota-scale size (- 0.33) chrome-factor)) + (offy2 (sota-scale size (- 0.25) chrome-factor)) + (feather (sota-scale size 0.5 chrome-factor)) + (brush-size (sota-scale size 0.5 chrome-factor)) + (brush-name (car (gimp-brush-new "Chrome It"))) + (mask (car (gimp-channel-new img width height "Chrome Stencil" 50 '(0 0 0)))) + (bg-layer (car (gimp-layer-new img width height GRAY-IMAGE _"Background" 100 LAYER-MODE-NORMAL))) + (layer1 (car (gimp-layer-new img banding-width banding-height banding-type _"Layer 1" 100 LAYER-MODE-NORMAL))) + (layer2 (car (gimp-layer-new img width height GRAYA-IMAGE _"Layer 2" 100 LAYER-MODE-DIFFERENCE))) + (layer3 (car (gimp-layer-new img width height GRAYA-IMAGE _"Layer 3" 100 LAYER-MODE-NORMAL))) + (shadow (car (gimp-layer-new img width height GRAYA-IMAGE _"Drop Shadow" 100 LAYER-MODE-NORMAL))) + (mask-fs 0) + (layer-mask 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable img) + + (gimp-image-insert-channel img mask -1 0) + (gimp-image-insert-layer img bg-layer 0 0) + (gimp-image-insert-layer img shadow 0 0) + (gimp-image-insert-layer img layer3 0 0) + (gimp-image-insert-layer img layer2 0 0) + + (gimp-edit-copy mask-drawable) + (set! mask-fs (car (gimp-edit-paste mask FALSE))) + (gimp-floating-sel-anchor mask-fs) + (if (= carve-white FALSE) + (gimp-drawable-invert mask FALSE) + ) + + (gimp-context-set-background '(255 255 255)) + (gimp-selection-none img) + (gimp-drawable-edit-fill layer2 FILL-BACKGROUND) + (gimp-drawable-edit-fill layer3 FILL-BACKGROUND) + (gimp-drawable-edit-clear shadow) + + (gimp-item-set-visible bg-layer FALSE) + (gimp-item-set-visible shadow FALSE) + + (gimp-image-select-item img CHANNEL-OP-REPLACE mask) + (gimp-context-set-background '(0 0 0)) + (gimp-selection-translate img offx1 offy1) + (gimp-selection-feather img feather) + (gimp-drawable-edit-fill layer2 FILL-BACKGROUND) + (gimp-selection-translate img (* 2 offx2) (* 2 offy2)) + (gimp-drawable-edit-fill layer3 FILL-BACKGROUND) + (gimp-selection-none img) + (set! layer2 (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE))) + (gimp-drawable-invert layer2 FALSE) + + (gimp-image-insert-layer img layer1 0 0) + (copy-layer-chrome-it img layer1 banding-img banding-layer) + (gimp-image-delete banding-img) + (gimp-layer-scale layer1 width height FALSE) + (plug-in-gauss-iir RUN-NONINTERACTIVE img layer1 10 TRUE TRUE) + (gimp-layer-set-opacity layer1 50) + (set! layer1 (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE))) + (gimp-drawable-curves-spline layer1 HISTOGRAM-VALUE 18 (spline-chrome-it)) + + (set! layer-mask (car (gimp-layer-create-mask layer1 ADD-MASK-BLACK))) + (gimp-layer-add-mask layer1 layer-mask) + (gimp-image-select-item img CHANNEL-OP-REPLACE mask) + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill layer-mask FILL-BACKGROUND) + + (set! layer2 (car (gimp-layer-copy layer1 TRUE))) + (gimp-image-insert-layer img layer2 0 0) + + (gimp-brush-set-shape brush-name BRUSH-GENERATED-CIRCLE) + (gimp-brush-set-spikes brush-name 2) + (gimp-brush-set-hardness brush-name 1.0) + (gimp-brush-set-spacing brush-name 25) + (gimp-brush-set-aspect-ratio brush-name 1) + (gimp-brush-set-angle brush-name 0) + (cond (<= brush-size 17) (gimp-brush-set-radius brush-name (\ brush-size 2)) + (else gimp-brush-set-radius brush-name (\ 19 2))) + (gimp-context-set-brush brush-name) + + (gimp-context-set-foreground '(255 255 255)) + (gimp-drawable-edit-stroke-selection layer-mask) + + (gimp-context-set-background '(0 0 0)) + (gimp-selection-feather img (* feather 1.5)) + (gimp-selection-translate img (* 2.5 offx1) (* 2.5 offy1)) + (gimp-drawable-edit-fill shadow FILL-BACKGROUND) + + (gimp-selection-all img) + (gimp-context-set-pattern "Marble #1") + (gimp-drawable-edit-fill bg-layer FILL-PATTERN) + (gimp-selection-none img) + + (gimp-image-convert-rgb img) + + (gimp-drawable-color-balance layer1 TRANSFER-SHADOWS TRUE + (shadows (rval hc)) + (shadows (gval hc)) + (shadows (bval hc))) + (gimp-drawable-color-balance layer1 TRANSFER-MIDTONES TRUE + (midtones (rval hc)) + (midtones (gval hc)) + (midtones (bval hc))) + (gimp-drawable-color-balance layer1 TRANSFER-HIGHLIGHTS TRUE + (highlights (rval hc)) + (highlights (gval hc)) + (highlights (bval hc))) + + (gimp-drawable-color-balance layer2 TRANSFER-SHADOWS TRUE + (shadows (rval cc)) + (shadows (gval cc)) + (shadows (bval cc))) + (gimp-drawable-color-balance layer2 TRANSFER-MIDTONES TRUE + (midtones (rval cc)) + (midtones (gval cc)) + (midtones (bval cc))) + (gimp-drawable-color-balance layer2 TRANSFER-HIGHLIGHTS TRUE + (highlights (rval cc)) + (highlights (gval cc)) + (highlights (bval cc))) + (gimp-drawable-hue-saturation layer2 HUE-RANGE-ALL + 0.0 + chrome-lightness + chrome-saturation + 0.0) + + (gimp-item-set-visible shadow TRUE) + (gimp-item-set-visible bg-layer TRUE) + + (gimp-item-set-name layer2 _"Chrome") + (gimp-item-set-name layer1 _"Highlight") + + (gimp-image-remove-channel img mask) + + (gimp-brush-delete brush-name) + + (gimp-display-new img) + (gimp-image-undo-enable img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-sota-chrome-it" + _"Stencil C_hrome..." + _"Add a chrome effect to the selected region (or alpha) using a specified (grayscale) stencil" + "Spencer Kimball" + "Spencer Kimball" + "1997" + "GRAY" + SF-IMAGE "Chrome image" 0 + SF-DRAWABLE "Chrome mask" 0 + SF-ADJUSTMENT _"Chrome saturation" '(-80 -100 100 1 10 0 0) + SF-ADJUSTMENT _"Chrome lightness" '(-47 -100 100 1 10 0 0) + SF-ADJUSTMENT _"Chrome factor" '(0.75 0 1 0.1 0.01 2 0) + SF-FILENAME _"Environment map" + (string-append gimp-data-directory + "/scripts/images/beavis.jpg") + SF-COLOR _"Highlight balance" '(211 95 0) + SF-COLOR _"Chrome balance" "black" + SF-TOGGLE _"Chrome white areas" TRUE +) + +(script-fu-menu-register "script-fu-sota-chrome-it" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/circuit.scm b/plug-ins/script-fu/scripts/circuit.scm new file mode 100644 index 0000000..174a155 --- /dev/null +++ b/plug-ins/script-fu/scripts/circuit.scm @@ -0,0 +1,143 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Circuit board effect +; Copyright (c) 1997 Adrian Likins +; +; Generates what looks a little like the back of an old circuit board. +; Looks even better when gradient-mapp'ed with a suitable gradient. +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-circuit image + drawable + mask-size + seed + remove-bg + keep-selection + separate-layer) + (let* ( + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (active-selection 0) + (from-selection 0) + (selection-bounds 0) + (select-offset-x 0) + (select-offset-y 0) + (select-width 0) + (select-height 0) + (effect-layer 0) + (active-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-group-start image) + + (gimp-layer-add-alpha drawable) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! active-selection (car (gimp-selection-save image))) + (set! from-selection FALSE)) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))))) + + (set! selection-bounds (gimp-selection-bounds image)) + (set! select-offset-x (cadr selection-bounds)) + (set! select-offset-y (caddr selection-bounds)) + (set! select-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (set! select-height (- (caddr (cddr selection-bounds)) select-offset-y)) + + (if (= separate-layer TRUE) + (begin + (set! effect-layer (car (gimp-layer-new image + select-width + select-height + type + _"Effect layer" + 100 + LAYER-MODE-NORMAL))) + + (gimp-image-insert-layer image effect-layer 0 -1) + (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y) + (gimp-selection-none image) + (gimp-drawable-edit-clear effect-layer) + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-edit-copy drawable) + + (let ((floating-sel (car (gimp-edit-paste effect-layer FALSE)))) + (gimp-floating-sel-anchor floating-sel) + ) + (gimp-image-set-active-layer image effect-layer )) + (set! effect-layer drawable) + ) + (set! active-layer effect-layer) + + (if (= remove-bg TRUE) + (gimp-context-set-foreground '(0 0 0)) + (gimp-context-set-foreground '(14 14 14)) + ) + + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (plug-in-maze RUN-NONINTERACTIVE image active-layer 5 5 TRUE 0 seed 57 1) + (plug-in-oilify RUN-NONINTERACTIVE image active-layer mask-size 0) + (plug-in-edge RUN-NONINTERACTIVE image active-layer 2 1 0) + (if (= type RGBA-IMAGE) + (gimp-drawable-desaturate active-layer DESATURATE-LIGHTNESS)) + + (if (and + (= remove-bg TRUE) + (= separate-layer TRUE)) + (begin + (gimp-image-select-color image CHANNEL-OP-REPLACE active-layer '(0 0 0)) + (gimp-drawable-edit-clear active-layer))) + + (if (= keep-selection FALSE) + (gimp-selection-none image)) + + (gimp-image-remove-channel image active-selection) + (gimp-image-set-active-layer image drawable) + + (gimp-image-undo-group-end image) + + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-circuit" + _"_Circuit..." + _"Fill the selected region (or alpha) with traces like those on a circuit board" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "10/17/97" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Oilify mask size" '(17 3 50 1 10 0 1) + SF-ADJUSTMENT _"Circuit seed" '(3 1 3000000 1 10 0 1) + SF-TOGGLE _"No background (only for separate layer)" FALSE + SF-TOGGLE _"Keep selection" TRUE + SF-TOGGLE _"Separate layer" TRUE +) + +(script-fu-menu-register "script-fu-circuit" + "<Image>/Filters/Render") diff --git a/plug-ins/script-fu/scripts/clothify.scm b/plug-ins/script-fu/scripts/clothify.scm new file mode 100644 index 0000000..7b6f101 --- /dev/null +++ b/plug-ins/script-fu/scripts/clothify.scm @@ -0,0 +1,68 @@ +; CLOTHIFY version 1.02 +; Gives the current layer in the indicated image a cloth-like texture. +; Process invented by Zach Beane (Xath@irc.gimp.net) +; +; Tim Newsome <drz@froody.bloke.com> 4/11/97 + +(define (script-fu-clothify timg tdrawable bx by azimuth elevation depth) + (let* ( + (width (car (gimp-drawable-width tdrawable))) + (height (car (gimp-drawable-height tdrawable))) + (img (car (gimp-image-new width height RGB))) +; (layer-two (car (gimp-layer-new img width height RGB-IMAGE "Y Dots" 100 LAYER-MODE-MULTIPLY))) + (layer-one (car (gimp-layer-new img width height RGB-IMAGE "X Dots" 100 LAYER-MODE-NORMAL))) + (layer-two 0) + (bump-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable img) + + (gimp-image-insert-layer img layer-one 0 0) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill layer-one FILL-BACKGROUND) + + (plug-in-noisify RUN-NONINTERACTIVE img layer-one FALSE 0.7 0.7 0.7 0.7) + + (set! layer-two (car (gimp-layer-copy layer-one 0))) + (gimp-layer-set-mode layer-two LAYER-MODE-MULTIPLY) + (gimp-image-insert-layer img layer-two 0 0) + + (plug-in-gauss-rle RUN-NONINTERACTIVE img layer-one bx TRUE FALSE) + (plug-in-gauss-rle RUN-NONINTERACTIVE img layer-two by FALSE TRUE) + (gimp-image-flatten img) + (set! bump-layer (car (gimp-image-get-active-layer img))) + + (plug-in-c-astretch RUN-NONINTERACTIVE img bump-layer) + (plug-in-noisify RUN-NONINTERACTIVE img bump-layer FALSE 0.2 0.2 0.2 0.2) + + (plug-in-bump-map RUN-NONINTERACTIVE img tdrawable bump-layer azimuth elevation depth 0 0 0 0 FALSE FALSE 0) + (gimp-image-delete img) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + + +(script-fu-register "script-fu-clothify" + _"_Clothify..." + _"Add a cloth-like texture to the selected region (or alpha)" + "Tim Newsome <drz@froody.bloke.com>" + "Tim Newsome" + "4/11/97" + "RGB* GRAY*" + SF-IMAGE "Input image" 0 + SF-DRAWABLE "Input drawable" 0 + SF-ADJUSTMENT _"Blur X" '(9 3 100 1 10 0 1) + SF-ADJUSTMENT _"Blur Y" '(9 3 100 1 10 0 1) + SF-ADJUSTMENT _"Azimuth" '(135 0 360 1 10 1 0) + SF-ADJUSTMENT _"Elevation" '(45 0 90 1 10 1 0) + SF-ADJUSTMENT _"Depth" '(3 1 50 1 10 0 1) +) + +(script-fu-menu-register "script-fu-clothify" + "<Image>/Filters/Artistic") diff --git a/plug-ins/script-fu/scripts/coffee.scm b/plug-ins/script-fu/scripts/coffee.scm new file mode 100644 index 0000000..d72bcb7 --- /dev/null +++ b/plug-ins/script-fu/scripts/coffee.scm @@ -0,0 +1,94 @@ +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. + +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-coffee-stain inImage inLayer inNumber inDark) + (let* ( + (theImage inImage) + (theHeight (car (gimp-image-height theImage))) + (theWidth (car (gimp-image-width theImage))) + (theNumber inNumber) + (theSize (min theWidth theHeight)) + (theStain 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-group-start theImage) + + (while (> theNumber 0) + (set! theNumber (- theNumber 1)) + (set! theStain (car (gimp-layer-new theImage theSize theSize + RGBA-IMAGE _"Stain" 100 + (if (= inDark TRUE) + LAYER-MODE-DARKEN-ONLY LAYER-MODE-NORMAL)))) + + (gimp-image-insert-layer theImage theStain 0 0) + (gimp-selection-all theImage) + (gimp-drawable-edit-clear theStain) + + (let ((blobSize (/ (rand (- theSize 40)) (+ (rand 3) 1)))) + (gimp-image-select-ellipse theImage + CHANNEL-OP-REPLACE + (/ (- theSize blobSize) 2) + (/ (- theSize blobSize) 2) + blobSize blobSize) + ) + + (script-fu-distress-selection theImage theStain + (- (* (+ (rand 15) 1) (+ (rand 15) 1)) 1) + (/ theSize 25) 4 2 TRUE TRUE) + + (gimp-context-set-gradient "Coffee") + + (gimp-drawable-edit-gradient-fill theStain + GRADIENT-SHAPEBURST-DIMPLED 0 + FALSE 0 0 + TRUE + 0 0 0 0) + + (gimp-layer-set-offsets theStain + (- (rand theWidth) (/ theSize 2)) + (- (rand theHeight) (/ theSize 2))) + ) + + (gimp-selection-none theImage) + + (gimp-image-undo-group-end theImage) + + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +; Register the function with GIMP: + +(script-fu-register "script-fu-coffee-stain" + _"_Coffee Stain..." + _"Add realistic looking coffee stains to the image" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "25th April 1998" + "RGB*" + SF-IMAGE "The image" 0 + SF-DRAWABLE "The layer" 0 + SF-ADJUSTMENT _"Stains" '(3 1 10 1 1 0 0) + SF-TOGGLE _"Darken only" TRUE +) + +(script-fu-menu-register "script-fu-coffee-stain" "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/contactsheet.scm b/plug-ins/script-fu/scripts/contactsheet.scm new file mode 100644 index 0000000..5f7520e --- /dev/null +++ b/plug-ins/script-fu/scripts/contactsheet.scm @@ -0,0 +1,337 @@ +; "Contact Sheet" v1.2 September 5, 2007 +; by Kevin Cozens <kcozens@interlog.com> +; +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Version 1.0 (July 27, 2004) +; Created +; +; Version 1.1 (September 2, 2004) +; Added ability to select sheet size, set font used for sheet and image +; +; Version 1.2 (September 5, 2007) +; Preserve aspect ratio of original image. Center thumbnail in the area +; allowed for the thumbnail. Added disable/enable of undo operations. +; Added 1600x1200 sheet size. + +(define (script-fu-contactsheet dir sheet-size + title-font legend-font text-color bg-color) + + (define (init-sheet-data size) + (let ( + (sheet-w 0) + (sheet-h 0) + (thumb-w 0) + (thumb-h 0) + (border-x 0) ;Space between rows and at top and bottom of thumbnails + (border-y 0) ;Space between columns and at left and right of thumbnails + (off-x 0) ; Additional X shift to properly center a row of thumbnails + (off-y 0) ; Additional Y shift to properly center rows of thumbnails + (count 0) + ) + + (case size + ((0) (set! sheet-w 640) + (set! sheet-h 480) + (set! thumb-w 90) + (set! thumb-h 68) + (set! border-x 32) + (set! border-y 23) + (set! off-x -1) + (set! off-y 0) + (set! count 4) + ) + + ((1) (set! sheet-w 800) + (set! sheet-h 600) + (set! thumb-w 119) + (set! thumb-h 90) + (set! border-x 34) + (set! border-y 25) + (set! off-x 0) + (set! off-y 0) + (set! count 4) + ) + + ((2) (set! sheet-w 1024) + (set! sheet-h 768) + (set! thumb-w 133) + (set! thumb-h 100) + (set! border-x 32) + (set! border-y 24) + (set! off-x 1) + (set! off-y 0) + (set! count 5) + ) + + ((3) (set! sheet-w 1280) + (set! sheet-h 1024) + (set! thumb-w 133) + (set! thumb-h 100) + (set! border-x 24) + (set! border-y 25) + (set! off-x 0) + (set! off-y 0) + (set! count 7) + ) + + ((4) (set! sheet-w 1600) + (set! sheet-h 1200) + (set! thumb-w 120) + (set! thumb-h 90) + (set! border-x 36) + (set! border-y 25) + (set! off-x 2) + (set! off-y 0) + (set! count 9) + ) + ) + + (list sheet-w sheet-h thumb-w thumb-h border-x border-y off-x off-y count) + ) + ) + + (define (init-sheet-img img num img-width border-y off-y) + (let* ( + (text-layer 0) + (text-width 0) + (text-height 0) + ) + (gimp-selection-all img) + (gimp-drawable-fill (car (gimp-image-get-active-layer img)) + FILL-BACKGROUND) + (gimp-selection-none img) + (set! text-layer (car (gimp-text-fontname img -1 0 0 + (string-append _"Contact Sheet " + (number->string num) + _" for directory " dir) + 0 TRUE 14 PIXELS title-font))) + (set! text-width (car (gimp-drawable-width text-layer))) + (set! text-height (car (gimp-drawable-height text-layer))) + (gimp-layer-set-offsets text-layer + (/ (- img-width text-width) 2) + (/ (- (+ border-y off-y) text-height) 2) + ) + (gimp-image-merge-visible-layers img CLIP-TO-IMAGE) + ) + ) + + (define (make-thumbnail-size img thumb-w thumb-h) + (let* ( + (file-height (car (gimp-image-height img))) + (file-width (car (gimp-image-width img))) + (aspect-ratio (/ file-width file-height)) + ) + + ;Preserve the aspect ratio of the original image + (if (> file-width file-height) + (set! thumb-h (/ thumb-w aspect-ratio)) + (set! thumb-w (* thumb-h aspect-ratio)) + ) + + (gimp-image-scale img thumb-w thumb-h) + ) + ) + + (let* ( + (dir-stream (dir-open-stream dir)) + (sheet-num 1) + (img-count 0) + (pos-x 0) + (pos-y 0) + + (sheet-data 0) + (sheet-width 0) + (sheet-height 0) + (thumb-w 0) + (thumb-h 0) + (border-x 0) + (border-y 0) + (off-x 0) + (off-y 0) + (max-x 0) + (max-y 0) + + (sheet-img 0) + (sheet-layer 0) + + (new-img 0) + (file 0) + (file-path 0) + (tmp-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + (gimp-context-set-foreground text-color) + (gimp-context-set-background bg-color) + + (set! sheet-data (init-sheet-data sheet-size)) + (set! sheet-width (car sheet-data)) + (set! sheet-height (cadr sheet-data)) + (set! sheet-data (cddr sheet-data)) + (set! thumb-w (car sheet-data)) + (set! thumb-h (cadr sheet-data)) + (set! sheet-data (cddr sheet-data)) + (set! border-x (car sheet-data)) + (set! border-y (cadr sheet-data)) + (set! sheet-data (cddr sheet-data)) + (set! off-x (car sheet-data)) + (set! off-y (cadr sheet-data)) + (set! max-x (caddr sheet-data)) + (set! max-y max-x) + + (set! sheet-img (car (gimp-image-new sheet-width sheet-height RGB))) + + (gimp-image-undo-disable sheet-img) + + (set! sheet-layer (car (gimp-layer-new sheet-img sheet-width sheet-height + RGB-IMAGE "Background" + 100 LAYER-MODE-NORMAL))) + (gimp-image-insert-layer sheet-img sheet-layer 0 0) + + (init-sheet-img sheet-img sheet-num sheet-width border-y off-y) + + (if (not dir-stream) + (gimp-message (string-append _"Unable to open directory " dir)) + (begin + (do + ( (file (dir-read-entry dir-stream) (dir-read-entry dir-stream)) ) + ( (eof-object? file) ) + + (set! file-path (string-append dir DIR-SEPARATOR file)) + (if (and (not (re-match "index.*" file)) + (= (file-type file-path) FILE-TYPE-FILE) + ) + (catch () + (set! new-img + (car (gimp-file-load RUN-NONINTERACTIVE file-path file))) + + (make-thumbnail-size new-img thumb-w thumb-h) + + (if (> (car (gimp-image-get-layers new-img)) 1) + (gimp-image-flatten new-img) + ) + (set! tmp-layer (car (gimp-layer-new-from-drawable + (car (gimp-image-get-active-drawable new-img)) + sheet-img))) + + (gimp-image-insert-layer sheet-img tmp-layer 0 0) + + ;Move thumbnail in to position and center it in area available. + (gimp-layer-set-offsets tmp-layer + (+ border-x off-x (* pos-x (+ thumb-w border-x)) + (/ (- thumb-w (car (gimp-image-width new-img))) 2) + ) + (+ border-y off-y (* pos-y (+ thumb-h border-y)) + (/ (- thumb-h (car (gimp-image-height new-img))) 2) + ) + ) + + (gimp-image-delete new-img) + + (set! tmp-layer (car (gimp-text-fontname sheet-img -1 0 0 file + 0 TRUE 12 PIXELS legend-font))) + (gimp-layer-set-offsets tmp-layer + (+ border-x off-x (* pos-x (+ thumb-w border-x)) + (/ (- thumb-w (car (gimp-drawable-width tmp-layer))) 2)) + (+ border-y off-y (* pos-y (+ thumb-h border-y)) thumb-h 6) + ) + + (set! img-count (+ img-count 1)) + + (set! pos-x (+ pos-x 1)) + (if (> pos-x max-x) + (begin + (set! pos-x 0) + (set! pos-y (+ pos-y 1)) + (if (> pos-y max-y) + (begin + (set! pos-y 0) + (set! sheet-layer (car (gimp-image-flatten sheet-img))) + (gimp-file-save + RUN-NONINTERACTIVE + sheet-img + sheet-layer + (string-append dir DIR-SEPARATOR + "index" (number->string sheet-num) ".jpg") + (string-append + "index" (number->string sheet-num) ".jpg") + ) + + (set! sheet-num (+ sheet-num 1)) + (init-sheet-img sheet-img sheet-num sheet-width + border-y off-y) + (set! img-count 0) + ) + ) + ) + ) + ) + ) + ) + + (dir-close-stream dir-stream) + + (if (> img-count 0) + (begin + (set! sheet-layer (car (gimp-image-flatten sheet-img))) + (gimp-file-save + RUN-NONINTERACTIVE + sheet-img + sheet-layer + (string-append dir DIR-SEPARATOR + "index" (number->string sheet-num) ".jpg") + (string-append "index" (number->string sheet-num) ".jpg") + ) + ) + ) + ) + + (gimp-image-undo-enable sheet-img) + (gimp-image-delete sheet-img) + + (display (string-append _"Created " (number->string sheet-num) + _" contact sheets from a total of " + (number->string img-count) _" images")) + (newline) + ) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-contactsheet" + _"_Contact Sheet..." + _"Create a series of images containing thumbnail sized versions of all of the images in a specified directory." + "Kevin Cozens <kcozens@interlog.com>" + "Kevin Cozens" + "July 19, 2004" + "" + SF-DIRNAME _"Images Directory" "/tmp/test" + SF-OPTION _"Sheet size" '("640 x 480" + "800 x 600" + "1024 x 768" + "1280 x 1024" + "1600 x 1200") + SF-FONT _"Title font" "Sans Bold Italic" + SF-FONT _"Legend font" "Sans Bold" + SF-COLOR _"Text color" "white" + SF-COLOR _"Background color" "black" +) + +(script-fu-menu-register "script-fu-contactsheet" "<Image>/Filters/Combine") diff --git a/plug-ins/script-fu/scripts/copy-visible.scm b/plug-ins/script-fu/scripts/copy-visible.scm new file mode 100644 index 0000000..942793c --- /dev/null +++ b/plug-ins/script-fu/scripts/copy-visible.scm @@ -0,0 +1,49 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; "Copy Visible" -- copy the visible selection so that it can be pasted easily +; Copyright (C) 2004 Raphaël Quinet, Adrian Likins, Sven Neumann +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; 2004-04-14 This script was almost rewritten from scratch +; by Raphaël Quinet <raphael@gimp.org> +; see also http://bugzilla.gnome.org/show_bug.cgi?id=139989 +; +; The code is new but the API is the same as in the previous version: +; "Copy Visible" version 0.11 01/24/98 +; by Adrian Likins <adrian@gimp.org> +; _heavily_ based on: +; cyn-merge.scm version 0.02 10/10/97 +; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de) +; +; Removed all code and made it a backward-compat wrapper around +; (gimp-edit-copy-visible) +; 2004-12-12 Michael Natterer <mitch@gimp.org> +; + +(define (script-fu-copy-visible image drawable) + (gimp-edit-copy-visible image) +) + +(script-fu-register "script-fu-copy-visible" + "Copy Visible" + "This procedure is deprecated! Use \'gimp-edit-copy-visible\' instead." + "" + "" + "" + "RGB* INDEXED* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 +) diff --git a/plug-ins/script-fu/scripts/difference-clouds.scm b/plug-ins/script-fu/scripts/difference-clouds.scm new file mode 100644 index 0000000..15b8fc8 --- /dev/null +++ b/plug-ins/script-fu/scripts/difference-clouds.scm @@ -0,0 +1,80 @@ +; Plugin for the GNU Image Manipulation Program +; Copyright (C) 2006 Martin Nordholts +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Renders Difference Clouds onto a layer, i.e. solid noise merged down with the +; Difference Mode +; + +(define (script-fu-difference-clouds image + drawable) + + (let* ((draw-offset-x (car (gimp-drawable-offsets drawable))) + (draw-offset-y (cadr (gimp-drawable-offsets drawable))) + (has-sel (car (gimp-drawable-mask-intersect drawable))) + (sel-offset-x (cadr (gimp-drawable-mask-intersect drawable))) + (sel-offset-y (caddr (gimp-drawable-mask-intersect drawable))) + (width (cadddr (gimp-drawable-mask-intersect drawable))) + (height (caddr (cddr (gimp-drawable-mask-intersect drawable)))) + (type (car (gimp-drawable-type-with-alpha drawable))) + (diff-clouds -1) + (offset-x 0) + (offset-y 0) + ) + + (gimp-image-undo-group-start image) + + ; Create the cloud layer + (set! diff-clouds (car (gimp-layer-new image width height type + "Clouds" 100 LAYER-MODE-DIFFERENCE))) + + ; Add the cloud layer above the current layer + (gimp-image-insert-layer image diff-clouds 0 -1) + + ; Clear the layer (so there are no noise in it) + (gimp-drawable-fill diff-clouds FILL-TRANSPARENT) + + ; Selections are relative to the drawable; adjust the final offset + (set! offset-x (+ draw-offset-x sel-offset-x)) + (set! offset-y (+ draw-offset-y sel-offset-y)) + + ; Offset the clouds layer + (if (gimp-item-is-layer drawable) + (gimp-item-transform-translate diff-clouds offset-x offset-y)) + + ; Show the solid noise dialog + (plug-in-solid-noise SF-RUN-MODE image diff-clouds 0 0 0 1 4.0 4.0) + + ; Merge the clouds layer with the layer below + (gimp-image-merge-down image diff-clouds EXPAND-AS-NECESSARY) + + (gimp-image-undo-group-end image) + + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-difference-clouds" + _"_Difference Clouds..." + _"Solid noise applied with Difference layer mode" + "Martin Nordholts <enselic@hotmail.com>" + "Martin Nordholts" + "2006/10/25" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0) + +(script-fu-menu-register "script-fu-difference-clouds" + "<Image>/Filters/Render/Noise") diff --git a/plug-ins/script-fu/scripts/distress-selection.scm b/plug-ins/script-fu/scripts/distress-selection.scm new file mode 100644 index 0000000..ef87b79 --- /dev/null +++ b/plug-ins/script-fu/scripts/distress-selection.scm @@ -0,0 +1,122 @@ +; +; distress selection +; +; +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. + +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +; Define the function: + +(define (script-fu-distress-selection inImage + inDrawable + inThreshold + inSpread + inGranu + inSmooth + inSmoothH + inSmoothV) + + (let ( + (theImage inImage) + (theWidth (car (gimp-image-width inImage))) + (theHeight (car (gimp-image-height inImage))) + (theLayer 0) + (theMode (car (gimp-image-base-type inImage))) + (prevLayer (car (gimp-image-get-active-layer inImage))) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + (gimp-image-undo-group-start theImage) + + (if (= theMode GRAY) + (set! theMode GRAYA-IMAGE) + (set! theMode RGBA-IMAGE) + ) + (set! theLayer (car (gimp-layer-new theImage + theWidth + theHeight + theMode + "Distress Scratch Layer" + 100 + LAYER-MODE-NORMAL))) + + (gimp-image-insert-layer theImage theLayer 0 0) + + (if (= FALSE (car (gimp-selection-is-empty theImage))) + (gimp-drawable-edit-fill theLayer FILL-BACKGROUND) + ) + + (gimp-selection-invert theImage) + + (if (= FALSE (car (gimp-selection-is-empty theImage))) + (gimp-drawable-edit-clear theLayer) + ) + + (gimp-selection-invert theImage) + (gimp-selection-none inImage) + + (gimp-layer-scale theLayer + (/ theWidth inGranu) + (/ theHeight inGranu) + TRUE) + + (plug-in-spread RUN-NONINTERACTIVE + theImage + theLayer + inSpread + inSpread) + + (plug-in-gauss-iir RUN-NONINTERACTIVE + theImage theLayer inSmooth inSmoothH inSmoothV) + (gimp-layer-scale theLayer theWidth theHeight TRUE) + (plug-in-threshold-alpha RUN-NONINTERACTIVE theImage theLayer inThreshold) + (plug-in-gauss-iir RUN-NONINTERACTIVE theImage theLayer 1 TRUE TRUE) + (gimp-image-select-item inImage CHANNEL-OP-REPLACE theLayer) + (gimp-image-remove-layer theImage theLayer) + (if (and (= (car (gimp-item-is-channel inDrawable)) TRUE) + (= (car (gimp-item-is-layer-mask inDrawable)) FALSE)) + (gimp-image-set-active-channel theImage inDrawable) + ) + (gimp-image-undo-group-end theImage) + + (gimp-image-set-active-layer theImage prevLayer) + + (gimp-displays-flush) + (gimp-context-pop) + ) +) + + +(script-fu-register "script-fu-distress-selection" + _"_Distort..." + _"Distress the selection" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "23rd April 1998" + "RGB*,GRAY*" + SF-IMAGE "The image" 0 + SF-DRAWABLE "The layer" 0 + SF-ADJUSTMENT _"_Threshold (bigger 1<-->254 smaller)" '(127 1 254 1 10 0 0) + SF-ADJUSTMENT _"_Spread" '(8 0 1000 1 10 0 1) + SF-ADJUSTMENT _"_Granularity (1 is low)" '(4 1 25 1 10 0 1) + SF-ADJUSTMENT _"S_mooth" '(2 1 150 1 10 0 1) + SF-TOGGLE _"Smooth hor_izontally" TRUE + SF-TOGGLE _"Smooth _vertically" TRUE +) + +(script-fu-menu-register "script-fu-distress-selection" + "<Image>/Select/Modify") diff --git a/plug-ins/script-fu/scripts/drop-shadow.scm b/plug-ins/script-fu/scripts/drop-shadow.scm new file mode 100644 index 0000000..c1b243a --- /dev/null +++ b/plug-ins/script-fu/scripts/drop-shadow.scm @@ -0,0 +1,187 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; drop-shadow.scm version 1.05 2011/4/21 +; +; CHANGE-LOG: +; 1.00 - initial release +; 1.01 - fixed the problem with a remaining copy of the selection +; 1.02 - some code cleanup, no real changes +; 1.03 - can't call gimp-drawable-edit-fill until layer is added to image! +; 1.04 +; 1.05 - replaced deprecated function calls with new ones for 2.8 +; +; Copyright (C) 1997-1999 Sven Neumann <sven@gimp.org> +; +; +; Adds a drop-shadow of the current selection or alpha-channel. +; +; This script is derived from my script add-shadow, which has become +; obsolete now. Thanks to Andrew Donkin (ard@cs.waikato.ac.nz) for his +; idea to add alpha-support to add-shadow. + + +(define (script-fu-drop-shadow image + drawable + shadow-transl-x + shadow-transl-y + shadow-blur + shadow-color + shadow-opacity + allow-resize) + (let* ( + (shadow-blur (max shadow-blur 0)) + (shadow-opacity (min shadow-opacity 100)) + (shadow-opacity (max shadow-opacity 0)) + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (from-selection 0) + (active-selection 0) + (shadow-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-set-active-layer image drawable) + + (gimp-image-undo-group-start image) + + (gimp-layer-add-alpha drawable) + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! from-selection FALSE)) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))))) + + (let* ((selection-bounds (gimp-selection-bounds image)) + (select-offset-x (cadr selection-bounds)) + (select-offset-y (caddr selection-bounds)) + (select-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (select-height (- (caddr (cddr selection-bounds)) select-offset-y)) + + (shadow-width (+ select-width (* 2 shadow-blur))) + (shadow-height (+ select-height (* 2 shadow-blur))) + + (shadow-offset-x (- select-offset-x shadow-blur)) + (shadow-offset-y (- select-offset-y shadow-blur))) + + (if (= allow-resize TRUE) + (let* ((new-image-width image-width) + (new-image-height image-height) + (image-offset-x 0) + (image-offset-y 0)) + + (if (< (+ shadow-offset-x shadow-transl-x) 0) + (begin + (set! image-offset-x (- 0 (+ shadow-offset-x + shadow-transl-x))) + (set! shadow-offset-x (- 0 shadow-transl-x)) + (set! new-image-width (+ new-image-width image-offset-x)))) + + (if (< (+ shadow-offset-y shadow-transl-y) 0) + (begin + (set! image-offset-y (- 0 (+ shadow-offset-y + shadow-transl-y))) + (set! shadow-offset-y (- 0 shadow-transl-y)) + (set! new-image-height (+ new-image-height image-offset-y)))) + + (if (> (+ (+ shadow-width shadow-offset-x) shadow-transl-x) + new-image-width) + (set! new-image-width + (+ (+ shadow-width shadow-offset-x) shadow-transl-x))) + + (if (> (+ (+ shadow-height shadow-offset-y) shadow-transl-y) + new-image-height) + (set! new-image-height + (+ (+ shadow-height shadow-offset-y) shadow-transl-y))) + + (gimp-image-resize image + new-image-width + new-image-height + image-offset-x + image-offset-y) + ) + ) + + (set! shadow-layer (car (gimp-layer-new image + shadow-width + shadow-height + type + "Drop Shadow" + shadow-opacity + LAYER-MODE-NORMAL))) + (gimp-image-set-active-layer image drawable) + (gimp-image-insert-layer image shadow-layer 0 -1) + (gimp-layer-set-offsets shadow-layer + shadow-offset-x + shadow-offset-y)) + + (gimp-drawable-fill shadow-layer FILL-TRANSPARENT) + (gimp-context-set-background shadow-color) + (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND) + (gimp-selection-none image) + (gimp-layer-set-lock-alpha shadow-layer FALSE) + (if (>= shadow-blur 1.0) (plug-in-gauss-rle RUN-NONINTERACTIVE + image + shadow-layer + shadow-blur + TRUE + TRUE)) + (gimp-item-transform-translate shadow-layer shadow-transl-x shadow-transl-y) + + (if (= from-selection TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-drawable-edit-clear shadow-layer) + (gimp-image-remove-channel image active-selection))) + + (if (and + (= (car (gimp-layer-is-floating-sel drawable)) 0) + (= from-selection FALSE)) + (gimp-image-raise-item image drawable)) + + (gimp-image-set-active-layer image drawable) + (gimp-image-undo-group-end image) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-drop-shadow" + _"_Drop Shadow (legacy)..." + _"Add a drop shadow to the selected region (or alpha)" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "1999/12/21" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Offset X" '(4 -4096 4096 1 10 0 1) + SF-ADJUSTMENT _"Offset Y" '(4 -4096 4096 1 10 0 1) + SF-ADJUSTMENT _"Blur radius" '(15 0 1024 1 10 0 1) + SF-COLOR _"Color" "black" + SF-ADJUSTMENT _"Opacity" '(60 0 100 1 10 0 0) + SF-TOGGLE _"Allow resizing" TRUE +) + +(script-fu-menu-register "script-fu-drop-shadow" + "<Image>/Filters/Light and Shadow/Shadow") diff --git a/plug-ins/script-fu/scripts/erase-rows.scm b/plug-ins/script-fu/scripts/erase-rows.scm new file mode 100644 index 0000000..4ae4c77 --- /dev/null +++ b/plug-ins/script-fu/scripts/erase-rows.scm @@ -0,0 +1,71 @@ +(define (script-fu-erase-rows img drawable orientation which type) + (script-fu-erase-nth-rows img drawable orientation which type 2) +) + +(define (script-fu-erase-nth-rows img drawable orientation offset type nth) + (let* ( + (width (car (gimp-drawable-width drawable))) + (height (car (gimp-drawable-height drawable))) + (position-x (car (gimp-drawable-offsets drawable))) + (position-y (cadr (gimp-drawable-offsets drawable))) + ) + + (gimp-context-push) + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + (gimp-context-set-feather FALSE) + (gimp-image-undo-group-start img) + (letrec ((loop (lambda (i max) + (if (< i max) + (begin + (if (= orientation 0) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE position-x (+ i position-y) width 1) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE (+ i position-x) position-y 1 height)) + (if (= type 0) + (gimp-drawable-edit-clear drawable) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND)) + (loop (+ i nth) max)))))) + (loop offset + (if (= orientation 0) + height + width) + ) + ) + (gimp-selection-none img) + (gimp-image-undo-group-end img) + (gimp-context-pop) + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-erase-nth-rows" + _"_Erase Every Nth Row..." + _"Erase every nth row or column" + "Federico Mena Quintero, Nikc M. (Altered)" + "Federico Mena Quintero" + "June 1997, February 2020" + "RGB* GRAY* INDEXED*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-OPTION _"Rows/cols" '(_"Rows" _"Columns") + SF-ADJUSTMENT "Offset" '(0 0 1024 1 10 0 SF-SPINNER) + SF-OPTION _"Erase/fill" '(_"Erase" _"Fill with BG") + SF-ADJUSTMENT "Skip by" '(1 1 1024 1 10 0 SF-SPINNER) +) + +(script-fu-register "script-fu-erase-rows" + _"_Erase Every Other Row..." + _"Erase every other row or column" + "Federico Mena Quintero" + "Federico Mena Quintero" + "June 1997" + "RGB* GRAY* INDEXED*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-OPTION _"Rows/cols" '(_"Rows" _"Columns") + SF-OPTION _"Even/odd" '(_"Even" _"Odd") + SF-OPTION _"Erase/fill" '(_"Erase" _"Fill with BG") +) + +; (script-fu-menu-register "script-fu-erase-rows" +; "<Image>/Filters/Distorts") diff --git a/plug-ins/script-fu/scripts/font-map.scm b/plug-ins/script-fu/scripts/font-map.scm new file mode 100644 index 0000000..7481d28 --- /dev/null +++ b/plug-ins/script-fu/scripts/font-map.scm @@ -0,0 +1,168 @@ +;; font-select +;; Spencer Kimball + +(define (script-fu-font-map text + use-name + labels + font-filter + font-size + border + colors) + + (define (max-font-width text use-name list-cnt list font-size) + (let* ((count 0) + (width 0) + (maxwidth 0) + (font "") + (extents '())) + (while (< count list-cnt) + (set! font (car list)) + + (if (= use-name TRUE) + (set! text font)) + (set! extents (gimp-text-get-extents-fontname text + font-size PIXELS + font)) + (set! width (car extents)) + (if (> width maxwidth) + (set! maxwidth width)) + + (set! list (cdr list)) + (set! count (+ count 1)) + ) + + maxwidth + ) + ) + + (define (max-font-height text use-name list-cnt list font-size) + (let* ((count 0) + (height 0) + (maxheight 0) + (font "") + (extents '())) + (while (< count list-cnt) + (set! font (car list)) + + (if (= use-name TRUE) + (set! text font) + ) + (set! extents (gimp-text-get-extents-fontname text + font-size PIXELS + font)) + (set! height (cadr extents)) + (if (> height maxheight) + (set! maxheight height) + ) + + (set! list (cdr list)) + (set! count (+ count 1)) + ) + + maxheight + ) + ) + + (let* ( + (font-data (gimp-fonts-get-list font-filter)) + (font-list (cadr font-data)) + (num-fonts (car font-data)) + (label-size (/ font-size 2)) + (border (+ border (* labels (/ label-size 2)))) + (y border) + (maxheight (max-font-height text use-name num-fonts font-list font-size)) + (maxwidth (max-font-width text use-name num-fonts font-list font-size)) + (width (+ maxwidth (* 2 border))) + (height (+ (+ (* maxheight num-fonts) (* 2 border)) + (* labels (* label-size num-fonts)))) + (img (car (gimp-image-new width height (if (= colors 0) + GRAY RGB)))) + (drawable (car (gimp-layer-new img width height (if (= colors 0) + GRAY-IMAGE RGB-IMAGE) + "Background" 100 LAYER-MODE-NORMAL))) + (count 0) + (font "") + ) + + (gimp-context-push) + + (gimp-image-undo-disable img) + + (if (= colors 0) + (begin + (gimp-context-set-background '(255 255 255)) + (gimp-context-set-foreground '(0 0 0)))) + + (gimp-image-insert-layer img drawable 0 0) + (gimp-drawable-edit-clear drawable) + + (if (= labels TRUE) + (begin + (set! drawable (car (gimp-layer-new img width height + (if (= colors 0) + GRAYA-IMAGE RGBA-IMAGE) + "Labels" 100 LAYER-MODE-NORMAL))) + (gimp-image-insert-layer img drawable 0 -1))) + (gimp-drawable-edit-clear drawable) + + (while (< count num-fonts) + (set! font (car font-list)) + + (if (= use-name TRUE) + (set! text font)) + + (gimp-text-fontname img -1 + border + y + text + 0 TRUE font-size PIXELS + font) + + (set! y (+ y maxheight)) + + (if (= labels TRUE) + (begin + (gimp-floating-sel-anchor (car (gimp-text-fontname img drawable + (- border + (/ label-size 2)) + (- y + (/ label-size 2)) + font + 0 TRUE + label-size PIXELS + "Sans"))) + (set! y (+ y label-size)) + ) + ) + + (set! font-list (cdr font-list)) + (set! count (+ count 1)) + ) + + (gimp-image-set-active-layer img drawable) + + (gimp-image-undo-enable img) + (gimp-display-new img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-font-map" + _"Render _Font Map..." + _"Create an image filled with previews of fonts matching a fontname filter" + "Spencer Kimball" + "Spencer Kimball" + "1997" + "" + SF-STRING _"_Text" "How quickly daft jumping zebras vex." + SF-TOGGLE _"Use font _name as text" FALSE + SF-TOGGLE _"_Labels" TRUE + SF-STRING _"_Filter (regexp)" "Sans" + SF-ADJUSTMENT _"Font _size (pixels)" '(32 2 1000 1 10 0 1) + SF-ADJUSTMENT _"_Border (pixels)" '(10 0 200 1 10 0 1) + SF-OPTION _"_Color scheme" '(_"Black on white" _"Active colors") +) + +(script-fu-menu-register "script-fu-font-map" + "<Fonts>") diff --git a/plug-ins/script-fu/scripts/fuzzyborder.scm b/plug-ins/script-fu/scripts/fuzzyborder.scm new file mode 100644 index 0000000..9c3ddbe --- /dev/null +++ b/plug-ins/script-fu/scripts/fuzzyborder.scm @@ -0,0 +1,168 @@ +; +; fuzzy-border +; +; Do a cool fade to a given color at the border of an image (optional shadow) +; Will make image RGB if it isn't already. +; +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. + +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +; Define the function: + +(define (script-fu-fuzzy-border inImage + inLayer + inColor + inSize + inBlur + inGranu + inShadow + inShadWeight + inCopy + inFlatten + ) + + (define (chris-color-edge inImage inLayer inColor inSize) + (gimp-selection-all inImage) + (gimp-selection-shrink inImage inSize) + (gimp-selection-invert inImage) + (gimp-context-set-background inColor) + (gimp-drawable-edit-fill inLayer FILL-BACKGROUND) + (gimp-selection-none inImage) + ) + + (let ( + (theWidth (car (gimp-image-width inImage))) + (theHeight (car (gimp-image-height inImage))) + (theImage (if (= inCopy TRUE) (car (gimp-image-duplicate inImage)) + inImage)) + (theLayer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (if (= inCopy TRUE) + (gimp-image-undo-disable theImage) + (gimp-image-undo-group-start theImage) + ) + + (gimp-selection-all theImage) + + (if (> (car (gimp-drawable-type inLayer)) 1) + (gimp-image-convert-rgb theImage) + ) + + (set! theLayer (car (gimp-layer-new theImage + theWidth + theHeight + RGBA-IMAGE + "layer 1" + 100 + LAYER-MODE-NORMAL))) + + (gimp-image-insert-layer theImage theLayer 0 0) + + + (gimp-drawable-edit-clear theLayer) + (chris-color-edge theImage theLayer inColor inSize) + + (gimp-layer-scale theLayer + (/ theWidth inGranu) + (/ theHeight inGranu) + TRUE) + + (plug-in-spread RUN-NONINTERACTIVE + theImage + theLayer + (/ inSize inGranu) + (/ inSize inGranu)) + (chris-color-edge theImage theLayer inColor 1) + (gimp-layer-scale theLayer theWidth theHeight TRUE) + + (gimp-image-select-item theImage CHANNEL-OP-REPLACE theLayer) + (gimp-selection-invert theImage) + (gimp-drawable-edit-clear theLayer) + (gimp-selection-invert theImage) + (gimp-drawable-edit-clear theLayer) + (gimp-context-set-background inColor) + (gimp-drawable-edit-fill theLayer FILL-BACKGROUND) + (gimp-selection-none theImage) + (chris-color-edge theImage theLayer inColor 1) + + (if (= inBlur TRUE) + (plug-in-gauss-rle RUN-NONINTERACTIVE + theImage theLayer inSize TRUE TRUE) + ) + (if (= inShadow TRUE) + (begin + (gimp-image-insert-layer theImage + (car (gimp-layer-copy theLayer FALSE)) 0 -1) + (gimp-layer-scale theLayer + (- theWidth inSize) (- theHeight inSize) TRUE) + (gimp-drawable-desaturate theLayer DESATURATE-LIGHTNESS) + (gimp-drawable-brightness-contrast theLayer 0.5 0.5) + (gimp-drawable-invert theLayer FALSE) + (gimp-layer-resize theLayer + theWidth + theHeight + (/ inSize 2) + (/ inSize 2)) + (plug-in-gauss-rle RUN-NONINTERACTIVE + theImage + theLayer + (/ inSize 2) + TRUE + TRUE) + (gimp-layer-set-opacity theLayer inShadWeight) + ) + ) + (if (= inFlatten TRUE) + (gimp-image-flatten theImage) + ) + (if (= inCopy TRUE) + (begin (gimp-image-clean-all theImage) + (gimp-display-new theImage) + (gimp-image-undo-enable theImage) + ) + (gimp-image-undo-group-end theImage) + ) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-fuzzy-border" + _"_Fuzzy Border..." + _"Add a jagged, fuzzy border to an image" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "3rd April 1998" + "RGB* GRAY*" + SF-IMAGE "The image" 0 + SF-DRAWABLE "The layer" 0 + SF-COLOR _"Color" "white" + SF-ADJUSTMENT _"Border size" '(16 1 300 1 10 0 1) + SF-TOGGLE _"Blur border" TRUE + SF-ADJUSTMENT _"Granularity (1 is Low)" '(4 1 16 0.25 5 2 0) + SF-TOGGLE _"Add shadow" FALSE + SF-ADJUSTMENT _"Shadow weight (%)" '(100 0 100 1 10 0 0) + SF-TOGGLE _"Work on copy" TRUE + SF-TOGGLE _"Flatten image" TRUE +) + +(script-fu-menu-register "script-fu-fuzzy-border" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/gimp-online.scm b/plug-ins/script-fu/scripts/gimp-online.scm new file mode 100644 index 0000000..8d3569a --- /dev/null +++ b/plug-ins/script-fu/scripts/gimp-online.scm @@ -0,0 +1,277 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; gimp-online.scm +; Copyright (C) 2003 Henrik Brix Andersen <brix@gimp.org> +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +(define (gimp-online-docs-web-site) + (plug-in-web-browser "https://docs.gimp.org/") +) + +(define (gimp-help-concepts-usage) + (gimp-help "" "gimp-concepts-usage") +) + +(define (gimp-help-using-docks) + (gimp-help "" "gimp-concepts-docks") +) + +(define (gimp-help-using-simpleobjects) + (gimp-help "" "gimp-using-simpleobjects") +) + +(define (gimp-help-using-selections) + (gimp-help "" "gimp-using-selections") +) + +(define (gimp-help-using-fileformats) + (gimp-help "" "gimp-using-fileformats") +) + +(define (gimp-help-using-photography) + (gimp-help "" "gimp-using-photography") +) + +(define (gimp-help-using-web) + (gimp-help "" "gimp-using-web") +) + +(define (gimp-help-concepts-paths) + (gimp-help "" "gimp-concepts-paths") +) + + +; shortcuts to help topics +(script-fu-register "gimp-help-concepts-paths" + _"Using _Paths" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-concepts-paths" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-web" + _"_Preparing your Images for the Web" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-web" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-photography" + _"_Working with Digital Camera Photos" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-photography" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-fileformats" + _"Create, Open and Save _Files" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-fileformats" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-concepts-usage" + _"_Basic Concepts" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-concepts-usage" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-docks" + _"How to Use _Dialogs" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-docks" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-simpleobjects" + _"Drawing _Simple Objects" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-simpleobjects" + "<Image>/Help/User Manual") + + +(script-fu-register "gimp-help-using-selections" + _"Create and Use _Selections" + _"Bookmark to the user manual" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-help-using-simpleobjects" + "<Image>/Help/User Manual") + + +;; Links to GIMP related web sites + +(define (gimp-online-main-web-site) + (plug-in-web-browser "https://www.gimp.org/") +) + +(define (gimp-online-developer-web-site) + (plug-in-web-browser "https://developer.gimp.org/") +) + +(define (gimp-online-roadmap) + (plug-in-web-browser "https://wiki.gimp.org/wiki/Roadmap") +) + +(define (gimp-online-wiki) + (plug-in-web-browser "https://wiki.gimp.org/wiki/Main_Page") +) + +(define (gimp-online-bugs-features) + (plug-in-web-browser "https://gitlab.gnome.org/GNOME/gimp/issues") +) + +; (define (gimp-online-plug-in-web-site) +; (plug-in-web-browser "https://registry.gimp.org/") +; ) + + +(script-fu-register "gimp-online-main-web-site" + _"_Main Web Site" + _"Bookmark to the GIMP web site" + "Henrik Brix Andersen <brix@gimp.org>" + "Henrik Brix Andersen <brix@gimp.org>" + "2003" + "" +) + +(script-fu-menu-register "gimp-online-main-web-site" + "<Image>/Help/GIMP Online") + + +(script-fu-register "gimp-online-developer-web-site" + _"_Developer Web Site" + _"Bookmark to the GIMP web site" + "Henrik Brix Andersen <brix@gimp.org>" + "Henrik Brix Andersen <brix@gimp.org>" + "2003" + "" +) + +(script-fu-menu-register "gimp-online-developer-web-site" + "<Image>/Help/GIMP Online") + + +(script-fu-register "gimp-online-roadmap" + _"_Roadmap" + _"Bookmark to the roadmap of GIMP" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "2018" + "" +) + +(script-fu-menu-register "gimp-online-roadmap" + "<Image>/Help/GIMP Online") + + +(script-fu-register "gimp-online-wiki" + _"_Wiki" + _"Bookmark to the wiki of GIMP" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "2018" + "" +) + +(script-fu-menu-register "gimp-online-wiki" + "<Image>/Help/GIMP Online") + + +(script-fu-register "gimp-online-bugs-features" + _"_Bug Reports and Feature Requests" + _"Bookmark to the bug tracker of GIMP" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "Alexandre Prokoudine <alexandre.prokoudine@gmail.com>" + "2018" + "" +) + +(script-fu-menu-register "gimp-online-bugs-features" + "<Image>/Help") + + +(script-fu-register "gimp-online-docs-web-site" + _"_User Manual Web Site" + _"Bookmark to the GIMP web site" + "Roman Joost <romanofski@gimp.org>" + "Roman Joost <romanofski@gimp.org>" + "2006" + "" +) + +(script-fu-menu-register "gimp-online-docs-web-site" + "<Image>/Help/GIMP Online") + + +; (script-fu-register "gimp-online-plug-in-web-site" +; _"Plug-in _Registry" +; _"Bookmark to the GIMP web site" +; "Henrik Brix Andersen <brix@gimp.org>" +; "Henrik Brix Andersen <brix@gimp.org>" +; "2003" +; "" +; ) + +; (script-fu-menu-register "gimp-online-plug-in-web-site" +; "<Image>/Help/GIMP Online") diff --git a/plug-ins/script-fu/scripts/gradient-example.scm b/plug-ins/script-fu/scripts/gradient-example.scm new file mode 100644 index 0000000..3157c88 --- /dev/null +++ b/plug-ins/script-fu/scripts/gradient-example.scm @@ -0,0 +1,81 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Gradient example script --- create an example image of a custom gradient +; Copyright (C) 1997 Federico Mena Quintero +; federico@nuclecu.unam.mx +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +(define (script-fu-gradient-example width + height + gradient-reverse) + (let* ( + (img (car (gimp-image-new width height RGB))) + (drawable (car (gimp-layer-new img width height RGB + "Gradient example" 100 LAYER-MODE-NORMAL))) + + ; Calculate colors for checkerboard... just like in the gradient editor + + (fg-color (* 255 (/ 2 3))) + (bg-color (* 255 (/ 1 3))) + ) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + ; Render background checkerboard + + (gimp-context-push) + + (gimp-context-set-foreground (list fg-color fg-color fg-color)) + (gimp-context-set-background (list bg-color bg-color bg-color)) + (plug-in-checkerboard RUN-NONINTERACTIVE img drawable 0 8) + + (gimp-context-pop) + + ; Render gradient + + (gimp-context-push) + + (gimp-context-set-gradient-reverse gradient-reverse) + (gimp-drawable-edit-gradient-fill drawable + GRADIENT-LINEAR 0 + FALSE 0 0 + TRUE + 0 0 (- width 1) 0) + + (gimp-context-pop) + + ; Terminate + + (gimp-image-undo-enable img) + (gimp-display-new img) + ) +) + +(script-fu-register "script-fu-gradient-example" + _"Custom _Gradient..." + _"Create an image filled with an example of the current gradient" + "Federico Mena Quintero" + "Federico Mena Quintero" + "June 1997" + "" + SF-ADJUSTMENT _"Width" '(400 1 2000 1 10 0 1) + SF-ADJUSTMENT _"Height" '(30 1 2000 1 10 0 1) + SF-TOGGLE _"Gradient reverse" FALSE +) + +(script-fu-menu-register "script-fu-gradient-example" + "<Gradients>") diff --git a/plug-ins/script-fu/scripts/grid-system.scm b/plug-ins/script-fu/scripts/grid-system.scm new file mode 100644 index 0000000..6607a3e --- /dev/null +++ b/plug-ins/script-fu/scripts/grid-system.scm @@ -0,0 +1,95 @@ +;;; grid-system.scm -*-scheme-*- +;;; Time-stamp: <1998/01/20 23:22:02 narazaki@InetQ.or.jp> +;;; This file is a part of: +;;; GIMP (Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis) +;;; Author: Shuji Narazaki (narazaki@InetQ.or.jp) +;;; Version 0.6 + +;;; Code: +(if (not (symbol-bound? 'script-fu-grid-system-x-divides (current-environment))) + (define script-fu-grid-system-x-divides "'(1 g 1)")) +(if (not (symbol-bound? 'script-fu-grid-system-y-divides (current-environment))) + (define script-fu-grid-system-y-divides "'(1 g 1)")) + +(define (script-fu-grid-system img drw x-divides-orig y-divides-orig) + (define (update-segment! s x0 y0 x1 y1) + (aset s 0 x0) + (aset s 1 y0) + (aset s 2 x1) + (aset s 3 y1)) + (define (map proc seq) + (if (null? seq) + '() + (cons (proc (car seq)) + (map proc (cdr seq))))) + (define (convert-g l) + (cond ((null? l) '()) + ((eq? (car l) 'g) (cons 1.618 (convert-g (cdr l)))) + ((eq? (car l) '1/g) (cons 0.618 (convert-g (cdr l)))) + ('else (cons (car l) (convert-g (cdr l)))))) + (define (wrap-list l) + (define (wrap-object obj) + (cond ((number? obj) (string-append (number->string obj) " ")) + ((eq? obj 'g) "g ") + (eq? obj '1/g) "1/g ")) + (string-append "'(" (apply string-append (map wrap-object l)) ")")) + (let* ((drw-width (car (gimp-drawable-width drw))) + (drw-height (car (gimp-drawable-height drw))) + (drw-offset-x (nth 0 (gimp-drawable-offsets drw))) + (drw-offset-y (nth 1 (gimp-drawable-offsets drw))) + (grid-layer #f) + (segment (cons-array 4 'double)) + (stepped-x 0) + (stepped-y 0) + (temp 0) + (total-step-x 0) + (total-step-y 0) + (x-divides (convert-g x-divides-orig)) + (y-divides (convert-g y-divides-orig)) + (total-step-x (apply + x-divides)) + (total-step-y (apply + y-divides))) + + (gimp-image-undo-group-start img) + + (set! grid-layer (car (gimp-layer-copy drw TRUE))) + (gimp-image-insert-layer img grid-layer 0 0) + (gimp-drawable-edit-clear grid-layer) + (gimp-item-set-name grid-layer "Grid Layer") + + (while (not (null? (cdr x-divides))) + (set! stepped-x (+ stepped-x (car x-divides))) + (set! temp (* drw-width (/ stepped-x total-step-x))) + (set! x-divides (cdr x-divides)) + (update-segment! segment + (+ drw-offset-x temp) drw-offset-y + (+ drw-offset-x temp) (+ drw-offset-y drw-height)) + (gimp-pencil grid-layer 4 segment)) + + (while (not (null? (cdr y-divides))) + (set! stepped-y (+ stepped-y (car y-divides))) + (set! temp (* drw-height (/ stepped-y total-step-y))) + (set! y-divides (cdr y-divides)) + (update-segment! segment + drw-offset-x (+ drw-offset-y temp) + (+ drw-offset-x drw-width) (+ drw-offset-y temp)) + (gimp-pencil grid-layer 4 segment)) + + (gimp-image-undo-group-end img) + + (set! script-fu-grid-system-x-divides (wrap-list x-divides-orig)) + (set! script-fu-grid-system-y-divides (wrap-list y-divides-orig)) + (gimp-displays-flush))) + +(script-fu-register "script-fu-grid-system" + _"_Grid..." + _"Draw a grid as specified by the lists of X and Y locations using the current brush" + "Shuji Narazaki <narazaki@InetQ.or.jp>" + "Shuji Narazaki" + "1997" + "RGB*, INDEXED*, GRAY*" + SF-IMAGE "Image to use" 0 + SF-DRAWABLE "Drawable to draw grid" 0 + SF-VALUE _"X divisions" script-fu-grid-system-x-divides + SF-VALUE _"Y divisions" script-fu-grid-system-y-divides +) + diff --git a/plug-ins/script-fu/scripts/guides-from-selection.scm b/plug-ins/script-fu/scripts/guides-from-selection.scm new file mode 100644 index 0000000..b790c86 --- /dev/null +++ b/plug-ins/script-fu/scripts/guides-from-selection.scm @@ -0,0 +1,43 @@ +;; -*-scheme-*- + +(define (script-fu-guides-from-selection image drawable) + (let* ( + (boundaries (gimp-selection-bounds image)) + ;; non-empty INT32 TRUE if there is a selection + (selection (car boundaries)) + (x1 (cadr boundaries)) + (y1 (caddr boundaries)) + (x2 (cadr (cddr boundaries))) + (y2 (caddr (cddr boundaries))) + ) + + ;; need to check for a selection or we get guides right at edges of the image + (if (= selection TRUE) + (begin + (gimp-image-undo-group-start image) + + (gimp-image-add-vguide image x1) + (gimp-image-add-hguide image y1) + (gimp-image-add-vguide image x2) + (gimp-image-add-hguide image y2) + + (gimp-image-undo-group-end image) + (gimp-displays-flush) + ) + ) + ) +) + +(script-fu-register "script-fu-guides-from-selection" + _"New Guides from _Selection" + _"Create four guides around the bounding box of the current selection" + "Alan Horkan" + "Alan Horkan, 2004. Public Domain." + "2004-08-13" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 +) + +(script-fu-menu-register "script-fu-guides-from-selection" + "<Image>/Image/Guides") diff --git a/plug-ins/script-fu/scripts/guides-new-percent.scm b/plug-ins/script-fu/scripts/guides-new-percent.scm new file mode 100644 index 0000000..c42d457 --- /dev/null +++ b/plug-ins/script-fu/scripts/guides-new-percent.scm @@ -0,0 +1,41 @@ +;; -*-scheme-*- + +;; Alan Horkan 2004. No copyright. Public Domain. + +(define (script-fu-guide-new-percent image drawable direction position) + (let* ( + (width (car (gimp-image-width image))) + (height (car (gimp-image-height image))) + ) + + (if (= direction 0) + (set! position (/ (* height position) 100)) + (set! position (/ (* width position) 100)) + ) + + (if (= direction 0) + ;; convert position to pixel + (if (<= position height) (gimp-image-add-hguide image position)) + (if (<= position width) (gimp-image-add-vguide image position)) + ) + + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-guide-new-percent" + _"New Guide (by _Percent)..." + _"Add a guide at the position specified as a percentage of the image size" + "Alan Horkan" + "Alan Horkan, 2004" + "April 2004" + "*" + SF-IMAGE "Input Image" 0 + SF-DRAWABLE "Input Drawable" 0 + SF-OPTION _"_Direction" '(_"Horizontal" + _"Vertical") + SF-ADJUSTMENT _"_Position (in %)" '(50 0 100 1 10 2 1) +) + +(script-fu-menu-register "script-fu-guide-new-percent" + "<Image>/Image/Guides") diff --git a/plug-ins/script-fu/scripts/guides-new.scm b/plug-ins/script-fu/scripts/guides-new.scm new file mode 100644 index 0000000..08217af --- /dev/null +++ b/plug-ins/script-fu/scripts/guides-new.scm @@ -0,0 +1,40 @@ +;; -*-scheme-*- + +;; Alan Horkan 2004. Public Domain. +;; so long as remove this block of comments from your script +;; feel free to use it for whatever you like. + +(define (script-fu-guide-new image + drawable + direction + position) + (let* ( + (width (car (gimp-image-width image))) + (height (car (gimp-image-height image))) + ) + + (if (= direction 0) + ;; check position is inside the image boundaries + (if (<= position height) (gimp-image-add-hguide image position)) + (if (<= position width) (gimp-image-add-vguide image position)) + ) + + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-guide-new" + _"New _Guide..." + _"Add a guide at the orientation and position specified (in pixels)" + "Alan Horkan" + "Alan Horkan, 2004. Public Domain." + "2004-04-02" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-OPTION _"_Direction" '(_"Horizontal" _"Vertical") + SF-ADJUSTMENT _"_Position" (list 0 0 MAX-IMAGE-SIZE 1 10 0 1) +) + +(script-fu-menu-register "script-fu-guide-new" + "<Image>/Image/Guides") diff --git a/plug-ins/script-fu/scripts/guides-remove-all.scm b/plug-ins/script-fu/scripts/guides-remove-all.scm new file mode 100644 index 0000000..61cc3ed --- /dev/null +++ b/plug-ins/script-fu/scripts/guides-remove-all.scm @@ -0,0 +1,30 @@ +;; -*-scheme-*- + +(define (script-fu-guides-remove image drawable) + (let* ((guide-id 0)) + (gimp-image-undo-group-start image) + + (set! guide-id (car (gimp-image-find-next-guide image 0))) + (while (> guide-id 0) + (gimp-image-delete-guide image guide-id) + (set! guide-id (car (gimp-image-find-next-guide image 0))) + ) + + (gimp-image-undo-group-end image) + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-guides-remove" + _"_Remove all Guides" + _"Remove all horizontal and vertical guides" + "Alan Horkan" + "Alan Horkan, 2004. Public Domain." + "April 2004" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 +) + +(script-fu-menu-register "script-fu-guides-remove" + "<Image>/Image/Guides") diff --git a/plug-ins/script-fu/scripts/images/Makefile.am b/plug-ins/script-fu/scripts/images/Makefile.am new file mode 100644 index 0000000..5457226 --- /dev/null +++ b/plug-ins/script-fu/scripts/images/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to produce Makefile.in + +imagesdatadir = $(gimpdatadir)/scripts/images + +imagesdata_DATA = \ + beavis.jpg \ + texture.jpg \ + texture1.jpg \ + texture2.jpg \ + texture3.jpg + +EXTRA_DIST = $(imagesdata_DATA) diff --git a/plug-ins/script-fu/scripts/images/Makefile.in b/plug-ins/script-fu/scripts/images/Makefile.in new file mode 100644 index 0000000..1762864 --- /dev/null +++ b/plug-ins/script-fu/scripts/images/Makefile.in @@ -0,0 +1,809 @@ +# Makefile.in generated by automake 1.16.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2020 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = plug-ins/script-fu/scripts/images +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4macros/gtk-doc.m4 \ + $(top_srcdir)/m4macros/intltool.m4 \ + $(top_srcdir)/m4macros/libtool.m4 \ + $(top_srcdir)/m4macros/ltoptions.m4 \ + $(top_srcdir)/m4macros/ltsugar.m4 \ + $(top_srcdir)/m4macros/ltversion.m4 \ + $(top_srcdir)/m4macros/lt~obsolete.m4 \ + $(top_srcdir)/acinclude.m4 $(top_srcdir)/m4macros/alsa.m4 \ + $(top_srcdir)/m4macros/ax_compare_version.m4 \ + $(top_srcdir)/m4macros/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4macros/ax_gcc_func_attribute.m4 \ + $(top_srcdir)/m4macros/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4macros/ax_prog_perl_version.m4 \ + $(top_srcdir)/m4macros/detectcflags.m4 \ + $(top_srcdir)/m4macros/pythondev.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(imagesdatadir)" +DATA = $(imagesdata_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +AA_LIBS = @AA_LIBS@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALL_LINGUAS = @ALL_LINGUAS@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +ALTIVEC_EXTRA_CFLAGS = @ALTIVEC_EXTRA_CFLAGS@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APPSTREAM_UTIL = @APPSTREAM_UTIL@ +AR = @AR@ +AS = @AS@ +ATK_CFLAGS = @ATK_CFLAGS@ +ATK_LIBS = @ATK_LIBS@ +ATK_REQUIRED_VERSION = @ATK_REQUIRED_VERSION@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BABL_CFLAGS = @BABL_CFLAGS@ +BABL_LIBS = @BABL_LIBS@ +BABL_REQUIRED_VERSION = @BABL_REQUIRED_VERSION@ +BUG_REPORT_URL = @BUG_REPORT_URL@ +BUILD_EXEEXT = @BUILD_EXEEXT@ +BUILD_OBJEXT = @BUILD_OBJEXT@ +BZIP2_LIBS = @BZIP2_LIBS@ +CAIRO_CFLAGS = @CAIRO_CFLAGS@ +CAIRO_LIBS = @CAIRO_LIBS@ +CAIRO_PDF_CFLAGS = @CAIRO_PDF_CFLAGS@ +CAIRO_PDF_LIBS = @CAIRO_PDF_LIBS@ +CAIRO_PDF_REQUIRED_VERSION = @CAIRO_PDF_REQUIRED_VERSION@ +CAIRO_REQUIRED_VERSION = @CAIRO_REQUIRED_VERSION@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCAS = @CCAS@ +CCASDEPMODE = @CCASDEPMODE@ +CCASFLAGS = @CCASFLAGS@ +CCDEPMODE = @CCDEPMODE@ +CC_FOR_BUILD = @CC_FOR_BUILD@ +CC_VERSION = @CC_VERSION@ +CFLAGS = @CFLAGS@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ +CPP_FOR_BUILD = @CPP_FOR_BUILD@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DESKTOP_DATADIR = @DESKTOP_DATADIR@ +DESKTOP_FILE_VALIDATE = @DESKTOP_FILE_VALIDATE@ +DLLTOOL = @DLLTOOL@ +DOC_SHOOTER = @DOC_SHOOTER@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_AA = @FILE_AA@ +FILE_EXR = @FILE_EXR@ +FILE_HEIF = @FILE_HEIF@ +FILE_JP2_LOAD = @FILE_JP2_LOAD@ +FILE_MNG = @FILE_MNG@ +FILE_PDF_SAVE = @FILE_PDF_SAVE@ +FILE_PS = @FILE_PS@ +FILE_WMF = @FILE_WMF@ +FILE_XMC = @FILE_XMC@ +FILE_XPM = @FILE_XPM@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FONTCONFIG_REQUIRED_VERSION = @FONTCONFIG_REQUIRED_VERSION@ +FREETYPE2_REQUIRED_VERSION = @FREETYPE2_REQUIRED_VERSION@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +GDBUS_CODEGEN = @GDBUS_CODEGEN@ +GDK_PIXBUF_CFLAGS = @GDK_PIXBUF_CFLAGS@ +GDK_PIXBUF_CSOURCE = @GDK_PIXBUF_CSOURCE@ +GDK_PIXBUF_LIBS = @GDK_PIXBUF_LIBS@ +GDK_PIXBUF_REQUIRED_VERSION = @GDK_PIXBUF_REQUIRED_VERSION@ +GEGL = @GEGL@ +GEGL_CFLAGS = @GEGL_CFLAGS@ +GEGL_LIBS = @GEGL_LIBS@ +GEGL_MAJOR_MINOR_VERSION = @GEGL_MAJOR_MINOR_VERSION@ +GEGL_REQUIRED_VERSION = @GEGL_REQUIRED_VERSION@ +GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ +GEXIV2_CFLAGS = @GEXIV2_CFLAGS@ +GEXIV2_LIBS = @GEXIV2_LIBS@ +GEXIV2_REQUIRED_VERSION = @GEXIV2_REQUIRED_VERSION@ +GIMP_API_VERSION = @GIMP_API_VERSION@ +GIMP_APP_VERSION = @GIMP_APP_VERSION@ +GIMP_BINARY_AGE = @GIMP_BINARY_AGE@ +GIMP_COMMAND = @GIMP_COMMAND@ +GIMP_DATA_VERSION = @GIMP_DATA_VERSION@ +GIMP_FULL_NAME = @GIMP_FULL_NAME@ +GIMP_INTERFACE_AGE = @GIMP_INTERFACE_AGE@ +GIMP_MAJOR_VERSION = @GIMP_MAJOR_VERSION@ +GIMP_MICRO_VERSION = @GIMP_MICRO_VERSION@ +GIMP_MINOR_VERSION = @GIMP_MINOR_VERSION@ +GIMP_MKENUMS = @GIMP_MKENUMS@ +GIMP_MODULES = @GIMP_MODULES@ +GIMP_PACKAGE_REVISION = @GIMP_PACKAGE_REVISION@ +GIMP_PKGCONFIG_VERSION = @GIMP_PKGCONFIG_VERSION@ +GIMP_PLUGINS = @GIMP_PLUGINS@ +GIMP_PLUGIN_VERSION = @GIMP_PLUGIN_VERSION@ +GIMP_REAL_VERSION = @GIMP_REAL_VERSION@ +GIMP_SYSCONF_VERSION = @GIMP_SYSCONF_VERSION@ +GIMP_TOOL_VERSION = @GIMP_TOOL_VERSION@ +GIMP_UNSTABLE = @GIMP_UNSTABLE@ +GIMP_USER_VERSION = @GIMP_USER_VERSION@ +GIMP_VERSION = @GIMP_VERSION@ +GIO_CFLAGS = @GIO_CFLAGS@ +GIO_LIBS = @GIO_LIBS@ +GIO_UNIX_CFLAGS = @GIO_UNIX_CFLAGS@ +GIO_UNIX_LIBS = @GIO_UNIX_LIBS@ +GIO_WINDOWS_CFLAGS = @GIO_WINDOWS_CFLAGS@ +GIO_WINDOWS_LIBS = @GIO_WINDOWS_LIBS@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@ +GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ +GLIB_LIBS = @GLIB_LIBS@ +GLIB_MKENUMS = @GLIB_MKENUMS@ +GLIB_REQUIRED_VERSION = @GLIB_REQUIRED_VERSION@ +GMODULE_NO_EXPORT_CFLAGS = @GMODULE_NO_EXPORT_CFLAGS@ +GMODULE_NO_EXPORT_LIBS = @GMODULE_NO_EXPORT_LIBS@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GOBJECT_QUERY = @GOBJECT_QUERY@ +GREP = @GREP@ +GS_LIBS = @GS_LIBS@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GTK_MAC_INTEGRATION_CFLAGS = @GTK_MAC_INTEGRATION_CFLAGS@ +GTK_MAC_INTEGRATION_LIBS = @GTK_MAC_INTEGRATION_LIBS@ +GTK_REQUIRED_VERSION = @GTK_REQUIRED_VERSION@ +GTK_UPDATE_ICON_CACHE = @GTK_UPDATE_ICON_CACHE@ +GUDEV_CFLAGS = @GUDEV_CFLAGS@ +GUDEV_LIBS = @GUDEV_LIBS@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +HARFBUZZ_REQUIRED_VERSION = @HARFBUZZ_REQUIRED_VERSION@ +HAVE_CXX14 = @HAVE_CXX14@ +HAVE_FINITE = @HAVE_FINITE@ +HAVE_ISFINITE = @HAVE_ISFINITE@ +HAVE_VFORK = @HAVE_VFORK@ +HOST_GLIB_COMPILE_RESOURCES = @HOST_GLIB_COMPILE_RESOURCES@ +HTML_DIR = @HTML_DIR@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLLIBS = @INTLLIBS@ +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ +INTLTOOL_MERGE = @INTLTOOL_MERGE@ +INTLTOOL_PERL = @INTLTOOL_PERL@ +INTLTOOL_REQUIRED_VERSION = @INTLTOOL_REQUIRED_VERSION@ +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ +INTLTOOL_V_MERGE = @INTLTOOL_V_MERGE@ +INTLTOOL_V_MERGE_OPTIONS = @INTLTOOL_V_MERGE_OPTIONS@ +INTLTOOL__v_MERGE_ = @INTLTOOL__v_MERGE_@ +INTLTOOL__v_MERGE_0 = @INTLTOOL__v_MERGE_0@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +ISO_CODES_LOCALEDIR = @ISO_CODES_LOCALEDIR@ +ISO_CODES_LOCATION = @ISO_CODES_LOCATION@ +JPEG_LIBS = @JPEG_LIBS@ +JSON_GLIB_CFLAGS = @JSON_GLIB_CFLAGS@ +JSON_GLIB_LIBS = @JSON_GLIB_LIBS@ +LCMS_CFLAGS = @LCMS_CFLAGS@ +LCMS_LIBS = @LCMS_LIBS@ +LCMS_REQUIRED_VERSION = @LCMS_REQUIRED_VERSION@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ +LIBBACKTRACE_LIBS = @LIBBACKTRACE_LIBS@ +LIBHEIF_CFLAGS = @LIBHEIF_CFLAGS@ +LIBHEIF_LIBS = @LIBHEIF_LIBS@ +LIBHEIF_REQUIRED_VERSION = @LIBHEIF_REQUIRED_VERSION@ +LIBLZMA_REQUIRED_VERSION = @LIBLZMA_REQUIRED_VERSION@ +LIBMYPAINT_CFLAGS = @LIBMYPAINT_CFLAGS@ +LIBMYPAINT_LIBS = @LIBMYPAINT_LIBS@ +LIBMYPAINT_REQUIRED_VERSION = @LIBMYPAINT_REQUIRED_VERSION@ +LIBOBJS = @LIBOBJS@ +LIBPNG_REQUIRED_VERSION = @LIBPNG_REQUIRED_VERSION@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBUNWIND_CFLAGS = @LIBUNWIND_CFLAGS@ +LIBUNWIND_LIBS = @LIBUNWIND_LIBS@ +LIBUNWIND_REQUIRED_VERSION = @LIBUNWIND_REQUIRED_VERSION@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_CURRENT_MINUS_AGE = @LT_CURRENT_MINUS_AGE@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +LT_VERSION_INFO = @LT_VERSION_INFO@ +LZMA_CFLAGS = @LZMA_CFLAGS@ +LZMA_LIBS = @LZMA_LIBS@ +MAIL = @MAIL@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MIME_INFO_CFLAGS = @MIME_INFO_CFLAGS@ +MIME_INFO_LIBS = @MIME_INFO_LIBS@ +MIME_TYPES = @MIME_TYPES@ +MKDIR_P = @MKDIR_P@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MMX_EXTRA_CFLAGS = @MMX_EXTRA_CFLAGS@ +MNG_CFLAGS = @MNG_CFLAGS@ +MNG_LIBS = @MNG_LIBS@ +MSGFMT = @MSGFMT@ +MSGFMT_OPTS = @MSGFMT_OPTS@ +MSGMERGE = @MSGMERGE@ +MYPAINT_BRUSHES_CFLAGS = @MYPAINT_BRUSHES_CFLAGS@ +MYPAINT_BRUSHES_LIBS = @MYPAINT_BRUSHES_LIBS@ +NATIVE_GLIB_CFLAGS = @NATIVE_GLIB_CFLAGS@ +NATIVE_GLIB_LIBS = @NATIVE_GLIB_LIBS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ +OPENEXR_LIBS = @OPENEXR_LIBS@ +OPENEXR_REQUIRED_VERSION = @OPENEXR_REQUIRED_VERSION@ +OPENJPEG_CFLAGS = @OPENJPEG_CFLAGS@ +OPENJPEG_LIBS = @OPENJPEG_LIBS@ +OPENJPEG_REQUIRED_VERSION = @OPENJPEG_REQUIRED_VERSION@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PANGOCAIRO_CFLAGS = @PANGOCAIRO_CFLAGS@ +PANGOCAIRO_LIBS = @PANGOCAIRO_LIBS@ +PANGOCAIRO_REQUIRED_VERSION = @PANGOCAIRO_REQUIRED_VERSION@ +PATHSEP = @PATHSEP@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PERL_REQUIRED_VERSION = @PERL_REQUIRED_VERSION@ +PERL_VERSION = @PERL_VERSION@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +POFILES = @POFILES@ +POPPLER_CFLAGS = @POPPLER_CFLAGS@ +POPPLER_DATA_CFLAGS = @POPPLER_DATA_CFLAGS@ +POPPLER_DATA_LIBS = @POPPLER_DATA_LIBS@ +POPPLER_DATA_REQUIRED_VERSION = @POPPLER_DATA_REQUIRED_VERSION@ +POPPLER_LIBS = @POPPLER_LIBS@ +POPPLER_REQUIRED_VERSION = @POPPLER_REQUIRED_VERSION@ +POSUB = @POSUB@ +PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ +PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@ +PYBIN_PATH = @PYBIN_PATH@ +PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ +PYCAIRO_LIBS = @PYCAIRO_LIBS@ +PYGIMP_EXTRA_CFLAGS = @PYGIMP_EXTRA_CFLAGS@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_CODEGEN = @PYGTK_CODEGEN@ +PYGTK_DEFSDIR = @PYGTK_DEFSDIR@ +PYGTK_LIBS = @PYGTK_LIBS@ +PYLINK_LIBS = @PYLINK_LIBS@ +PYTHON = @PYTHON@ +PYTHON2_REQUIRED_VERSION = @PYTHON2_REQUIRED_VERSION@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +RANLIB = @RANLIB@ +RSVG_REQUIRED_VERSION = @RSVG_REQUIRED_VERSION@ +RT_LIBS = @RT_LIBS@ +SCREENSHOT_LIBS = @SCREENSHOT_LIBS@ +SED = @SED@ +SENDMAIL = @SENDMAIL@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +SSE2_EXTRA_CFLAGS = @SSE2_EXTRA_CFLAGS@ +SSE4_1_EXTRA_CFLAGS = @SSE4_1_EXTRA_CFLAGS@ +SSE_EXTRA_CFLAGS = @SSE_EXTRA_CFLAGS@ +STRIP = @STRIP@ +SVG_CFLAGS = @SVG_CFLAGS@ +SVG_LIBS = @SVG_LIBS@ +SYMPREFIX = @SYMPREFIX@ +TIFF_LIBS = @TIFF_LIBS@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WEBKIT_CFLAGS = @WEBKIT_CFLAGS@ +WEBKIT_LIBS = @WEBKIT_LIBS@ +WEBKIT_REQUIRED_VERSION = @WEBKIT_REQUIRED_VERSION@ +WEBPDEMUX_CFLAGS = @WEBPDEMUX_CFLAGS@ +WEBPDEMUX_LIBS = @WEBPDEMUX_LIBS@ +WEBPMUX_CFLAGS = @WEBPMUX_CFLAGS@ +WEBPMUX_LIBS = @WEBPMUX_LIBS@ +WEBP_CFLAGS = @WEBP_CFLAGS@ +WEBP_LIBS = @WEBP_LIBS@ +WEBP_REQUIRED_VERSION = @WEBP_REQUIRED_VERSION@ +WEB_PAGE = @WEB_PAGE@ +WIN32_LARGE_ADDRESS_AWARE = @WIN32_LARGE_ADDRESS_AWARE@ +WINDRES = @WINDRES@ +WMF_CFLAGS = @WMF_CFLAGS@ +WMF_CONFIG = @WMF_CONFIG@ +WMF_LIBS = @WMF_LIBS@ +WMF_REQUIRED_VERSION = @WMF_REQUIRED_VERSION@ +XDG_EMAIL = @XDG_EMAIL@ +XFIXES_CFLAGS = @XFIXES_CFLAGS@ +XFIXES_LIBS = @XFIXES_LIBS@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_REQUIRED_VERSION = @XGETTEXT_REQUIRED_VERSION@ +XMC_CFLAGS = @XMC_CFLAGS@ +XMC_LIBS = @XMC_LIBS@ +XMKMF = @XMKMF@ +XMLLINT = @XMLLINT@ +XMU_LIBS = @XMU_LIBS@ +XPM_LIBS = @XPM_LIBS@ +XSLTPROC = @XSLTPROC@ +XVFB_RUN = @XVFB_RUN@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +Z_LIBS = @Z_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CC_FOR_BUILD = @ac_ct_CC_FOR_BUILD@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +gimpdatadir = @gimpdatadir@ +gimpdir = @gimpdir@ +gimplocaledir = @gimplocaledir@ +gimpplugindir = @gimpplugindir@ +gimpsysconfdir = @gimpsysconfdir@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +intltool__v_merge_options_ = @intltool__v_merge_options_@ +intltool__v_merge_options_0 = @intltool__v_merge_options_0@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +manpage_gimpdir = @manpage_gimpdir@ +mkdir_p = @mkdir_p@ +ms_librarian = @ms_librarian@ +mypaint_brushes_dir = @mypaint_brushes_dir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +imagesdatadir = $(gimpdatadir)/scripts/images +imagesdata_DATA = \ + beavis.jpg \ + texture.jpg \ + texture1.jpg \ + texture2.jpg \ + texture3.jpg + +EXTRA_DIST = $(imagesdata_DATA) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plug-ins/script-fu/scripts/images/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu plug-ins/script-fu/scripts/images/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-imagesdataDATA: $(imagesdata_DATA) + @$(NORMAL_INSTALL) + @list='$(imagesdata_DATA)'; test -n "$(imagesdatadir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(imagesdatadir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(imagesdatadir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(imagesdatadir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(imagesdatadir)" || exit $$?; \ + done + +uninstall-imagesdataDATA: + @$(NORMAL_UNINSTALL) + @list='$(imagesdata_DATA)'; test -n "$(imagesdatadir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(imagesdatadir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(imagesdatadir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-imagesdataDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-imagesdataDATA + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-imagesdataDATA install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-imagesdataDATA + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/plug-ins/script-fu/scripts/images/beavis.jpg b/plug-ins/script-fu/scripts/images/beavis.jpg Binary files differnew file mode 100644 index 0000000..d555047 --- /dev/null +++ b/plug-ins/script-fu/scripts/images/beavis.jpg diff --git a/plug-ins/script-fu/scripts/images/texture.jpg b/plug-ins/script-fu/scripts/images/texture.jpg Binary files differnew file mode 100644 index 0000000..8890c7f --- /dev/null +++ b/plug-ins/script-fu/scripts/images/texture.jpg diff --git a/plug-ins/script-fu/scripts/images/texture1.jpg b/plug-ins/script-fu/scripts/images/texture1.jpg Binary files differnew file mode 100644 index 0000000..8bb8acd --- /dev/null +++ b/plug-ins/script-fu/scripts/images/texture1.jpg diff --git a/plug-ins/script-fu/scripts/images/texture2.jpg b/plug-ins/script-fu/scripts/images/texture2.jpg Binary files differnew file mode 100644 index 0000000..6b5d2ef --- /dev/null +++ b/plug-ins/script-fu/scripts/images/texture2.jpg diff --git a/plug-ins/script-fu/scripts/images/texture3.jpg b/plug-ins/script-fu/scripts/images/texture3.jpg Binary files differnew file mode 100644 index 0000000..34d0988 --- /dev/null +++ b/plug-ins/script-fu/scripts/images/texture3.jpg diff --git a/plug-ins/script-fu/scripts/lava.scm b/plug-ins/script-fu/scripts/lava.scm new file mode 100644 index 0000000..8adec0d --- /dev/null +++ b/plug-ins/script-fu/scripts/lava.scm @@ -0,0 +1,135 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Lava effect +; Copyright (c) 1997 Adrian Likins +; aklikins@eos.ncsu.edu +; +; based on a idea by Sven Riedel <lynx@heim8.tu-clausthal.de> +; tweaked a bit by Sven Neumann <neumanns@uni-duesseldorf.de> +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-lava image + drawable + seed + tile_size + mask_size + gradient + keep-selection + separate-layer + current-grad) + (let* ( + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (active-selection 0) + (selection-bounds 0) + (select-offset-x 0) + (select-offset-y 0) + (select-width 0) + (select-height 0) + (lava-layer 0) + (active-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + (gimp-image-undo-group-start image) + + (if (= (car (gimp-drawable-has-alpha drawable)) FALSE) + (gimp-layer-add-alpha drawable) + ) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + ) + + (set! active-selection (car (gimp-selection-save image))) + (gimp-image-set-active-layer image drawable) + + (set! selection-bounds (gimp-selection-bounds image)) + (set! select-offset-x (cadr selection-bounds)) + (set! select-offset-y (caddr selection-bounds)) + (set! select-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (set! select-height (- (caddr (cddr selection-bounds)) select-offset-y)) + + (if (= separate-layer TRUE) + (begin + (set! lava-layer (car (gimp-layer-new image + select-width + select-height + type + "Lava Layer" + 100 + LAYER-MODE-NORMAL-LEGACY))) + + (gimp-image-insert-layer image lava-layer 0 -1) + (gimp-layer-set-offsets lava-layer select-offset-x select-offset-y) + (gimp-selection-none image) + (gimp-drawable-edit-clear lava-layer) + + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (gimp-image-set-active-layer image lava-layer) + ) + ) + + (set! active-layer (car (gimp-image-get-active-layer image))) + + (if (= current-grad FALSE) + (gimp-context-set-gradient gradient) + ) + + (plug-in-solid-noise RUN-NONINTERACTIVE image active-layer FALSE TRUE seed 2 2 2) + (plug-in-cubism RUN-NONINTERACTIVE image active-layer tile_size 2.5 0) + (plug-in-oilify RUN-NONINTERACTIVE image active-layer mask_size 0) + (plug-in-edge RUN-NONINTERACTIVE image active-layer 2 0 0) + (plug-in-gauss-rle RUN-NONINTERACTIVE image active-layer 2 TRUE TRUE) + (plug-in-gradmap RUN-NONINTERACTIVE image active-layer) + + (if (= keep-selection FALSE) + (gimp-selection-none image) + ) + + (gimp-image-set-active-layer image drawable) + (gimp-image-remove-channel image active-selection) + + (gimp-image-undo-group-end image) + (gimp-context-pop) + + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-lava" + _"_Lava..." + _"Fill the current selection with lava" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "10/12/97" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Seed" '(10 1 30000 1 10 0 1) + SF-ADJUSTMENT _"Size" '(10 0 100 1 10 0 1) + SF-ADJUSTMENT _"Roughness" '(7 3 50 1 10 0 0) + SF-GRADIENT _"Gradient" "German flag smooth" + SF-TOGGLE _"Keep selection" TRUE + SF-TOGGLE _"Separate layer" TRUE + SF-TOGGLE _"Use current gradient" FALSE +) + +(script-fu-menu-register "script-fu-lava" + "<Image>/Filters/Render") diff --git a/plug-ins/script-fu/scripts/line-nova.scm b/plug-ins/script-fu/scripts/line-nova.scm new file mode 100644 index 0000000..8c5c35b --- /dev/null +++ b/plug-ins/script-fu/scripts/line-nova.scm @@ -0,0 +1,123 @@ +;;; line-nova.scm for gimp-1.1 -*-scheme-*- +;;; Time-stamp: <1998/11/25 13:26:44 narazaki@gimp.org> +;;; Author Shuji Narazaki <narazaki@gimp.org> +;;; Version 0.7 + +(define (script-fu-line-nova img drw num-of-lines corn-deg offset variation) + (let* ( + (*points* (cons-array (* 3 2) 'double)) + (modulo fmod) ; in R4RS way + (pi/2 (/ *pi* 2)) + (pi/4 (/ *pi* 4)) + (pi3/4 (* 3 pi/4)) + (pi5/4 (* 5 pi/4)) + (pi3/2 (* 3 pi/2)) + (pi7/4 (* 7 pi/4)) + (2pi (* 2 *pi*)) + (rad/deg (/ 2pi 360)) + (variation/2 (/ variation 2)) + (drw-width (car (gimp-drawable-width drw))) + (drw-height (car (gimp-drawable-height drw))) + (drw-offsets (gimp-drawable-offsets drw)) + (old-selection FALSE) + (radius (max drw-height drw-width)) + (index 0) + (dir-deg/line (/ 360 num-of-lines)) + (fg-color (car (gimp-context-get-foreground))) + ) + (gimp-context-push) + (gimp-context-set-defaults) + (gimp-context-set-foreground fg-color) + + (define (draw-vector beg-x beg-y direction) + + (define (set-point! index x y) + (aset *points* (* 2 index) x) + (aset *points* (+ (* 2 index) 1) y) + ) + (define (deg->rad rad) + (* (modulo rad 360) rad/deg) + ) + (define (set-marginal-point beg-x beg-y direction) + (let ( + (dir1 (deg->rad (+ direction corn-deg))) + (dir2 (deg->rad (- direction corn-deg))) + ) + + (define (aux dir index) + (set-point! index + (+ beg-x (* (cos dir) radius)) + (+ beg-y (* (sin dir) radius))) + ) + + (aux dir1 1) + (aux dir2 2) + ) + ) + + (let ( + (dir0 (deg->rad direction)) + (off (+ offset (- (modulo (rand) variation) variation/2))) + ) + + (set-point! 0 + (+ beg-x (* off (cos dir0))) + (+ beg-y (* off (sin dir0))) + ) + (set-marginal-point beg-x beg-y direction) + (gimp-image-select-polygon img CHANNEL-OP-ADD 6 *points*) + ) + ) + + (gimp-image-undo-group-start img) + + (set! old-selection + (if (eq? (car (gimp-selection-is-empty img)) TRUE) + #f + (car (gimp-selection-save img)) + ) + ) + + (gimp-selection-none img) + (srand (realtime)) + (while (< index num-of-lines) + (draw-vector (+ (nth 0 drw-offsets) (/ drw-width 2)) + (+ (nth 1 drw-offsets) (/ drw-height 2)) + (* index dir-deg/line) + ) + (set! index (+ index 1)) + ) + (gimp-drawable-edit-fill drw FILL-FOREGROUND) + + (if old-selection + (begin + (gimp-image-select-item img CHANNEL-OP-REPLACE old-selection) + ;; (gimp-image-set-active-layer img drw) + ;; delete extra channel by Sven Neumann <neumanns@uni-duesseldorf.de> + (gimp-image-remove-channel img old-selection) + ) + ) + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-line-nova" + _"Line _Nova..." + _"Fill a layer with rays emanating outward from its center using the foreground color" + "Shuji Narazaki <narazaki@gimp.org>" + "Shuji Narazaki" + "1997,1998" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Number of lines" '(200 40 1000 1 1 0 1) + SF-ADJUSTMENT _"Sharpness (degrees)" '(1.0 0.0 10.0 0.1 1 1 1) + SF-ADJUSTMENT _"Offset radius" '(100 0 2000 1 1 0 1) + SF-ADJUSTMENT _"Randomness" '(30 1 2000 1 1 0 1) +) + +(script-fu-menu-register "script-fu-line-nova" + "<Image>/Filters/Render") diff --git a/plug-ins/script-fu/scripts/mkbrush.scm b/plug-ins/script-fu/scripts/mkbrush.scm new file mode 100644 index 0000000..7a316a4 --- /dev/null +++ b/plug-ins/script-fu/scripts/mkbrush.scm @@ -0,0 +1,272 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Make-Brush - a script for the script-fu program +; by Seth Burgess 1997 <sjburges@ou.edu> +; +; 18-Dec-2000 fixed to work with the new convention (not inverted) of +; gbr saver (jtl@gimp.org) +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-make-brush-rectangular name width height spacing) + (let* ( + (img (car (gimp-image-new width height GRAY))) + (drawable (car (gimp-layer-new img + width height GRAY-IMAGE + "MakeBrush" 100 LAYER-MODE-NORMAL))) + (filename (string-append gimp-directory + "/brushes/r" + (number->string width) + "x" + (number->string height) + ".gbr")) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-fill drawable FILL-BACKGROUND) + + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE 0 0 width height) + + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + (file-gbr-save 1 img drawable filename "" spacing name) + (gimp-image-delete img) + + (gimp-context-pop) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) +) + +(script-fu-register "script-fu-make-brush-rectangular" + _"_Rectangular..." + _"Create a rectangular brush" + "Seth Burgess <sjburges@ou.edu>" + "Seth Burgess" + "1997" + "" + SF-STRING _"Name" "Rectangle" + SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0) +) + +(script-fu-menu-register "script-fu-make-brush-rectangular" + "<Brushes>") + + +(define (script-fu-make-brush-rectangular-feathered name width height + feathering spacing) + (let* ( + (widthplus (+ width feathering)) + (heightplus (+ height feathering)) + (img (car (gimp-image-new widthplus heightplus GRAY))) + (drawable (car (gimp-layer-new img + widthplus heightplus GRAY-IMAGE + "MakeBrush" 100 LAYER-MODE-NORMAL))) + (filename (string-append gimp-directory + "/brushes/r" + (number->string width) + "x" + (number->string height) + "f" + (number->string feathering) + ".gbr")) + ) + + (gimp-context-push) + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-fill drawable FILL-BACKGROUND) + + (cond + ((< 0 feathering) + (gimp-context-set-feather TRUE) + (gimp-context-set-feather-radius feathering feathering) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE + (/ feathering 2) (/ feathering 2) width height)) + ((>= 0 feathering) + (gimp-context-set-feather FALSE) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE 0 0 width height)) + ) + + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + (file-gbr-save 1 img drawable filename "" spacing name) + (gimp-image-delete img) + + (gimp-context-pop) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) +) + +(script-fu-register "script-fu-make-brush-rectangular-feathered" + _"Re_ctangular, Feathered..." + _"Create a rectangular brush with feathered edges" + "Seth Burgess <sjburges@ou.edu>" + "Seth Burgess" + "1997" + "" + SF-STRING _"Name" "Rectangle" + SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Feathering" '(4 1 100 1 10 0 1) + SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0) +) + +(script-fu-menu-register "script-fu-make-brush-rectangular-feathered" + "<Brushes>") + + +(define (script-fu-make-brush-elliptical name width height spacing) + (let* ( + (img (car (gimp-image-new width height GRAY))) + (drawable (car (gimp-layer-new img + width height GRAY-IMAGE + "MakeBrush" 100 LAYER-MODE-NORMAL))) + (filename (string-append gimp-directory + "/brushes/e" + (number->string width) + "x" + (number->string height) + ".gbr")) + ) + + (gimp-context-push) + (gimp-context-set-antialias TRUE) + (gimp-context-set-feather FALSE) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-fill drawable FILL-BACKGROUND) + (gimp-context-set-background '(0 0 0)) + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height) + + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + (file-gbr-save 1 img drawable filename "" spacing name) + (gimp-image-delete img) + + (gimp-context-pop) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) +) + +(script-fu-register "script-fu-make-brush-elliptical" + _"_Elliptical..." + _"Create an elliptical brush" + "Seth Burgess <sjburges@ou.edu>" + "Seth Burgess" + "1997" + "" + SF-STRING _"Name" "Ellipse" + SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0) +) + +(script-fu-menu-register "script-fu-make-brush-elliptical" + "<Brushes>") + + +(define (script-fu-make-brush-elliptical-feathered name + width height + feathering spacing) + (let* ( + (widthplus (+ feathering width)) ; add 3 for blurring + (heightplus (+ feathering height)) + (img (car (gimp-image-new widthplus heightplus GRAY))) + (drawable (car (gimp-layer-new img + widthplus heightplus GRAY-IMAGE + "MakeBrush" 100 LAYER-MODE-NORMAL))) + (filename (string-append gimp-directory + "/brushes/e" + (number->string width) + "x" + (number->string height) + "f" + (number->string feathering) + ".gbr")) + ) + + (gimp-context-push) + (gimp-context-set-antialias TRUE) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-fill drawable FILL-BACKGROUND) + + (cond ((> feathering 0) ; keep from taking out gimp with stupid entry. + (gimp-context-set-feather TRUE) + (gimp-context-set-feather-radius feathering feathering) + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE + (/ feathering 2) (/ feathering 2) + width height)) + ((<= feathering 0) + (gimp-context-set-feather FALSE) + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 0 0 width height))) + + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + (file-gbr-save 1 img drawable filename "" spacing name) + (gimp-image-delete img) + + (gimp-context-pop) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) +) + +(script-fu-register "script-fu-make-brush-elliptical-feathered" + _"Elli_ptical, Feathered..." + _"Create an elliptical brush with feathered edges" + "Seth Burgess <sjburges@ou.edu>" + "Seth Burgess" + "1997" + "" + SF-STRING _"Name" "Ellipse" + SF-ADJUSTMENT _"Width" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Height" '(20 1 200 1 10 0 1) + SF-ADJUSTMENT _"Feathering" '(4 1 100 1 10 0 1) + SF-ADJUSTMENT _"Spacing" '(25 1 100 1 10 1 0) +) + +(script-fu-menu-register "script-fu-make-brush-elliptical-feathered" + "<Brushes>") diff --git a/plug-ins/script-fu/scripts/old-photo.scm b/plug-ins/script-fu/scripts/old-photo.scm new file mode 100644 index 0000000..110c313 --- /dev/null +++ b/plug-ins/script-fu/scripts/old-photo.scm @@ -0,0 +1,108 @@ +; +; old-photo +; +; +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. + +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Branko Collin <collin@xs4all.nl> added the possibility to change +; the border size in October 2001. + +; Define the function: + +(define (script-fu-old-photo inImage inLayer inDefocus inBorderSize inSepia inMottle inCopy) + (let ( + (theImage (if (= inCopy TRUE) (car (gimp-image-duplicate inImage)) inImage)) + (theLayer 0) + (theWidth 0) + (theHeight 0) + ) + (if (= inCopy TRUE) + (gimp-image-undo-disable theImage) + (gimp-image-undo-group-start theImage) + ) + + (gimp-selection-all theImage) + + (set! theLayer (car (gimp-image-flatten theImage))) + (if (= inDefocus TRUE) + (plug-in-gauss-rle RUN-NONINTERACTIVE theImage theLayer 1.5 TRUE TRUE) + ) + (if (> inBorderSize 0) + (script-fu-fuzzy-border theImage theLayer '(255 255 255) + inBorderSize TRUE 8 FALSE 100 FALSE TRUE ) + ) + (set! theLayer (car (gimp-image-flatten theImage))) + + (if (= inSepia TRUE) + (begin (gimp-drawable-desaturate theLayer DESATURATE-LIGHTNESS) + (gimp-drawable-brightness-contrast theLayer -0.078125 -0.15625) + (gimp-drawable-color-balance theLayer TRANSFER-SHADOWS TRUE 30 0 -30) + ) + ) + (set! theWidth (car (gimp-image-width theImage))) + (set! theHeight (car (gimp-image-height theImage))) + (if (= inMottle TRUE) + (let ( + (mLayer (car (gimp-layer-new theImage theWidth theHeight + RGBA-IMAGE "Mottle" + 100 LAYER-MODE-DARKEN-ONLY))) + ) + + (gimp-image-insert-layer theImage mLayer 0 0) + (gimp-selection-all theImage) + (gimp-drawable-edit-clear mLayer) + (gimp-selection-none theImage) + (plug-in-noisify RUN-NONINTERACTIVE theImage mLayer TRUE 0 0 0 0.5) + (plug-in-gauss-rle RUN-NONINTERACTIVE theImage mLayer 5 TRUE TRUE) + (set! theLayer (car (gimp-image-flatten theImage))) + ) + ) + (gimp-selection-none theImage) + + (if (= inCopy TRUE) + (begin (gimp-image-clean-all theImage) + (gimp-display-new theImage) + (gimp-image-undo-enable theImage) + ) + (gimp-image-undo-group-end theImage) + ) + + (gimp-displays-flush theImage) + ) +) + +(script-fu-register "script-fu-old-photo" + _"_Old Photo..." + _"Make an image look like an old photo" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "16th April 1998" + "RGB* GRAY*" + SF-IMAGE "The image" 0 + SF-DRAWABLE "The layer" 0 + SF-TOGGLE _"Defocus" TRUE + SF-ADJUSTMENT _"Border size" '(20 0 300 1 10 0 1) + ; since this plug-in uses the fuzzy-border plug-in, I used the + ; values of the latter, with the exception of the initial value + ; and the 'minimum' value. + SF-TOGGLE _"Sepia" TRUE + SF-TOGGLE _"Mottle" FALSE + SF-TOGGLE _"Work on copy" TRUE +) + +(script-fu-menu-register "script-fu-old-photo" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/palette-export.scm b/plug-ins/script-fu/scripts/palette-export.scm new file mode 100644 index 0000000..ecb16df --- /dev/null +++ b/plug-ins/script-fu/scripts/palette-export.scm @@ -0,0 +1,402 @@ +; ----------------------------------------------------------------------------- +; GIMP palette export toolkit - +; Written by Barak Itkin <lightningismyname@gmail.com> +; +; This script includes various exporters for GIMP palettes, and other +; utility function to help in exporting to other (text-based) formats. +; See instruction on adding new exporters at the end +; +; ----------------------------------------------------------------------------- +; Numbers and Math +; ----------------------------------------------------------------------------- + +; For all the operations below, this is the order of respectable digits: +(define conversion-digits (list "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" + "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" + "l" "m" "n" "o" "p" "q" "r" "s" "t" "u" "v" + "w" "x" "y" "z")) + +; Converts a decimal number to another base. The returned number is a string +(define (convert-decimal-to-base num base) + (if (< num base) + (list-ref conversion-digits num) + (let loop ((val num) + (order (inexact->exact (truncate (/ (log num) + (log base))))) + (result "")) + (let* ((power (expt base order)) + (digit (quotient val power))) + (if (zero? order) + (string-append result (list-ref conversion-digits digit)) + (loop (- val (* digit power)) + (pred order) + (string-append result (list-ref conversion-digits digit)))))))) + +; Convert a string representation of a number in some base, to a decimal number +(define (convert-base-to-decimal base num-str) + (define (convert-char num-char) + (if (char-numeric? num-char) + (string->number (string num-char)) + (+ 10 (- (char->integer num-char) (char->integer #\a))) + ) + ) + (define (calc base num-str num) + (if (equal? num-str "") + num + (calc base + (substring num-str 1) + (+ (* num base) (convert-char (string-ref num-str 0))) + ) + ) + ) + (calc base num-str 0) + ) + +; If a string num-str is shorter then size, pad it with pad-str in the +; beginning until it's at least size long +(define (pre-pad-number num-str size pad-str) + (if (< (string-length num-str) size) + (pre-pad-number (string-append pad-str num-str) size pad-str) + num-str + ) + ) + +; ----------------------------------------------------------------------------- +; Color convertors +; ----------------------------------------------------------------------------- + +; The standard way for representing a color would be a list of red +; green and blue (GIMP's default) +(define color-get-red car) +(define color-get-green cadr) +(define color-get-blue caddr) + +; Convert a color to a hexadecimal string +; '(255 255 255) => "#ffffff" + +(define (color-rgb-to-hexa-decimal color) + (string-append "#" + (pre-pad-number + (convert-decimal-to-base (color-get-red color) 16) 2 "0") + (pre-pad-number + (convert-decimal-to-base (color-get-green color) 16) 2 "0") + (pre-pad-number + (convert-decimal-to-base (color-get-blue color) 16) 2 "0") + ) + ) + +; Convert a color to a css color +; '(255 255 255) => "rgb(255, 255, 255)" +(define (color-rgb-to-css color) + (string-append "rgb(" (number->string (color-get-red color)) + ", " (number->string (color-get-green color)) + ", " (number->string (color-get-blue color)) ")") + ) + +; Convert a color to a simple pair of braces with comma separated values +; '(255 255 255) => "(255, 255, 255)" +(define (color-rgb-to-comma-seperated-list color) + (string-append "(" (number->string (color-get-red color)) + ", " (number->string (color-get-green color)) + ", " (number->string (color-get-blue color)) ")") + ) + + +; ----------------------------------------------------------------------------- +; Export utils +; ----------------------------------------------------------------------------- + +; List of characters that should not appear in file names +(define illegal-file-name-chars (list #\\ #\/ #\: #\* #\? #\" #\< #\> #\|)) + +; A function to filter a list lst by a given predicate pred +(define (filter pred lst) + (if (null? lst) + '() + (if (pred (car lst)) + (cons (car lst) (filter pred (cdr lst))) + (filter pred (cdr lst)) + ) + ) + ) + +; A function to check if a certain value obj is inside a list lst +(define (contained? obj lst) (member obj lst)) + +; This functions filters a string to have only characters which are +; either alpha-numeric or contained in more-legal (which is a variable +; holding a list of characters) +(define (clean str more-legal) + (list->string (filter (lambda (ch) (or (char-alphabetic? ch) + (char-numeric? ch) + (contained? ch more-legal))) + (string->list str))) + ) + +; A function that receives the a file-name, and filters out all the +; character that shouldn't appear in file names. Then, it makes sure +; the remaining name isn't only white-spaces. If it's only +; white-spaces, the function returns false. Otherwise, it returns the +; fixed file-name +(define (valid-file-name name) + (let* ((clean (list->string (filter (lambda (ch) + (not (contained? + ch illegal-file-name-chars))) + (string->list name)))) + (clean-without-spaces (list->string (filter (lambda (ch) + (not (char-whitespace? + ch))) + (string->list clean)))) + ) + (if (equal? clean-without-spaces "") + #f + clean + ) + ) + ) + +; Filters a string from all the characters which are not alpha-numeric +; (this also removes whitespaces) +(define (name-alpha-numeric str) + (clean str '()) + ) + +; This function does the same as name-alpha-numeric, with an added +; operation - it removes any numbers from the beginning +(define (name-standard str) + (let ((cleaned (clean str '()))) + (while (char-numeric? (string-ref cleaned 0)) + (set! cleaned (substring cleaned 1)) + ) + cleaned + ) + ) + +(define name-no-conversion (lambda (obj) obj)) +(define color-none (lambda (x) "")) +(define name-none (lambda (x) "")) + +(define displayln (lambda (obj) (display obj) (display "\n"))) + +; The loop for exporting all the colors +(define (export-palette palette-name color-convertor name-convertor + start name-pre name-after name-color-seperator + color-pre color-after entry-seperator end) + + (define (write-color-line index) + (display name-pre) + (display (name-convertor + (car (gimp-palette-entry-get-name palette-name index)))) + (display name-after) + (display name-color-seperator) + (display color-pre) + (display (color-convertor + (car (gimp-palette-entry-get-color palette-name index)))) + (display color-after) + ) + + (let ((color-count (car (gimp-palette-get-colors palette-name))) + (i 0) + ) + + (display start) + + (while (< i (- color-count 1)) + (begin + (write-color-line i) + (display entry-seperator) + (set! i (+ 1 i)) + ) + ) + + (write-color-line i) + (display end) + ) + ) + +(define (register-palette-exporter + export-type export-name file-type description author copyright date) + (script-fu-register (string-append "gimp-palette-export-" export-type) + export-name + description + author + copyright + date + "" + SF-DIRNAME _"Folder for the output file" "" + SF-STRING _"The name of the file to create (if a file with this name already exist, it will be replaced)" + (string-append "palette." file-type) + ) + (script-fu-menu-register (string-append "gimp-palette-export-" export-type) + "<Palettes>/Export as") + ) + +(define (bad-file-name) + (gimp-message (string-append _"The filename you entered is not a suitable name for a file." + "\n\n" + _"All characters in the name are either white-spaces or characters which can not appear in filenames."))) + +; ----------------------------------------------------------------------------- +; Exporters +; ----------------------------------------------------------------------------- + +(define (gimp-palette-export-css directory-name file-name) + (let ((valid-name (valid-file-name file-name))) + (if valid-name + (with-output-to-file (string-append + directory-name DIR-SEPARATOR file-name) + (lambda () (export-palette (car (gimp-context-get-palette)) + color-rgb-to-css + name-alpha-numeric ; name-convertor + "/* Generated with GIMP Palette Export */\n" ; start + "." ; name-pre + "" ; name-after + " { " ; name-color-seperator + "color: " ; color-pre + " }" ; color-after + "\n" ; entry-seperator + "" ; end + ))) + (bad-file-name) + ) + ) + ) +(register-palette-exporter "css" "_CSS stylesheet..." "css" + (string-append _"Export the active palette as a CSS stylesheet with the color entry name as their class name, and the color itself as the color attribute") + "Barak Itkin <lightningismyname@gmail.com>" + "Barak Itkin" "May 15th, 2009") + +(define (gimp-palette-export-php directory-name file-name) + (let ((valid-name (valid-file-name file-name))) + (if valid-name + (with-output-to-file (string-append + directory-name DIR-SEPARATOR file-name) + (lambda () (export-palette (car (gimp-context-get-palette)) + color-rgb-to-hexa-decimal + name-standard ; name-convertor + "<?php\n/* Generated with GIMP Palette Export */\n$colors={\n" ; start + "'" ; name-pre + "'" ; name-after + " => " ; name-color-seperator + "'" ; color-pre + "'" ; color-after + ",\n" ; entry-seperator + "}\n?>" ; end + ))) + (bad-file-name) + ) + ) + ) +(register-palette-exporter "php" "P_HP dictionary..." "php" + _"Export the active palette as a PHP dictionary (name => color)" + "Barak Itkin <lightningismyname@gmail.com>" + "Barak Itkin" "May 15th, 2009") + +(define (gimp-palette-export-python directory-name file-name) + (let ((valid-name (valid-file-name file-name))) + (if valid-name + (with-output-to-file (string-append + directory-name DIR-SEPARATOR file-name) + (lambda () + (let ((palette-name (car (gimp-context-get-palette)))) + (begin (displayln "# Generated with GIMP Palette Export") + (displayln (string-append + "# Based on the palette " palette-name)) + (export-palette palette-name + color-rgb-to-hexa-decimal + name-standard ; name-convertor + "colors={\n" ; start + "'" ; name-pre + "'" ; name-after + ": " ; name-color-seperator + "'" ; color-pre + "'" ; color-after + ",\n" ; entry-seperator + "}" ; end + )))) + ) + (bad-file-name) + ) + ) + ) +(register-palette-exporter "python" "_Python dictionary" "py" + _"Export the active palette as a Python dictionary (name: color)" + "Barak Itkin <lightningismyname@gmail.com>" + "Barak Itkin" "May 15th, 2009") + +(define (gimp-palette-export-text directory-name file-name) + (let ((valid-name (valid-file-name file-name))) + (if valid-name + (with-output-to-file (string-append + directory-name DIR-SEPARATOR file-name) + (lambda () + (export-palette (car (gimp-context-get-palette)) + color-rgb-to-hexa-decimal + name-none ; name-convertor + "" ; start + "" ; name-pre + "" ; name-after + "" ; name-color-seperator + "" ; color-pre + "" ; color-after + "\n" ; entry-seperator + "" ; end + ) + ) + ) + (bad-file-name) + ) + ) + ) +(register-palette-exporter "text" "_Text file..." "txt" + _"Write all the colors in a palette to a text file, one hexadecimal value per line (no names)" + "Barak Itkin <lightningismyname@gmail.com>" + "Barak Itkin" "May 15th, 2009") + +(define (gimp-palette-export-java directory-name file-name) + (let ((valid-name (valid-file-name file-name))) + (if valid-name + (with-output-to-file (string-append directory-name + DIR-SEPARATOR file-name) + (lambda () + (let ((palette-name (car (gimp-context-get-palette)))) + (begin (displayln "") + (displayln "import java.awt.Color;") + (displayln "import java.util.Hashtable;") + (displayln "") + (displayln "// Generated with GIMP palette Export ") + (displayln (string-append + "// Based on the palette " palette-name)) + (displayln (string-append + "public class " + (name-standard palette-name) " {")) + (displayln "") + (displayln " Hashtable<String, Color> colors;") + (displayln "") + (displayln (string-append + " public " + (name-standard palette-name) "() {")) + (export-palette (car (gimp-context-get-palette)) + color-rgb-to-comma-seperated-list + name-no-conversion + " colors = new Hashtable<String,Color>();\n" ; start + " colors.put(\"" ; name-pre + "\"" ; name-after + ", " ; name-color-seperator + "new Color" ; color-pre + ");" ; color-after + "\n" ; entry-seperator + "\n }" ; end + ) + (display "\n}")))) + ) + (bad-file-name) + ) + ) + ) + +(register-palette-exporter "java" "J_ava map..." "java" + _"Export the active palette as a java.util.Hashtable<String, Color>" + "Barak Itkin <lightningismyname@gmail.com>" + "Barak Itkin" "May 15th, 2009") + diff --git a/plug-ins/script-fu/scripts/paste-as-brush.scm b/plug-ins/script-fu/scripts/paste-as-brush.scm new file mode 100644 index 0000000..062e97d --- /dev/null +++ b/plug-ins/script-fu/scripts/paste-as-brush.scm @@ -0,0 +1,74 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; script-fu-paste-as-brush +; Based on select-to-brush by Copyright (c) 1997 Adrian Likins +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-paste-as-brush name filename spacing) + + (let* ((brush-image (car (gimp-edit-paste-as-new-image))) + (brush-draw 0) + (type 0) + (path 0)) + + (if (= TRUE (car (gimp-image-is-valid brush-image))) + (begin + (set! brush-draw (car (gimp-image-get-active-drawable brush-image))) + (set! type (car (gimp-drawable-type brush-draw))) + (set! path (string-append gimp-directory + "/brushes/" + filename + (number->string brush-image) + ".gbr")) + + (if (= type GRAYA-IMAGE) + (begin + (gimp-context-push) + (gimp-context-set-background '(255 255 255)) + (set! brush-draw (car (gimp-image-flatten brush-image))) + (gimp-context-pop) + ) + ) + + (file-gbr-save RUN-NONINTERACTIVE + brush-image brush-draw path path + spacing name) + + (gimp-image-delete brush-image) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) + (gimp-message _"There is no image data in the clipboard to paste.") + ) + ) +) + +(script-fu-register "script-fu-paste-as-brush" + _"New _Brush..." + _"Paste the clipboard contents into a new brush" + "Michael Natterer <mitch@gimp.org>" + "Michael Natterer" + "2005-09-25" + "" + SF-STRING _"_Brush name" "My Brush" + SF-STRING _"_File name" "mybrush" + SF-ADJUSTMENT _"_Spacing" '(25 0 1000 1 1 1 0) +) + +(script-fu-menu-register "script-fu-paste-as-brush" + "<Image>/Edit/Paste as") diff --git a/plug-ins/script-fu/scripts/paste-as-pattern.scm b/plug-ins/script-fu/scripts/paste-as-pattern.scm new file mode 100644 index 0000000..01381a2 --- /dev/null +++ b/plug-ins/script-fu/scripts/paste-as-pattern.scm @@ -0,0 +1,61 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; script-fu-paste-as-pattern +; Based on select-to-pattern by Cameron Gregory, http://www.flamingtext.com/ +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-paste-as-pattern name filename) + (let* ((pattern-image (car (gimp-edit-paste-as-new-image))) + (pattern-draw 0) + (path 0)) + + (if (= TRUE (car (gimp-image-is-valid pattern-image))) + (begin + (set! pattern-draw (car (gimp-image-get-active-drawable pattern-image))) + (set! path (string-append gimp-directory + "/patterns/" + filename + (number->string pattern-image) + ".pat")) + + (file-pat-save RUN-NONINTERACTIVE + pattern-image pattern-draw path path + name) + + (gimp-image-delete pattern-image) + + (gimp-patterns-refresh) + (gimp-context-set-pattern name) + ) + (gimp-message _"There is no image data in the clipboard to paste.") + ) + ) +) + +(script-fu-register "script-fu-paste-as-pattern" + _"New _Pattern..." + _"Paste the clipboard contents into a new pattern" + "Michael Natterer <mitch@gimp.org>" + "Michael Natterer" + "2005-09-25" + "" + SF-STRING _"_Pattern name" "My Pattern" + SF-STRING _"_File name" "mypattern" +) + +(script-fu-menu-register "script-fu-paste-as-pattern" + "<Image>/Edit/Paste as") diff --git a/plug-ins/script-fu/scripts/perspective-shadow.scm b/plug-ins/script-fu/scripts/perspective-shadow.scm new file mode 100644 index 0000000..1eb40e3 --- /dev/null +++ b/plug-ins/script-fu/scripts/perspective-shadow.scm @@ -0,0 +1,217 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; perspective-shadow.scm version 1.2 2000/11/08 +; +; Copyright (C) 1997-2000 Sven Neumann <sven@gimp.org> +; +; +; Adds a perspective shadow of the current selection or alpha-channel +; as a layer below the active layer +; + +(define (script-fu-perspective-shadow image + drawable + alpha + rel-distance + rel-length + shadow-blur + shadow-color + shadow-opacity + interpolation + allow-resize) + (let* ( + (shadow-blur (max shadow-blur 0)) + (shadow-opacity (min shadow-opacity 100)) + (shadow-opacity (max shadow-opacity 0)) + (rel-length (abs rel-length)) + (alpha (* (/ alpha 180) *pi*)) + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (from-selection 0) + (active-selection 0) + (shadow-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (if (> rel-distance 24) (set! rel-distance 999999)) + (if (= rel-distance rel-length) (set! rel-distance (+ rel-distance 0.01))) + + (gimp-image-undo-group-start image) + + (gimp-layer-add-alpha drawable) + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! from-selection FALSE)) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))))) + + (let* ((selection-bounds (gimp-selection-bounds image)) + (select-offset-x (cadr selection-bounds)) + (select-offset-y (caddr selection-bounds)) + (select-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (select-height (- (caddr (cddr selection-bounds)) select-offset-y)) + + (abs-length (* rel-length select-height)) + (abs-distance (* rel-distance select-height)) + (half-bottom-width (/ select-width 2)) + (half-top-width (* half-bottom-width + (/ (- rel-distance rel-length) rel-distance))) + + (x0 (+ select-offset-x (+ (- half-bottom-width half-top-width) + (* (cos alpha) abs-length)))) + (y0 (+ select-offset-y (- select-height + (* (sin alpha) abs-length)))) + (x1 (+ x0 (* 2 half-top-width))) + (y1 y0) + (x2 select-offset-x) + (y2 (+ select-offset-y select-height)) + (x3 (+ x2 select-width)) + (y3 y2) + + (shadow-width (+ (- (max x1 x3) (min x0 x2)) (* 2 shadow-blur))) + (shadow-height (+ (- (max y1 y3) (min y0 y2)) (* 2 shadow-blur))) + (shadow-offset-x (- (min x0 x2) shadow-blur)) + (shadow-offset-y (- (min y0 y2) shadow-blur))) + + + (set! shadow-layer (car (gimp-layer-new image + select-width + select-height + type + "Perspective Shadow" + shadow-opacity + LAYER-MODE-NORMAL))) + + + (gimp-image-insert-layer image shadow-layer 0 -1) + (gimp-layer-set-offsets shadow-layer select-offset-x select-offset-y) + (gimp-drawable-fill shadow-layer FILL-TRANSPARENT) + (gimp-context-set-background shadow-color) + (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND) + (gimp-selection-none image) + + (if (= allow-resize TRUE) + (let* ((new-image-width image-width) + (new-image-height image-height) + (image-offset-x 0) + (image-offset-y 0)) + + (if (< shadow-offset-x 0) + (begin + (set! image-offset-x (abs shadow-offset-x)) + (set! new-image-width (+ new-image-width image-offset-x)) + ; adjust to new coordinate system + (set! x0 (+ x0 image-offset-x)) + (set! x1 (+ x1 image-offset-x)) + (set! x2 (+ x2 image-offset-x)) + (set! x3 (+ x3 image-offset-x)) + )) + + (if (< shadow-offset-y 0) + (begin + (set! image-offset-y (abs shadow-offset-y)) + (set! new-image-height (+ new-image-height image-offset-y)) + ; adjust to new coordinate system + (set! y0 (+ y0 image-offset-y)) + (set! y1 (+ y1 image-offset-y)) + (set! y2 (+ y2 image-offset-y)) + (set! y3 (+ y3 image-offset-y)) + )) + + (if (> (+ shadow-width shadow-offset-x) new-image-width) + (set! new-image-width (+ shadow-width shadow-offset-x))) + + (if (> (+ shadow-height shadow-offset-y) new-image-height) + (set! new-image-height (+ shadow-height shadow-offset-y))) + (gimp-image-resize image + new-image-width + new-image-height + image-offset-x + image-offset-y))) + + (gimp-context-set-transform-direction TRANSFORM-FORWARD) + (gimp-context-set-interpolation interpolation) + (gimp-context-set-transform-recursion 3) + (gimp-context-set-transform-resize TRANSFORM-RESIZE-ADJUST) + + (gimp-item-transform-perspective shadow-layer + x0 y0 + x1 y1 + x2 y2 + x3 y3) + + (if (>= shadow-blur 1.0) + (begin + (gimp-layer-set-lock-alpha shadow-layer FALSE) + (gimp-layer-resize shadow-layer + shadow-width + shadow-height + shadow-blur + shadow-blur) + (plug-in-gauss-rle RUN-NONINTERACTIVE + image + shadow-layer + shadow-blur + TRUE + TRUE)))) + + (if (= from-selection TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-drawable-edit-clear shadow-layer) + (gimp-image-remove-channel image active-selection))) + + (if (and + (= (car (gimp-layer-is-floating-sel drawable)) 0) + (= from-selection FALSE)) + (gimp-image-raise-item image drawable)) + + (gimp-image-set-active-layer image drawable) + (gimp-image-undo-group-end image) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-perspective-shadow" + _"_Perspective..." + _"Add a perspective shadow to the selected region (or alpha)" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "2000/11/08" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Angle" '(45 0 180 1 10 1 0) + SF-ADJUSTMENT _"Relative distance of horizon" '(5 0.1 24.1 0.1 1 1 1) + SF-ADJUSTMENT _"Relative length of shadow" '(1 0.1 24 0.1 1 1 1) + SF-ADJUSTMENT _"Blur radius" '(3 0 1024 1 10 0 0) + SF-COLOR _"Color" '(0 0 0) + SF-ADJUSTMENT _"Opacity" '(80 0 100 1 10 0 0) + SF-ENUM _"Interpolation" '("InterpolationType" "linear") + SF-TOGGLE _"Allow resizing" FALSE +) + +(script-fu-menu-register "script-fu-perspective-shadow" + "<Image>/Filters/Light and Shadow/Shadow") diff --git a/plug-ins/script-fu/scripts/plug-in-compat.init b/plug-ins/script-fu/scripts/plug-in-compat.init new file mode 100644 index 0000000..dd68c2c --- /dev/null +++ b/plug-ins/script-fu/scripts/plug-in-compat.init @@ -0,0 +1,24 @@ +; The Scheme code in this file provides some compatibility with +; scripts that were originally written for use with older versions of +; GIMP. +; +; It provides PDB procedures that used to be provided by plug-ins that +; were since then removed from the GIMP distribution. You should not +; use these in newly written scripts as the functions defined here may +; be removed at some later date. + + +(define (plug-in-color-map run-mode img layer + src-color-1 src-color-2 dest-color-1 dest-color-2 + map-mode) + (gimp-levels layer HISTOGRAM-RED + (car src-color-1) (car src-color-2) 1.0 + (- 255 (car dest-color-1)) (- 255 (car dest-color-2))) + (gimp-levels layer HISTOGRAM-GREEN + (cadr src-color-1) (cadr src-color-2) 1.0 + (- 255 (cadr dest-color-1)) (- 255 (cadr dest-color-2))) + (gimp-levels layer HISTOGRAM-BLUE + (caddr src-color-1) (caddr src-color-2) 1.0 + (- 255 (caddr dest-color-1)) (- 255 (caddr dest-color-2))) + (gimp-levels layer HISTOGRAM-VALUE 0 255 1.0 255 0) +) diff --git a/plug-ins/script-fu/scripts/predator.scm b/plug-ins/script-fu/scripts/predator.scm new file mode 100644 index 0000000..cd1ab14 --- /dev/null +++ b/plug-ins/script-fu/scripts/predator.scm @@ -0,0 +1,137 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Predator effect +; Copyright (c) 1997 Adrian Likins +; aklikins@eos.ncsu.ed +; +; The idea here is too make the image/selection look sort of like +; the view the predator had in the movies. ie, kind of a thermogram +; type of thing. Works best on colorful rgb images. +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-predator image + drawable + edge-amount + pixelize + pixel-size + keep-selection + separate-layer) + (let* ( + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (image-height (car (gimp-image-height image))) + (active-selection 0) + (from-selection 0) + (selection-bounds 0) + (select-offset-x 0) + (select-offset-y 0) + (select-width 0) + (select-height 0) + (effect-layer 0) + (active-layer 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + (gimp-image-undo-group-start image) + (gimp-layer-add-alpha drawable) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! active-selection (car (gimp-selection-save image))) + (set! from-selection FALSE) + ) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))) + ) + ) + + (set! selection-bounds (gimp-selection-bounds image)) + (set! select-offset-x (cadr selection-bounds)) + (set! select-offset-y (caddr selection-bounds)) + (set! select-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (set! select-height (- (caddr (cddr selection-bounds)) select-offset-y)) + + (if (= separate-layer TRUE) + (begin + (set! effect-layer (car (gimp-layer-new image + select-width + select-height + type + "glow layer" + 100 + LAYER-MODE-NORMAL)) + ) + + (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y) + (gimp-image-insert-layer image effect-layer 0 -1) + (gimp-selection-none image) + (gimp-drawable-edit-clear effect-layer) + + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-edit-copy drawable) + (let ((floating-sel (car (gimp-edit-paste effect-layer FALSE)))) + (gimp-floating-sel-anchor floating-sel) + ) + (gimp-image-set-active-layer image effect-layer) + ) + (set! effect-layer drawable) + ) + (set! active-layer effect-layer) + + ; all the fun stuff goes here + (if (= pixelize TRUE) + (plug-in-pixelize RUN-NONINTERACTIVE image active-layer pixel-size) + ) + (plug-in-max-rgb RUN-NONINTERACTIVE image active-layer 0) + (plug-in-edge RUN-NONINTERACTIVE image active-layer edge-amount 1 0) + + ; clean up the selection copy + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + + (if (= keep-selection FALSE) + (gimp-selection-none image) + ) + + (gimp-image-set-active-layer image drawable) + (gimp-image-remove-channel image active-selection) + (gimp-image-undo-group-end image) + (gimp-displays-flush) + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-predator" + _"_Predator..." + _"Add a 'Predator' effect to the selected region (or alpha)" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "10/12/97" + "RGB*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Edge amount" '(2 0 24 1 1 0 0) + SF-TOGGLE _"Pixelize" TRUE + SF-ADJUSTMENT _"Pixel amount" '(3 1 16 1 1 0 0) + SF-TOGGLE _"Keep selection" TRUE + SF-TOGGLE _"Separate layer" TRUE +) + +(script-fu-menu-register "script-fu-predator" + "<Image>/Filters/Artistic") diff --git a/plug-ins/script-fu/scripts/reverse-layers.scm b/plug-ins/script-fu/scripts/reverse-layers.scm new file mode 100644 index 0000000..d7e2882 --- /dev/null +++ b/plug-ins/script-fu/scripts/reverse-layers.scm @@ -0,0 +1,53 @@ +; reverse-layers.scm: Reverse the order of layers in the current image. +; Copyright (C) 2006 by Akkana Peck. +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +(define (script-fu-reverse-layers img drawable) + (let* ( + (layers (gimp-image-get-layers img)) + (num-layers (car layers)) + (layer-array (cadr layers)) + (i (- num-layers 1)) + ) + + (gimp-image-undo-group-start img) + + (while (>= i 0) + (let ((layer (aref layer-array i))) + (if (= (car (gimp-layer-is-floating-sel layer)) FALSE) + (gimp-image-lower-item-to-bottom img layer)) + ) + + (set! i (- i 1)) + ) + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-reverse-layers" + _"Reverse Layer _Order" + _"Reverse the order of layers in the image" + "Akkana Peck" + "Akkana Peck" + "August 2006" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 +) + +(script-fu-menu-register "script-fu-reverse-layers" + "<Image>/Layer/Stack") diff --git a/plug-ins/script-fu/scripts/ripply-anim.scm b/plug-ins/script-fu/scripts/ripply-anim.scm new file mode 100644 index 0000000..25a2462 --- /dev/null +++ b/plug-ins/script-fu/scripts/ripply-anim.scm @@ -0,0 +1,83 @@ +; "Rippling Image" animation generator (ripply-anim.scm) +; Adam D. Moss (adam@foxbox.org) +; 97/05/18 +; Revised by Saul Goode April 2015. +; +; Designed to be used in conjunction with a plugin capable +; of saving animations (i.e. the GIF plugin). +; + +(define (script-fu-ripply-anim image drawable displacement num-frames edge-type) + (let* ((width (car (gimp-drawable-width drawable))) + (height (car (gimp-drawable-height drawable))) + (work-image (car (gimp-image-new width + height + (quotient (car (gimp-drawable-type drawable)) + 2)))) + (map-layer (car (gimp-layer-new work-image + width + height + (car (gimp-drawable-type drawable)) + "Ripple Map" + 100 + LAYER-MODE-NORMAL)))) + (gimp-context-push) + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + (gimp-image-undo-disable work-image) + + ; Create a tile-able displacement map in the first layer + (gimp-context-set-background '(127 127 127)) + (gimp-image-insert-layer work-image map-layer 0 0) + (gimp-drawable-edit-fill map-layer FILL-BACKGROUND) + (plug-in-noisify RUN-NONINTERACTIVE work-image map-layer FALSE 1.0 1.0 1.0 0.0) + (plug-in-tile RUN-NONINTERACTIVE work-image map-layer (* width 3) (* height 3) FALSE) + (plug-in-gauss-iir RUN-NONINTERACTIVE work-image map-layer 35 TRUE TRUE) + (gimp-drawable-equalize map-layer TRUE) + (plug-in-gauss-rle RUN-NONINTERACTIVE work-image map-layer 5 TRUE TRUE) + (gimp-drawable-equalize map-layer TRUE) + (gimp-image-crop work-image width height width height) + + ; Create the frame layers + (let loop ((remaining-frames num-frames)) + (unless (zero? remaining-frames) + (let ((frame-layer (car (gimp-layer-new-from-drawable drawable work-image)))) + (gimp-image-insert-layer work-image frame-layer 0 0) + (gimp-item-set-name frame-layer + (string-append "Frame " + (number->string (+ 1 (- num-frames + remaining-frames))) + " (replace)")) + (plug-in-displace RUN-NONINTERACTIVE work-image frame-layer + displacement displacement + TRUE TRUE map-layer map-layer (+ edge-type 1)) + (gimp-item-set-visible frame-layer TRUE)) + (gimp-drawable-offset map-layer + TRUE + OFFSET-BACKGROUND + (/ width num-frames) + (/ height num-frames)) + (loop (- remaining-frames 1)))) + + (gimp-image-remove-layer work-image map-layer) + (gimp-image-undo-enable work-image) + (gimp-display-new work-image) + + (gimp-context-pop))) + +(script-fu-register "script-fu-ripply-anim" + _"_Rippling..." + _"Create a multi-layer image by adding a ripple effect to the current layer" + "Adam D. Moss (adam@foxbox.org), Saul Goode" + "Adam D. Moss, Saul Goode" + "1997, 2015" + "RGB* GRAY*" + SF-IMAGE "Image to animage" 0 + SF-DRAWABLE "Drawable to animate" 0 + SF-ADJUSTMENT _"Rippling strength" '(3 0 256 1 10 1 0) + SF-ADJUSTMENT _"Number of frames" '(15 0 256 1 10 0 1) + SF-OPTION _"Edge behavior" '(_"Wrap" _"Smear" _"Black") + ) + +(script-fu-menu-register "script-fu-ripply-anim" + "<Image>/Filters/Animation/Animators") diff --git a/plug-ins/script-fu/scripts/round-corners.scm b/plug-ins/script-fu/scripts/round-corners.scm new file mode 100644 index 0000000..e076d16 --- /dev/null +++ b/plug-ins/script-fu/scripts/round-corners.scm @@ -0,0 +1,147 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; round-corners.scm version 1.02 1999/12/21 +; +; CHANGE-LOG: +; 1.00 - initial release +; 1.01 - some code cleanup, no real changes +; +; Copyright (C) 1997-1999 Sven Neumann <sven@gimp.org> +; +; +; Rounds the corners of an image, optionally adding a drop-shadow and +; a background layer +; +; The script works on RGB and grayscale images that contain only +; one layer. It creates a copy of the image or can optionally work +; on the original. The script uses the current background color to +; create a background layer. It makes a call to the script drop-shadow. +; +; This script is derived from my script add-shadow, which has become +; obsolete now. + + + +(define (script-fu-round-corners img + drawable + radius + shadow-toggle + shadow-x + shadow-y + shadow-blur + background-toggle + work-on-copy) + (let* ((shadow-blur (abs shadow-blur)) + (radius (abs radius)) + (diam (* 2 radius)) + (width (car (gimp-image-width img))) + (height (car (gimp-image-height img))) + (type (car (gimp-drawable-type-with-alpha drawable))) + (image (cond ((= work-on-copy TRUE) + (car (gimp-image-duplicate img))) + ((= work-on-copy FALSE) + img))) + (pic-layer (car (gimp-image-get-active-drawable image)))) + + (gimp-context-push) + (gimp-context-set-defaults) + + (if (= work-on-copy TRUE) + (gimp-image-undo-disable image) + (gimp-image-undo-group-start image) + ) + + ; add an alpha channel to the image + (gimp-layer-add-alpha pic-layer) + + ; round the edges + (gimp-selection-none image) + (gimp-image-select-rectangle image CHANNEL-OP-ADD 0 0 radius radius) + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT 0 0 diam diam) + (gimp-image-select-rectangle image CHANNEL-OP-ADD (- width radius) 0 radius radius) + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT (- width diam) 0 diam diam) + (gimp-image-select-rectangle image CHANNEL-OP-ADD 0 (- height radius) radius radius) + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT 0 (- height diam) diam diam) + (gimp-image-select-rectangle image CHANNEL-OP-ADD (- width radius) (- height radius) + radius radius) + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT (- width diam) (- height diam) + diam diam) + (gimp-drawable-edit-clear pic-layer) + (gimp-selection-none image) + + ; optionally add a shadow + (if (= shadow-toggle TRUE) + (begin + (script-fu-drop-shadow image + pic-layer + shadow-x + shadow-y + shadow-blur + '(0 0 0) + 80 + TRUE) + (set! width (car (gimp-image-width image))) + (set! height (car (gimp-image-height image))))) + + ; optionally add a background + (if (= background-toggle TRUE) + (let* ((bg-layer (car (gimp-layer-new image + width + height + type + "Background" + 100 + LAYER-MODE-NORMAL)))) + (gimp-drawable-fill bg-layer FILL-BACKGROUND) + (gimp-image-insert-layer image bg-layer 0 -1) + (gimp-image-raise-item image pic-layer) + (if (= shadow-toggle TRUE) + (gimp-image-lower-item image bg-layer)))) + +; clean up after the script + (if (= work-on-copy TRUE) + (gimp-image-undo-enable image) + (gimp-image-undo-group-end image) + ) + + (if (= work-on-copy TRUE) + (gimp-display-new image)) + (gimp-context-pop) + (gimp-displays-flush)) +) + +(script-fu-register "script-fu-round-corners" + _"_Round Corners..." + _"Round the corners of an image and optionally add a drop-shadow and background" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "1999/12/21" + "RGB GRAY" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Edge radius" '(15 0 4096 1 10 0 1) + SF-TOGGLE _"Add drop-shadow" TRUE + SF-ADJUSTMENT _"Shadow X offset" '(8 -4096 4096 1 10 0 1) + SF-ADJUSTMENT _"Shadow Y offset" '(8 -4096 4096 1 10 0 1) + SF-ADJUSTMENT _"Blur radius" '(15 0 1024 1 10 0 1) + SF-TOGGLE _"Add background" TRUE + SF-TOGGLE _"Work on copy" TRUE +) + +(script-fu-menu-register "script-fu-round-corners" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/script-fu-compat.init b/plug-ins/script-fu/scripts/script-fu-compat.init new file mode 100644 index 0000000..865cf80 --- /dev/null +++ b/plug-ins/script-fu/scripts/script-fu-compat.init @@ -0,0 +1,457 @@ +;The Scheme code in this file provides some compatibility with scripts that +;were originally written for use with the older SIOD based Script-Fu plug-in +;of GIMP. +; +;All items defined in this file except for the random number routines are +;deprecated. Existing scripts should be updated to avoid the use of the +;compatibility functions and define statements which follow the random number +;generator routines. +; +;The items marked as deprecated at the end of this file may be removed +;at some later date. + + +;The random number generator routines below have been slightly reformatted. +;A couple of define blocks which are not needed have been commented out. +;It has also been extended to enable it to generate numbers with exactly 31 +;bits or more. +;The original file was called rand2.scm and can be found in: +;http://www-2.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/scheme/code/math/random/ + +; Minimal Standard Random Number Generator +; Park & Miller, CACM 31(10), Oct 1988, 32 bit integer version. +; better constants, as proposed by Park. +; By Ozan Yigit + +;(define *seed* 1) + +(define (srand seed) + (set! *seed* seed) + *seed* +) + +(define (msrg-rand) + (let ( + (A 48271) + (M 2147483647) + (Q 44488) + (R 3399) + ) + (let* ( + (hi (quotient *seed* Q)) + (lo (modulo *seed* Q)) + (test (- (* A lo) (* R hi))) + ) + (if (> test 0) + (set! *seed* test) + (set! *seed* (+ test M)) + ) + ) + ) + *seed* +) + +; poker test +; seed 1 +; cards 0-9 inclusive (random 10) +; five cards per hand +; 10000 hands +; +; Poker Hand Example Probability Calculated +; 5 of a kind (aaaaa) 0.0001 0 +; 4 of a kind (aaaab) 0.0045 0.0053 +; Full house (aaabb) 0.009 0.0093 +; 3 of a kind (aaabc) 0.072 0.0682 +; two pairs (aabbc) 0.108 0.1104 +; Pair (aabcd) 0.504 0.501 +; Bust (abcde) 0.3024 0.3058 + +(define (random n) + (define (internal-random n) + (let* ( + (n (inexact->exact (truncate n))) + (M 2147483647) + (slop (modulo M (abs n))) + ) + (let loop ((r (msrg-rand))) + (if (>= r slop) + (modulo r n) + (loop (msrg-rand)) + ) + ) + ) + ) + + ; Negative numbers have a bigger range in twos complement platforms + ; (nearly all platforms out there) than positive ones, so we deal with + ; the numbers in negative form. + (if (> n 0) + (+ n (random (- n))) + + (if (>= n -2147483647) + (internal-random n) + + ; 31-or-more-bits number requested - needs multiple extractions + ; because we don't generate enough random bits. + (if (>= n -1152921504606846975) + ; Up to 2^60-1, two extractions are enough + (let ((q (- (quotient (+ n 1) 1073741824) 1))) ; q=floor(n/2^30) + (let loop () + (let ((big (+ (* (internal-random q) 1073741824) + (internal-random -1073741824) + ) + )) + (if (> big n) + big + (loop) + ) + ) + ) + ) + + ; From 2^60 up, we do three extractions. + ; The code is better understood if seen as generating three + ; digits in base 2^30. q is the maximum value the first digit + ; can take. The other digits can take the full range. + ; + ; The strategy is to generate a random number digit by digit. + ; Here's an example in base 10. Say the input n is 348 + ; (thus requesting a number between 0 and 347). Then the algorithm + ; first calls (internal-random 4) to get a digit between 0 and 3, + ; then (internal-random 10) twice to get two more digits between + ; 0 and 9. Say the result is 366: since it is greater than 347, + ; it's discarded and the process restarted. When the result is + ; <= 347, that's the returned value. The probability of it being + ; greater than the max is always strictly less than 1/2. + ; + ; This is the same idea but in base 2^30 (1073741824). The + ; first digit's weight is (2^30)^2 = 1152921504606846976, + ; similarly to how in our base 10 example, the first digit's + ; weight is 10^2 = 100. In the base 10 example we first divide + ; the target number 348 by 100, taking the ceiling, to get 4. + ; Here we divide by (2^30)^2 instead, taking the ceiling too. + ; + ; The math is a bit obscured by the fact that we generate + ; the digits as negative, so that the result is negative as + ; well, but it's really the same thing. Changing the sign of + ; every digit just changes the sign of the result. + ; + ; This method works for n up to (2^30)^2*(2^31-1) which is + ; 2475880077417839045191401472 (slightly under 91 bits). That + ; covers the 64-bit range comfortably, and some more. If larger + ; numbers are needed, they'll have to be composed with a + ; user-defined procedure. + + (if (>= n -2475880077417839045191401472) + (let ((q (- (quotient (+ n 1) 1152921504606846976) 1))) ; q=floor(n/2^60) + (let loop () + (let ((big (+ (* (internal-random q) 1152921504606846976) + (* (internal-random -1073741824) 1073741824) + (internal-random -1073741824) + ) + )) + (if (> big n) + big + (loop) + ) + ) + ) + ) + (error "requested (random n) range too large") + ) + ) + ) + ) +) + +;(define (rngtest) +; (display "implementation ") +; (srand 1) +; (do +; ( (n 0 (+ n 1)) ) +; ( (>= n 10000) ) +; (msrg-rand) +; ) +; (if (= *seed* 399268537) +; (display "looks correct.") +; (begin +; (display "failed.") +; (newline) +; (display " current seed ") (display *seed*) +; (newline) +; (display " correct seed 399268537") +; ) +; ) +; (newline) +;) + + +;This macro defines a while loop which is needed by some older scripts. +;This is here since it is not defined in R5RS and could be handy to have. + +;This while macro was found at: +;http://www.aracnet.com/~briand/scheme_eval.html +(define-macro (while test . body) + `(let loop () + (cond + (,test + ,@body + (loop) + ) + ) + ) +) + + +;The following define block(s) require the tsx extension to be loaded + +(define (realtime) + (car (gettimeofday)) +) + + +;Items below this line are for compatibility with Script-Fu but +;may be useful enough to keep around + +(define (delq item lis) + (let ((l '())) + (unless (null? lis) + (while (pair? lis) + (if (<> item (car lis)) + (set! l (append l (list (car lis)))) + ) + (set! lis (cdr lis)) + ) + ) + + l + ) +) + +(define (make-list count fill) + (vector->list (make-vector count fill)) +) + +(define (strbreakup str sep) + (let* ( + (seplen (string-length sep)) + (start 0) + (end (string-length str)) + (i start) + (l '()) + ) + + (if (= seplen 0) + (set! l (list str)) + (begin + (while (<= i (- end seplen)) + (if (substring-equal? sep str i (+ i seplen)) + (begin + (if (= start 0) + (set! l (list (substring str start i))) + (set! l (append l (list (substring str start i)))) + ) + (set! start (+ i seplen)) + (set! i (+ i seplen -1)) + ) + ) + + (set! i (+ i 1)) + ) + + (set! l (append l (list (substring str start end)))) + ) + ) + + l + ) +) + +(define (string-downcase str) + (list->string (map char-downcase (string->list str))) +) + +(define (string-trim str) + (string-trim-right (string-trim-left str)) +) + +(define (string-trim-left str) + (let ( + (strlen (string-length str)) + (i 0) + ) + + (while (and (< i strlen) + (char-whitespace? (string-ref str i)) + ) + (set! i (+ i 1)) + ) + + (substring str i (string-length str)) + ) +) + +(define (string-trim-right str) + (let ((i (- (string-length str) 1))) + + (while (and (>= i 0) + (char-whitespace? (string-ref str i)) + ) + (set! i (- i 1)) + ) + + (substring str 0 (+ i 1)) + ) +) + +(define (string-upcase str) + (list->string (map char-upcase (string->list str))) +) + +(define (substring-equal? str str2 start end) + (string=? str (substring str2 start end)) +) + +(define (unbreakupstr stringlist sep) + (let ((str (car stringlist))) + + (set! stringlist (cdr stringlist)) + (while (not (null? stringlist)) + (set! str (string-append str sep (car stringlist))) + (set! stringlist (cdr stringlist)) + ) + + str + ) +) + + +;Items below this line are deprecated and should not be used in new scripts. + +(define aset vector-set!) +(define aref vector-ref) +(define fopen open-input-file) +(define mapcar map) +(define nil '()) +(define nreverse reverse) +(define pow expt) +(define prin1 write) + +(define (print obj . port) + (apply write obj port) + (newline) +) + +(define strcat string-append) +(define string-lessp string<?) +(define symbol-bound? defined?) +(define the-environment current-environment) + +(define *pi* + (* 4 (atan 1.0)) +) + +(define (butlast x) + (if (= (length x) 1) + '() + (reverse (cdr (reverse x))) + ) +) + +(define (cons-array count type) + (case type + ((long) (make-vector count 0)) + ((short) (make-vector count 0)) + ((byte) (make-vector count 0)) + ((double) (make-vector count 0.0)) + ((string) (vector->list (make-vector count ""))) + (else type) + ) +) + +(define (fmod a b) + (- a (* (truncate (/ a b)) b)) +) + +(define (fread arg1 file) + + (define (fread-get-chars count file) + (let ( + (str "") + (c 0) + ) + + (while (> count 0) + (set! count (- count 1)) + (set! c (read-char file)) + (if (eof-object? c) + (set! count 0) + (set! str (string-append str (make-string 1 c))) + ) + ) + + (if (eof-object? c) + () + str + ) + ) + ) + + (if (number? arg1) + (begin + (set! arg1 (inexact->exact (truncate arg1))) + (fread-get-chars arg1 file) + ) + (begin + (set! arg1 (fread-get-chars (string-length arg1) file)) + (string-length arg1) + ) + ) +) + +(define (last x) + (cons (car (reverse x)) '()) +) + +(define (nth k list) + (list-ref list k) +) + +(define (prog1 form1 . form2) + (let ((a form1)) + (if (not (null? form2)) + form2 + ) + a + ) +) + +(define (rand . modulus) + (if (null? modulus) + (msrg-rand) + (apply random modulus) + ) +) + +(define (strcmp str1 str2) + (if (string<? str1 str2) + -1 + (if (string>? str1 str2) + 1 + 0 + ) + ) +) + +(define (trunc n) + (inexact->exact (truncate n)) +) + +(define verbose + (lambda n + (if (or (null? n) (not (number? (car n)))) + 0 + (car n) + ) + ) +) diff --git a/plug-ins/script-fu/scripts/script-fu-set-cmap.scm b/plug-ins/script-fu/scripts/script-fu-set-cmap.scm new file mode 100644 index 0000000..259d5de --- /dev/null +++ b/plug-ins/script-fu/scripts/script-fu-set-cmap.scm @@ -0,0 +1,64 @@ +; Set Colormap v1.1 September 29, 2004 +; by Kevin Cozens <kcozens@interlog.com> +; +; Change the colormap of an image to the colors in a specified palette. +; Included is script-fu-make-cmap-array (available for use in scripts) which +; returns an INT8ARRAY containing the colors from a specified palette. +; This array can be used as the cmap argument for gimp-image-set-colormap. + +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +(define (script-fu-make-cmap-array palette) + (let* ( + (num-colors (car (gimp-palette-get-info palette))) + (cmap (cons-array (* num-colors 3) 'byte)) + (color 0) + (i 0) + ) + + (while (< i num-colors) + (set! color (car (gimp-palette-entry-get-color palette i))) + (aset cmap (* i 3) (car color)) + (aset cmap (+ (* i 3) 1) (cadr color)) + (aset cmap (+ (* i 3) 2) (caddr color)) + (set! i (+ i 1)) + ) + + cmap + ) +) + +(define (script-fu-set-cmap img drawable palette) + (gimp-image-set-colormap img + (* (car (gimp-palette-get-info palette)) 3) + (script-fu-make-cmap-array palette)) + (gimp-displays-flush) +) + +(script-fu-register "script-fu-set-cmap" + _"Se_t Colormap..." + _"Change the colormap of an image to the colors in a specified palette." + "Kevin Cozens <kcozens@interlog.com>" + "Kevin Cozens" + "September 29, 2004" + "INDEXED*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-PALETTE _"Palette" "Default" +) + +(script-fu-menu-register "script-fu-set-cmap" "<Image>/Colors/Map/Colormap") diff --git a/plug-ins/script-fu/scripts/script-fu-util.scm b/plug-ins/script-fu/scripts/script-fu-util.scm new file mode 100644 index 0000000..a22114d --- /dev/null +++ b/plug-ins/script-fu/scripts/script-fu-util.scm @@ -0,0 +1,94 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +; Resizes the image so as to include the selected layer. +; The resulting image has the selected layer size. +; Copyright (C) 2002 Chauk-Mean PROUM +; +(define (script-fu-util-image-resize-from-layer image layer) + (let* ( + (width (car (gimp-drawable-width layer))) + (height (car (gimp-drawable-height layer))) + (posx (- (car (gimp-drawable-offsets layer)))) + (posy (- (cadr (gimp-drawable-offsets layer)))) + ) + + (gimp-image-resize image width height posx posy) + ) +) + +; Add the specified layers to the image. +; The layers will be added in the given order below the +; active layer. +; +(define (script-fu-util-image-add-layers image . layers) + (while (not (null? layers)) + (let ((layer (car layers))) + (set! layers (cdr layers)) + (gimp-image-insert-layer image layer 0 -1) + (gimp-image-lower-item image layer) + ) + ) +) + +; Allow command line usage of GIMP such as: +; +; gimp -i -b '(with-files "*.png" <body>)' +; +; where <body> is the code that handles whatever processing you want to +; perform on the files. There are four variables that are available +; within the <body>: 'basename', 'image', 'filename' and 'layer'. +; The 'basename' is the name of the file with its extension removed, +; while the other three variables are self-explanatory. +; You basically write your code as though it were processing a single +; 'image' and the 'with-files' macro applies it to all of the files +; matching the pattern. +; +; For example, to invert the colors of all of the PNG files in the +; start directory: +; +; gimp -i -b '(with-files "*.png" (gimp-drawable-invert layer FALSE) \ +; (gimp-file-save 1 image layer filename filename ))' +; +; To do the same thing, but saving them as jpeg instead: +; +; gimp -i -b '(with-files "*.png" (gimp-drawable-invert layer FALSE) \ +; (gimp-file-save 1 image layer \ +; (string-append basename ".jpg") \ +; (string-append basename ".jpg") ))' + +(define-macro (with-files pattern . body) + (let ((loop (gensym)) + (filenames (gensym)) + (filename (gensym))) + `(begin + (let ,loop ((,filenames (cadr (file-glob ,pattern 1)))) + (unless (null? ,filenames) + (let* ((filename (car ,filenames)) + (image (catch #f (car (gimp-file-load RUN-NONINTERACTIVE + filename + filename )))) + (layer (if image (car (gimp-image-get-active-layer image)) #f)) + (basename (unbreakupstr (butlast (strbreakup filename ".")) "."))) + (when image + ,@body + (gimp-image-delete image))) + (,loop (cdr ,filenames)) + ) + ) + ) + ) +) diff --git a/plug-ins/script-fu/scripts/script-fu.init b/plug-ins/script-fu/scripts/script-fu.init new file mode 100644 index 0000000..d0c9e30 --- /dev/null +++ b/plug-ins/script-fu/scripts/script-fu.init @@ -0,0 +1,716 @@ +; Initialization file for TinySCHEME 1.40 + +; Per R5RS, up to four deep compositions should be defined +(define (caar x) (car (car x))) +(define (cadr x) (car (cdr x))) +(define (cdar x) (cdr (car x))) +(define (cddr x) (cdr (cdr x))) +(define (caaar x) (car (car (car x)))) +(define (caadr x) (car (car (cdr x)))) +(define (cadar x) (car (cdr (car x)))) +(define (caddr x) (car (cdr (cdr x)))) +(define (cdaar x) (cdr (car (car x)))) +(define (cdadr x) (cdr (car (cdr x)))) +(define (cddar x) (cdr (cdr (car x)))) +(define (cdddr x) (cdr (cdr (cdr x)))) +(define (caaaar x) (car (car (car (car x))))) +(define (caaadr x) (car (car (car (cdr x))))) +(define (caadar x) (car (car (cdr (car x))))) +(define (caaddr x) (car (car (cdr (cdr x))))) +(define (cadaar x) (car (cdr (car (car x))))) +(define (cadadr x) (car (cdr (car (cdr x))))) +(define (caddar x) (car (cdr (cdr (car x))))) +(define (cadddr x) (car (cdr (cdr (cdr x))))) +(define (cdaaar x) (cdr (car (car (car x))))) +(define (cdaadr x) (cdr (car (car (cdr x))))) +(define (cdadar x) (cdr (car (cdr (car x))))) +(define (cdaddr x) (cdr (car (cdr (cdr x))))) +(define (cddaar x) (cdr (cdr (car (car x))))) +(define (cddadr x) (cdr (cdr (car (cdr x))))) +(define (cdddar x) (cdr (cdr (cdr (car x))))) +(define (cddddr x) (cdr (cdr (cdr (cdr x))))) + +;;;; Utility to ease macro creation +(define (macro-expand form) + ((eval (get-closure-code (eval (car form)))) form)) + +(define (macro-expand-all form) + (if (macro? form) + (macro-expand-all (macro-expand form)) + form)) + +(define *compile-hook* macro-expand-all) + + +(macro (unless form) + `(if (not ,(cadr form)) (begin ,@(cddr form)))) + +(macro (when form) + `(if ,(cadr form) (begin ,@(cddr form)))) + +; DEFINE-MACRO Contributed by Andy Gaynor +(macro (define-macro dform) + (if (symbol? (cadr dform)) + `(macro ,@(cdr dform)) + (let ((form (gensym))) + `(macro (,(caadr dform) ,form) + (apply (lambda ,(cdadr dform) ,@(cddr dform)) (cdr ,form)))))) + +; Utilities for math. Notice that inexact->exact is primitive, +; but exact->inexact is not. +(define exact? integer?) +(define (inexact? x) (and (real? x) (not (integer? x)))) +(define (even? n) (= (remainder n 2) 0)) +(define (odd? n) (not (= (remainder n 2) 0))) +(define (zero? n) (= n 0)) +(define (positive? n) (> n 0)) +(define (negative? n) (< n 0)) +(define complex? number?) +(define rational? real?) +(define (abs n) (if (>= n 0) n (- n))) +(define (exact->inexact n) (* n 1.0)) +(define (<> n1 n2) (not (= n1 n2))) + +; min and max must return inexact if any arg is inexact; use (+ n 0.0) +(define (max . lst) + (foldr (lambda (a b) + (if (> a b) + (if (exact? b) a (+ a 0.0)) + (if (exact? a) b (+ b 0.0)))) + (car lst) (cdr lst))) +(define (min . lst) + (foldr (lambda (a b) + (if (< a b) + (if (exact? b) a (+ a 0.0)) + (if (exact? a) b (+ b 0.0)))) + (car lst) (cdr lst))) + +(define (succ x) (+ x 1)) +(define (pred x) (- x 1)) +(define gcd + (lambda a + (if (null? a) + 0 + (let ((aa (abs (car a))) + (bb (abs (cadr a)))) + (if (= bb 0) + aa + (gcd bb (remainder aa bb))))))) +(define lcm + (lambda a + (if (null? a) + 1 + (let ((aa (abs (car a))) + (bb (abs (cadr a)))) + (if (or (= aa 0) (= bb 0)) + 0 + (abs (* (quotient aa (gcd aa bb)) bb))))))) + + +(define (string . charlist) + (list->string charlist)) + +(define (list->string charlist) + (let* ((len (length charlist)) + (newstr (make-string len)) + (fill-string! + (lambda (str i len charlist) + (if (= i len) + str + (begin (string-set! str i (car charlist)) + (fill-string! str (+ i 1) len (cdr charlist))))))) + (fill-string! newstr 0 len charlist))) + +(define (string-fill! s e) + (let ((n (string-length s))) + (let loop ((i 0)) + (if (= i n) + s + (begin (string-set! s i e) (loop (succ i))))))) + +(define (string->list s) + (let loop ((n (pred (string-length s))) (l '())) + (if (= n -1) + l + (loop (pred n) (cons (string-ref s n) l))))) + +(define (string-copy str) + (string-append str)) + +(define (string->anyatom str pred) + (let* ((a (string->atom str))) + (if (pred a) a + (error "string->xxx: not a xxx" a)))) + +(define (string->number str . base) + (let ((n (string->atom str (if (null? base) 10 (car base))))) + (if (number? n) n #f))) + +(define (anyatom->string n pred) + (if (pred n) + (atom->string n) + (error "xxx->string: not a xxx" n))) + + +(define (number->string n . base) + (atom->string n (if (null? base) 10 (car base)))) + +(define (char-cmp? cmp a b) + (cmp (char->integer a) (char->integer b))) +(define (char-ci-cmp? cmp a b) + (cmp (char->integer (char-downcase a)) (char->integer (char-downcase b)))) + +(define (char=? a b) (char-cmp? = a b)) +(define (char<? a b) (char-cmp? < a b)) +(define (char>? a b) (char-cmp? > a b)) +(define (char<=? a b) (char-cmp? <= a b)) +(define (char>=? a b) (char-cmp? >= a b)) + +(define (char-ci=? a b) (char-ci-cmp? = a b)) +(define (char-ci<? a b) (char-ci-cmp? < a b)) +(define (char-ci>? a b) (char-ci-cmp? > a b)) +(define (char-ci<=? a b) (char-ci-cmp? <= a b)) +(define (char-ci>=? a b) (char-ci-cmp? >= a b)) + +; Note the trick of returning (cmp x y) +(define (string-cmp? chcmp cmp a b) + (let ((na (string-length a)) (nb (string-length b))) + (let loop ((i 0)) + (cond + ((= i na) + (if (= i nb) (cmp 0 0) (cmp 0 1))) + ((= i nb) + (cmp 1 0)) + ((chcmp = (string-ref a i) (string-ref b i)) + (loop (succ i))) + (else + (chcmp cmp (string-ref a i) (string-ref b i))))))) + + +(define (string=? a b) (string-cmp? char-cmp? = a b)) +(define (string<? a b) (string-cmp? char-cmp? < a b)) +(define (string>? a b) (string-cmp? char-cmp? > a b)) +(define (string<=? a b) (string-cmp? char-cmp? <= a b)) +(define (string>=? a b) (string-cmp? char-cmp? >= a b)) + +(define (string-ci=? a b) (string-cmp? char-ci-cmp? = a b)) +(define (string-ci<? a b) (string-cmp? char-ci-cmp? < a b)) +(define (string-ci>? a b) (string-cmp? char-ci-cmp? > a b)) +(define (string-ci<=? a b) (string-cmp? char-ci-cmp? <= a b)) +(define (string-ci>=? a b) (string-cmp? char-ci-cmp? >= a b)) + +(define (list . x) x) + +(define (foldr f x lst) + (if (null? lst) + x + (foldr f (f x (car lst)) (cdr lst)))) + +(define (unzip1-with-cdr . lists) + (unzip1-with-cdr-iterative lists '() '())) + +(define (unzip1-with-cdr-iterative lists cars cdrs) + (if (null? lists) + (cons cars cdrs) + (let ((car1 (caar lists)) + (cdr1 (cdar lists))) + (unzip1-with-cdr-iterative + (cdr lists) + (append cars (list car1)) + (append cdrs (list cdr1)))))) + +(define (map proc . lists) + (if (null? lists) + (apply proc) + (if (null? (car lists)) + '() + (let* ((unz (apply unzip1-with-cdr lists)) + (cars (car unz)) + (cdrs (cdr unz))) + (cons (apply proc cars) (apply map (cons proc cdrs))))))) + +(define (for-each proc . lists) + (if (null? lists) + (apply proc) + (if (null? (car lists)) + #t + (let* ((unz (apply unzip1-with-cdr lists)) + (cars (car unz)) + (cdrs (cdr unz))) + (apply proc cars) (apply map (cons proc cdrs)))))) + +(define (list-tail x k) + (if (zero? k) + x + (list-tail (cdr x) (- k 1)))) + +(define (list-ref x k) + (car (list-tail x k))) + +(define (last-pair x) + (if (pair? (cdr x)) + (last-pair (cdr x)) + x)) + +(define (head stream) (car stream)) + +(define (tail stream) (force (cdr stream))) + +(define (vector-equal? x y) + (and (vector? x) (vector? y) (= (vector-length x) (vector-length y)) + (let ((n (vector-length x))) + (let loop ((i 0)) + (if (= i n) + #t + (and (equal? (vector-ref x i) (vector-ref y i)) + (loop (succ i)))))))) + +(define (list->vector x) + (apply vector x)) + +(define (vector-fill! v e) + (let ((n (vector-length v))) + (let loop ((i 0)) + (if (= i n) + v + (begin (vector-set! v i e) (loop (succ i))))))) + +(define (vector->list v) + (let loop ((n (pred (vector-length v))) (l '())) + (if (= n -1) + l + (loop (pred n) (cons (vector-ref v n) l))))) + +;; The following quasiquote macro is due to Eric S. Tiedemann. +;; Copyright 1988 by Eric S. Tiedemann; all rights reserved. +;; +;; Subsequently modified to handle vectors: D. Souflis + +(macro + quasiquote + (lambda (l) + (define (mcons f l r) + (if (and (pair? r) + (eq? (car r) 'quote) + (eq? (car (cdr r)) (cdr f)) + (pair? l) + (eq? (car l) 'quote) + (eq? (car (cdr l)) (car f))) + (if (or (procedure? f) (number? f) (string? f)) + f + (list 'quote f)) + (if (eqv? l vector) + (apply l (eval r)) + (list 'cons l r) + ))) + (define (mappend f l r) + (if (or (null? (cdr f)) + (and (pair? r) + (eq? (car r) 'quote) + (eq? (car (cdr r)) '()))) + l + (list 'append l r))) + (define (foo level form) + (cond ((not (pair? form)) + (if (or (procedure? form) (number? form) (string? form)) + form + (list 'quote form)) + ) + ((eq? 'quasiquote (car form)) + (mcons form ''quasiquote (foo (+ level 1) (cdr form)))) + (#t (if (zero? level) + (cond ((eq? (car form) 'unquote) (car (cdr form))) + ((eq? (car form) 'unquote-splicing) + (error "Unquote-splicing wasn't in a list:" + form)) + ((and (pair? (car form)) + (eq? (car (car form)) 'unquote-splicing)) + (mappend form (car (cdr (car form))) + (foo level (cdr form)))) + (#t (mcons form (foo level (car form)) + (foo level (cdr form))))) + (cond ((eq? (car form) 'unquote) + (mcons form ''unquote (foo (- level 1) + (cdr form)))) + ((eq? (car form) 'unquote-splicing) + (mcons form ''unquote-splicing + (foo (- level 1) (cdr form)))) + (#t (mcons form (foo level (car form)) + (foo level (cdr form))))))))) + (foo 0 (car (cdr l))))) + +;;;;;Helper for the dynamic-wind definition. By Tom Breton (Tehom) +(define (shared-tail x y) + (let ((len-x (length x)) + (len-y (length y))) + (define (shared-tail-helper x y) + (if + (eq? x y) + x + (shared-tail-helper (cdr x) (cdr y)))) + + (cond + ((> len-x len-y) + (shared-tail-helper + (list-tail x (- len-x len-y)) + y)) + ((< len-x len-y) + (shared-tail-helper + x + (list-tail y (- len-y len-x)))) + (#t (shared-tail-helper x y))))) + +;;;;;Dynamic-wind by Tom Breton (Tehom) + +;;Guarded because we must only eval this once, because doing so +;;redefines call/cc in terms of old call/cc +(unless (defined? 'dynamic-wind) + (let + ;;These functions are defined in the context of a private list of + ;;pairs of before/after procs. + ( (*active-windings* '()) + ;;We'll define some functions into the larger environment, so + ;;we need to know it. + (outer-env (current-environment))) + + ;;Poor-man's structure operations + (define before-func car) + (define after-func cdr) + (define make-winding cons) + + ;;Manage active windings + (define (activate-winding! new) + ((before-func new)) + (set! *active-windings* (cons new *active-windings*))) + (define (deactivate-top-winding!) + (let ((old-top (car *active-windings*))) + ;;Remove it from the list first so it's not active during its + ;;own exit. + (set! *active-windings* (cdr *active-windings*)) + ((after-func old-top)))) + + (define (set-active-windings! new-ws) + (unless (eq? new-ws *active-windings*) + (let ((shared (shared-tail new-ws *active-windings*))) + + ;;Define the looping functions. + ;;Exit the old list. Do deeper ones last. Don't do + ;;any shared ones. + (define (pop-many) + (unless (eq? *active-windings* shared) + (deactivate-top-winding!) + (pop-many))) + ;;Enter the new list. Do deeper ones first so that the + ;;deeper windings will already be active. Don't do any + ;;shared ones. + (define (push-many new-ws) + (unless (eq? new-ws shared) + (push-many (cdr new-ws)) + (activate-winding! (car new-ws)))) + + ;;Do it. + (pop-many) + (push-many new-ws)))) + + ;;The definitions themselves. + (eval + `(define call-with-current-continuation + ;;It internally uses the built-in call/cc, so capture it. + ,(let ((old-c/cc call-with-current-continuation)) + (lambda (func) + ;;Use old call/cc to get the continuation. + (old-c/cc + (lambda (continuation) + ;;Call func with not the continuation itself + ;;but a procedure that adjusts the active + ;;windings to what they were when we made + ;;this, and only then calls the + ;;continuation. + (func + (let ((current-ws *active-windings*)) + (lambda (x) + (set-active-windings! current-ws) + (continuation x))))))))) + outer-env) + ;;We can't just say "define (dynamic-wind before thunk after)" + ;;because the lambda it's defined to lives in this environment, + ;;not in the global environment. + (eval + `(define dynamic-wind + ,(lambda (before thunk after) + ;;Make a new winding + (activate-winding! (make-winding before after)) + (let ((result (thunk))) + ;;Get rid of the new winding. + (deactivate-top-winding!) + ;;The return value is that of thunk. + result))) + outer-env))) + +(define call/cc call-with-current-continuation) + + +;;;;; atom? and equal? written by a.k + +;;;; atom? +(define (atom? x) + (not (pair? x))) + +;;;; equal? +(define (equal? x y) + (cond + ((pair? x) + (and (pair? y) + (equal? (car x) (car y)) + (equal? (cdr x) (cdr y)))) + ((vector? x) + (and (vector? y) (vector-equal? x y))) + ((string? x) + (and (string? y) (string=? x y))) + (else (eqv? x y)))) + +;;;; (do ((var init inc) ...) (endtest result ...) body ...) +;; +(macro do + (lambda (do-macro) + (apply (lambda (do vars endtest . body) + (let ((do-loop (gensym))) + `(letrec ((,do-loop + (lambda ,(map (lambda (x) + (if (pair? x) (car x) x)) + `,vars) + (if ,(car endtest) + (begin ,@(cdr endtest)) + (begin + ,@body + (,do-loop + ,@(map (lambda (x) + (cond + ((not (pair? x)) x) + ((< (length x) 3) (car x)) + (else (car (cdr (cdr x)))))) + `,vars))))))) + (,do-loop + ,@(map (lambda (x) + (if (and (pair? x) (cdr x)) + (car (cdr x)) + '())) + `,vars))))) + do-macro))) + +;;;; generic-member +(define (generic-member cmp obj lst) + (cond + ((null? lst) #f) + ((cmp obj (car lst)) lst) + (else (generic-member cmp obj (cdr lst))))) + +(define (memq obj lst) + (generic-member eq? obj lst)) +(define (memv obj lst) + (generic-member eqv? obj lst)) +(define (member obj lst) + (generic-member equal? obj lst)) + +;;;; generic-assoc +(define (generic-assoc cmp obj alst) + (cond + ((null? alst) #f) + ((cmp obj (caar alst)) (car alst)) + (else (generic-assoc cmp obj (cdr alst))))) + +(define (assq obj alst) + (generic-assoc eq? obj alst)) +(define (assv obj alst) + (generic-assoc eqv? obj alst)) +(define (assoc obj alst) + (generic-assoc equal? obj alst)) + +(define (acons x y z) (cons (cons x y) z)) + +;;;; Handy for imperative programs +;;;; Used as: (define-with-return (foo x y) .... (return z) ...) +(macro (define-with-return form) + `(define ,(cadr form) + (call/cc (lambda (return) ,@(cddr form))))) + +;;;; Simple exception handling +; +; Exceptions are caught as follows: +; +; (catch (do-something to-recover and-return meaningful-value) +; (if-something goes-wrong) +; (with-these calls)) +; +; "Catch" establishes a scope spanning multiple call-frames +; until another "catch" is encountered. +; +; Exceptions are thrown with: +; +; (throw "message") +; +; If used outside a (catch ...), reverts to (error "message) + +(define *handlers* (list)) + +(define (push-handler proc) + (set! *handlers* (cons proc *handlers*))) + +(define (pop-handler) + (let ((h (car *handlers*))) + (set! *handlers* (cdr *handlers*)) + h)) + +(define (more-handlers?) + (pair? *handlers*)) + +(define (throw . x) + (if (more-handlers?) + (apply (pop-handler)) + (apply error x))) + +(macro (catch form) + (let ((label (gensym))) + `(call/cc (lambda (exit) + (push-handler (lambda () (exit ,(cadr form)))) + (let ((,label (begin ,@(cddr form)))) + (pop-handler) + ,label))))) + +(define *error-hook* throw) + + +;;;;; Definition of MAKE-ENVIRONMENT, to be used with two-argument EVAL + +(macro (make-environment form) + `(apply (lambda () + ,@(cdr form) + (current-environment)))) + +(define-macro (eval-polymorphic x . envl) + (display envl) + (let* ((env (if (null? envl) (current-environment) (eval (car envl)))) + (xval (eval x env))) + (if (closure? xval) + (make-closure (get-closure-code xval) env) + xval))) + +; Redefine this if you install another package infrastructure +; Also redefine 'package' +(define *colon-hook* eval) + +;;;;; I/O + +(define (input-output-port? p) + (and (input-port? p) (output-port? p))) + +(define (close-port p) + (cond + ((input-output-port? p) (close-input-port p) (close-output-port p)) + ((input-port? p) (close-input-port p)) + ((output-port? p) (close-output-port p)) + (else (throw "Not a port" p)))) + +(define (call-with-input-file s p) + (let ((inport (open-input-file s))) + (if (eq? inport #f) + #f + (let ((res (p inport))) + (close-input-port inport) + res)))) + +(define (call-with-output-file s p) + (let ((outport (open-output-file s))) + (if (eq? outport #f) + #f + (let ((res (p outport))) + (close-output-port outport) + res)))) + +(define (with-input-from-file s p) + (let ((inport (open-input-file s))) + (if (eq? inport #f) + #f + (let ((prev-inport (current-input-port))) + (set-input-port inport) + (let ((res (p))) + (close-input-port inport) + (set-input-port prev-inport) + res))))) + +(define (with-output-to-file s p) + (let ((outport (open-output-file s))) + (if (eq? outport #f) + #f + (let ((prev-outport (current-output-port))) + (set-output-port outport) + (let ((res (p))) + (close-output-port outport) + (set-output-port prev-outport) + res))))) + +(define (with-input-output-from-to-files si so p) + (let ((inport (open-input-file si)) + (outport (open-input-file so))) + (if (not (and inport outport)) + (begin + (close-input-port inport) + (close-output-port outport) + #f) + (let ((prev-inport (current-input-port)) + (prev-outport (current-output-port))) + (set-input-port inport) + (set-output-port outport) + (let ((res (p))) + (close-input-port inport) + (close-output-port outport) + (set-input-port prev-inport) + (set-output-port prev-outport) + res))))) + +; Random number generator (maximum cycle) +(define *seed* 1) +(define (random-next) + (let* ((a 16807) (m 2147483647) (q (quotient m a)) (r (modulo m a))) + (set! *seed* + (- (* a (- *seed* + (* (quotient *seed* q) q))) + (* (quotient *seed* q) r))) + (if (< *seed* 0) (set! *seed* (+ *seed* m))) + *seed*)) +;; SRFI-0 +;; COND-EXPAND +;; Implemented as a macro +(define *features* '(srfi-0 tinyscheme)) + +(define-macro (cond-expand . cond-action-list) + (cond-expand-runtime cond-action-list)) + +(define (cond-expand-runtime cond-action-list) + (if (null? cond-action-list) + #t + (if (cond-eval (caar cond-action-list)) + `(begin ,@(cdar cond-action-list)) + (cond-expand-runtime (cdr cond-action-list))))) + +(define (cond-eval-and cond-list) + (foldr (lambda (x y) (and (cond-eval x) (cond-eval y))) #t cond-list)) + +(define (cond-eval-or cond-list) + (foldr (lambda (x y) (or (cond-eval x) (cond-eval y))) #f cond-list)) + +(define (cond-eval condition) + (cond + ((symbol? condition) + (if (member condition *features*) #t #f)) + ((eq? condition #t) #t) + ((eq? condition #f) #f) + (else (case (car condition) + ((and) (cond-eval-and (cdr condition))) + ((or) (cond-eval-or (cdr condition))) + ((not) (if (not (null? (cddr condition))) + (error "cond-expand : 'not' takes 1 argument") + (not (cond-eval (cadr condition))))) + (else (error "cond-expand : unknown operator" (car condition))))))) + +(gc-verbose #f) diff --git a/plug-ins/script-fu/scripts/select-to-brush.scm b/plug-ins/script-fu/scripts/select-to-brush.scm new file mode 100644 index 0000000..c4ccf87 --- /dev/null +++ b/plug-ins/script-fu/scripts/select-to-brush.scm @@ -0,0 +1,144 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Selection-to-brush +; Copyright (c) 1997 Adrian Likins +; aklikins@eos.ncsu.edu +; +; Takes the current selection, saves it as a brush, and makes it the +; active brush.. +; +; Parts of this script from Sven Neuman's Drop-Shadow and +; Seth Burgess's mkbrush scripts. +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-selection-to-brush image + drawable + name + filename + spacing) + (let* ( + (type (car (gimp-drawable-type-with-alpha drawable))) + (selection-bounds (gimp-selection-bounds image)) + (select-offset-x (cadr selection-bounds)) + (select-offset-y (caddr selection-bounds)) + (selection-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (selection-height (- (caddr (cddr selection-bounds)) select-offset-y)) + (from-selection 0) + (active-selection 0) + (brush-draw-type 0) + (brush-image-type 0) + (brush-image 0) + (brush-draw 0) + (filename2 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable image) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! from-selection FALSE) + ) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))) + ) + ) + + (gimp-edit-copy drawable) + + (set! brush-draw-type + (if (= type GRAYA-IMAGE) + GRAY-IMAGE + RGBA-IMAGE)) + + (set! brush-image-type + (if (= type GRAYA-IMAGE) + GRAY + RGB)) + + (set! brush-image (car (gimp-image-new selection-width + selection-height + brush-image-type))) + + (set! brush-draw + (car (gimp-layer-new brush-image + selection-width + selection-height + brush-draw-type + "Brush" + 100 + LAYER-MODE-NORMAL))) + + (gimp-image-insert-layer brush-image brush-draw 0 0) + + (gimp-selection-none brush-image) + + (if (= type GRAYA-IMAGE) + (begin + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-fill brush-draw FILL-BACKGROUND)) + (gimp-drawable-fill brush-draw FILL-TRANSPARENT) + ) + + (let ((floating-sel (car (gimp-edit-paste brush-draw FALSE)))) + (gimp-floating-sel-anchor floating-sel) + ) + + (set! filename2 (string-append gimp-directory + "/brushes/" + filename + (number->string image) + ".gbr")) + + (file-gbr-save 1 brush-image brush-draw filename2 "" spacing name) + + (if (= from-selection TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-image-remove-channel image active-selection) + ) + ) + + (gimp-image-undo-enable image) + (gimp-image-set-active-layer image drawable) + (gimp-image-delete brush-image) + (gimp-displays-flush) + + (gimp-context-pop) + + (gimp-brushes-refresh) + (gimp-context-set-brush name) + ) +) + +(script-fu-register "script-fu-selection-to-brush" + _"To _Brush..." + _"Convert a selection to a brush" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "10/07/97" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-STRING _"_Brush name" "My Brush" + SF-STRING _"_File name" "mybrush" + SF-ADJUSTMENT _"_Spacing" '(25 0 1000 1 1 1 0) +) diff --git a/plug-ins/script-fu/scripts/select-to-image.scm b/plug-ins/script-fu/scripts/select-to-image.scm new file mode 100644 index 0000000..dec088d --- /dev/null +++ b/plug-ins/script-fu/scripts/select-to-image.scm @@ -0,0 +1,89 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Selection to Image +; Copyright (c) 1997 Adrian Likins +; aklikins@eos.ncsu.edu +; +; Takes the Current selection and saves it as a separate image. +; +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-selection-to-image image drawable) + (let* ( + (draw-type (car (gimp-drawable-type-with-alpha drawable))) + (image-type (car (gimp-image-base-type image))) + (selection-bounds (gimp-selection-bounds image)) + (select-offset-x (cadr selection-bounds)) + (select-offset-y (caddr selection-bounds)) + (selection-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (selection-height (- (caddr (cddr selection-bounds)) select-offset-y)) + (active-selection 0) + (from-selection 0) + (new-image 0) + (new-draw 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable image) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! active-selection (car (gimp-selection-save image))) + (set! from-selection FALSE) + ) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))) + ) + ) + + (gimp-edit-copy drawable) + + (set! new-image (car (gimp-image-new selection-width + selection-height image-type))) + (set! new-draw (car (gimp-layer-new new-image + selection-width selection-height + draw-type "Selection" 100 LAYER-MODE-NORMAL))) + (gimp-image-insert-layer new-image new-draw 0 0) + (gimp-drawable-fill new-draw FILL-BACKGROUND) + + (let ((floating-sel (car (gimp-edit-paste new-draw FALSE)))) + (gimp-floating-sel-anchor floating-sel) + ) + + (gimp-image-undo-enable image) + (gimp-image-set-active-layer image drawable) + (gimp-display-new new-image) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-selection-to-image" + _"To _Image" + _"Convert a selection to an image" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "10/07/97" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 +) diff --git a/plug-ins/script-fu/scripts/select-to-pattern.scm b/plug-ins/script-fu/scripts/select-to-pattern.scm new file mode 100644 index 0000000..6b2f9eb --- /dev/null +++ b/plug-ins/script-fu/scripts/select-to-pattern.scm @@ -0,0 +1,103 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Based on select-to-brush by +; Copyright (c) 1997 Adrian Likins aklikins@eos.ncsu.edu +; Author Cameron Gregory, http://www.flamingtext.com/ +; +; Takes the current selection, saves it as a pattern and makes it the active +; pattern +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-selection-to-pattern image drawable desc filename) + + (let* ( + (selection-width 0) + (selection-height 0) + (selection-bounds 0) + (select-offset-x 0) + (select-offset-y 0) + (pattern-draw-type 0) + (pattern-image-type 0) + (pattern-image 0) + (pattern-draw 0) + (filename2 0) + ) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (set! selection-width (car (gimp-drawable-width drawable))) + (set! selection-height (car (gimp-drawable-height drawable))) + ) + (begin + (set! selection-bounds (gimp-drawable-mask-bounds drawable)) + (set! select-offset-x (cadr selection-bounds)) + (set! select-offset-y (caddr selection-bounds)) + (set! selection-width (- (cadr (cddr selection-bounds)) select-offset-x)) + (set! selection-height (- (caddr (cddr selection-bounds)) select-offset-y)) + ) + ) + + (if (= (car (gimp-drawable-has-alpha drawable)) TRUE) + (set! pattern-draw-type RGBA-IMAGE) + (set! pattern-draw-type RGB-IMAGE) + ) + + (set! pattern-image-type RGB) + + (set! pattern-image (car (gimp-image-new selection-width selection-height + pattern-image-type))) + + (set! pattern-draw + (car (gimp-layer-new pattern-image selection-width selection-height + pattern-draw-type "Pattern" 100 LAYER-MODE-NORMAL))) + + (gimp-drawable-fill pattern-draw FILL-TRANSPARENT) + + (gimp-image-insert-layer pattern-image pattern-draw 0 0) + + (gimp-edit-copy drawable) + + (let ((floating-sel (car (gimp-edit-paste pattern-draw FALSE)))) + (gimp-floating-sel-anchor floating-sel)) + + (set! filename2 (string-append gimp-directory + "/patterns/" + filename + (number->string image) + ".pat")) + + (file-pat-save 1 pattern-image pattern-draw filename2 "" desc) + (gimp-patterns-refresh) + (gimp-context-set-pattern desc) + + (gimp-image-delete pattern-image) + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-selection-to-pattern" + _"To _Pattern..." + _"Convert a selection to a pattern" + "Cameron Gregory <cameron@bloke.com>" + "Cameron Gregory" + "09/02/2003" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-STRING _"_Pattern name" "My Pattern" + SF-STRING _"_File name" "mypattern" +) diff --git a/plug-ins/script-fu/scripts/selection-round.scm b/plug-ins/script-fu/scripts/selection-round.scm new file mode 100644 index 0000000..afbc91c --- /dev/null +++ b/plug-ins/script-fu/scripts/selection-round.scm @@ -0,0 +1,164 @@ +; selection-rounded-rectangle.scm -*-scheme-*- + +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + +; CHANGE-LOG: +; 1.00 - initial release +; 1.01 - some code cleanup, no real changes +; 1.02 - made script undoable + +; 2.00 - ALAN's Branch. changed name, menu, location, and description +; 2.01 - fixed to work if there was no current selection. +; 2.02 - changed scale to percentages, usability tweaking. +; 2.10 - added concave round edges, updated description. +; 2.11 - tweeked description, changed comments, relinquished any rights. + +; Copyright (C) 1997, 1998, Sven Neumann +; Copyright (C) 2004, Alan Horkan. +; Alan Horkan relinquishes all rights to his changes, +; full ownership of this script belongs to Sven Neumann. + +(define (script-fu-selection-rounded-rectangle image drawable radius concave) + (gimp-image-undo-group-start image) + + (if (= (car (gimp-selection-is-empty image)) TRUE) (gimp-selection-all image)) + (let* ( + (radius (/ radius 100)) ; convert from percentages + (radius (min radius 1.0)) + (radius (max radius 0.0)) + (select-bounds (gimp-selection-bounds image)) + (has-selection (car select-bounds)) + (select-x1 (cadr select-bounds)) + (select-y1 (caddr select-bounds)) + (select-x2 (cadr (cddr select-bounds))) + (select-y2 (caddr (cddr select-bounds))) + (select-width (- select-x2 select-x1)) + (select-height (- select-y2 select-y1)) + (cut-radius 0) + (ellipse-radius 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + ;; select to the full bounds of the selection, + ;; fills in irregular shapes or holes. + (gimp-image-select-rectangle image CHANNEL-OP-ADD + select-x1 select-y1 select-width select-height) + + (if (> select-width select-height) + (set! cut-radius (trunc (+ 1 (* radius (/ select-height 2))))) + (set! cut-radius (trunc (+ 1 (* radius (/ select-width 2))))) + ) + (set! ellipse-radius (* cut-radius 2)) + + (gimp-context-set-antialias TRUE) + ;; cut away rounded (concave) corners + ; top right + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT + (- select-x1 cut-radius) + (- select-y1 cut-radius) + (* cut-radius 2) + (* cut-radius 2)) + ; lower left + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT + (- select-x1 cut-radius) + (- select-y2 cut-radius) + (* cut-radius 2) + (* cut-radius 2)) + ; top right + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT + (- select-x2 cut-radius) + (- select-y1 cut-radius) + (* cut-radius 2) + (* cut-radius 2)) + ; bottom left + (gimp-image-select-ellipse image CHANNEL-OP-SUBTRACT + (- select-x2 cut-radius) + (- select-y2 cut-radius) + (* cut-radius 2) + (* cut-radius 2)) + + ;; add in rounded (convex) corners + (if (= concave FALSE) + (begin + (gimp-image-select-ellipse image + CHANNEL-OP-ADD + select-x1 + select-y1 + ellipse-radius + ellipse-radius) + (gimp-image-select-ellipse image + CHANNEL-OP-ADD + select-x1 + (- select-y2 ellipse-radius) + ellipse-radius + ellipse-radius) + (gimp-image-select-ellipse image + CHANNEL-OP-ADD + (- select-x2 ellipse-radius) + select-y1 + ellipse-radius + ellipse-radius) + (gimp-image-select-ellipse image + CHANNEL-OP-ADD + (- select-x2 ellipse-radius) + (- select-y2 ellipse-radius) + ellipse-radius + ellipse-radius) + ) + ) + + (gimp-image-undo-group-end image) + (gimp-displays-flush) + (gimp-context-pop) + ) +) + + +(define (script-fu-selection-round image drawable radius) + (script-fu-selection-rounded-rectangle image drawable (* radius 100) FALSE) +) + + +(script-fu-register "script-fu-selection-rounded-rectangle" + _"Rounded R_ectangle..." + _"Round the corners of the current selection" + "Alan Horkan, Sven Neumann" ; authors + "Sven Neumann" ; copyright + "2004/06/07" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"R_adius (%)" '(50 0 100 1 10 0 0) + SF-TOGGLE _"Co_ncave" FALSE +) + +(script-fu-register "script-fu-selection-round" + "" + "This procedure is deprecated! Use 'script-fu-selection-rounded-rectangle' instead." + "Sven Neumann" ; authors + "Sven Neumann" ; copyright + "1998/02/06" + "*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT "Relative radius" '(1 0 128 0.1 1 1 1) +) + +(script-fu-menu-register "script-fu-selection-rounded-rectangle" + "<Image>/Select/Modify") diff --git a/plug-ins/script-fu/scripts/slide.scm b/plug-ins/script-fu/scripts/slide.scm new file mode 100644 index 0000000..4889d62 --- /dev/null +++ b/plug-ins/script-fu/scripts/slide.scm @@ -0,0 +1,261 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; slide.scm version 0.41 2004/03/28 +; +; CHANGE-LOG: +; 0.20 - first public release +; 0.30 - some code cleanup +; now uses the rotate plug-in to improve speed +; 0.40 - changes to work with gimp-1.1 +; if the image was rotated, rotate the whole thing back when finished +; 0.41 - changes to work with gimp-2.0, slightly correct text offsets, +; Nils Philippsen <nphilipp@redhat.com> 2004/03/28 +; +; !still in development! +; TODO: - change the script so that the film is rotated, not the image +; - antialiasing +; - make 'add background' an option +; - ? +; +; Copyright (C) 1997-1999 Sven Neumann <sven@gimp.org> +; +; makes your picture look like a slide +; +; The script works on RGB and grayscale images that contain only +; one layer. The image is cropped to fit into an aspect ratio of 1:1,5. +; It creates a copy of the image or can optionally work on the original. +; The script uses the current background color to create a background +; layer. + + +(define (script-fu-slide img + drawable + text + number + fontname + font-color + work-on-copy) + + (define (crop width height ratio) + (if (>= width (* ratio height)) + (* ratio height) + width + ) + ) + + (let* ( + (type (car (gimp-drawable-type-with-alpha drawable))) + (image (cond ((= work-on-copy TRUE) + (car (gimp-image-duplicate img))) + ((= work-on-copy FALSE) + img))) + (owidth (car (gimp-image-width image))) + (oheight (car (gimp-image-height image))) + (ratio (if (>= owidth oheight) (/ 3 2) + (/ 2 3))) + (crop-width (crop owidth oheight ratio)) + (crop-height (/ crop-width ratio)) + (width (* (max crop-width crop-height) 1.05)) + (height (* (min crop-width crop-height) 1.5)) + (hole-width (/ width 20)) + (hole-space (/ width 8)) + (hole-height (/ width 12)) + (hole-radius (/ hole-width 4)) + (hole-start (- (/ (rand 1000) 1000) 0.5)) + (film-layer (car (gimp-layer-new image + width + height + type + "Film" + 100 + LAYER-MODE-NORMAL))) + (bg-layer (car (gimp-layer-new image + width + height + type + "Background" + 100 + LAYER-MODE-NORMAL))) + (pic-layer (car (gimp-image-get-active-drawable image))) + (numbera (string-append number "A")) + ) + + (gimp-context-push) + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + (gimp-context-set-feather FALSE) + + (if (= work-on-copy TRUE) + (gimp-image-undo-disable image) + (gimp-image-undo-group-start image) + ) + +; add an alpha channel to the image + (gimp-layer-add-alpha pic-layer) + +; crop, resize and eventually rotate the image + (gimp-image-crop image + crop-width + crop-height + (/ (- owidth crop-width) 2) + (/ (- oheight crop-height) 2)) + (gimp-image-resize image + width + height + (/ (- width crop-width) 2) + (/ (- height crop-height) 2)) + (if (< ratio 1) + (plug-in-rotate RUN-NONINTERACTIVE image pic-layer 1 FALSE) + ) + +; add the background layer + (gimp-drawable-fill bg-layer FILL-BACKGROUND) + (gimp-image-insert-layer image bg-layer 0 -1) + +; add the film layer + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-fill film-layer FILL-BACKGROUND) + (gimp-image-insert-layer image film-layer 0 -1) + +; add the text + (gimp-context-set-foreground font-color) + (gimp-floating-sel-anchor (car (gimp-text-fontname image + film-layer + (+ hole-start (* -0.25 width)) + (* 0.01 height) + text + 0 + TRUE + (* 0.040 height) PIXELS fontname))) + (gimp-floating-sel-anchor (car (gimp-text-fontname image + film-layer + (+ hole-start (* 0.75 width)) + (* 0.01 height) + text + 0 + TRUE + (* 0.040 height) PIXELS + fontname ))) + (gimp-floating-sel-anchor (car (gimp-text-fontname image + film-layer + (+ hole-start (* 0.35 width)) + 0.0 + number + 0 + TRUE + (* 0.050 height) PIXELS + fontname ))) + (gimp-floating-sel-anchor (car (gimp-text-fontname image + film-layer + (+ hole-start (* 0.35 width)) + (* 0.94 height) + number + 0 + TRUE + (* 0.050 height) PIXELS + fontname ))) + (gimp-floating-sel-anchor (car (gimp-text-fontname image + film-layer + (+ hole-start (* 0.85 width)) + (* 0.945 height) + numbera + 0 + TRUE + (* 0.045 height) PIXELS + fontname ))) + +; create a mask for the holes and cut them out + (let* ( + (film-mask (car (gimp-layer-create-mask film-layer ADD-MASK-WHITE))) + (hole hole-start) + (top-y (* height 0.06)) + (bottom-y (* height 0.855)) + ) + + (gimp-layer-add-mask film-layer film-mask) + + (gimp-selection-none image) + (while (< hole 8) + (gimp-image-select-rectangle image + CHANNEL-OP-ADD + (* hole-space hole) + top-y + hole-width + hole-height) + (gimp-image-select-rectangle image + CHANNEL-OP-ADD + (* hole-space hole) + bottom-y + hole-width + hole-height) + (set! hole (+ hole 1)) + ) + + (gimp-context-set-foreground '(0 0 0)) + (gimp-drawable-edit-fill film-mask FILL-BACKGROUND) + (gimp-selection-none image) + (plug-in-gauss-rle RUN-NONINTERACTIVE image film-mask hole-radius TRUE TRUE) + (gimp-threshold film-mask 127 255) + + (gimp-layer-remove-mask film-layer MASK-APPLY) + ) + +; reorder the layers + (gimp-image-raise-item image pic-layer) + (gimp-image-raise-item image pic-layer) + +; eventually rotate the whole thing back + (if (< ratio 1) + (plug-in-rotate RUN-NONINTERACTIVE image pic-layer 3 TRUE) + ) + +; clean up after the script + (gimp-selection-none image) + + (if (= work-on-copy TRUE) + (begin + (gimp-display-new image) + (gimp-image-undo-enable image) + ) + (gimp-image-undo-group-end image) + ) + + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-slide" + _"_Slide..." + _"Add a slide-film like frame, sprocket holes, and labels to an image" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "2004/03/28" + "RGB GRAY" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-STRING _"Text" "GIMP" + SF-STRING _"Number" "32" + SF-FONT _"Font" "Serif" + SF-COLOR _"Font color" '(255 180 0) + SF-TOGGLE _"Work on copy" TRUE +) + +(script-fu-menu-register "script-fu-slide" + "<Image>/Filters/Decor") diff --git a/plug-ins/script-fu/scripts/spinning-globe.scm b/plug-ins/script-fu/scripts/spinning-globe.scm new file mode 100644 index 0000000..1549830 --- /dev/null +++ b/plug-ins/script-fu/scripts/spinning-globe.scm @@ -0,0 +1,110 @@ +; +; anim_sphere +; +; +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +; Define the function: + +(define (script-fu-spinning-globe inImage + inLayer + inFrames + inFromLeft + inTransparent + inIndex + inCopy) + (let* ( + (theImage (if (= inCopy TRUE) + (car (gimp-image-duplicate inImage)) + inImage)) + (theLayer (car (gimp-image-get-active-layer theImage))) + (n 0) + (ang (* (/ 360 inFrames) + (if (= inFromLeft TRUE) 1 -1) )) + (theFrame 0) + ) + + (gimp-layer-add-alpha theLayer) + + (while (> inFrames n) + (set! n (+ n 1)) + (set! theFrame (car (gimp-layer-copy theLayer FALSE))) + (gimp-image-insert-layer theImage theFrame 0 0) + (gimp-item-set-name theFrame + (string-append "Anim Frame: " + (number->string (- inFrames n) 10) + " (replace)")) + (plug-in-map-object RUN-NONINTERACTIVE + theImage theFrame ; mapping + 1 ; viewpoint + 0.5 0.5 2.0 ; object pos + 0.5 0.5 0.0 ; first axis + 1.0 0.0 0.0 ; 2nd axis + 0.0 1.0 0.0 ; axis rotation + 0.0 (* n ang) 0.0 ; light (type, color) + 0 '(255 255 255) ; light position + -0.5 -0.5 2.0 ; light direction + -1.0 -1.0 1.0 ; material (amb, diff, refl, spec, high) + 0.3 1.0 0.5 0.0 27.0 ; antialias + TRUE ; tile + FALSE ; new image + FALSE ; transparency + inTransparent ; radius + 0.25 ; unused parameters + 1.0 1.0 1.0 1.0 + -1 -1 -1 -1 -1 -1 -1 -1 + ) + ) + + (gimp-image-remove-layer theImage theLayer) + (plug-in-autocrop RUN-NONINTERACTIVE theImage theFrame) + + (if (= inIndex 0) + () + (gimp-image-convert-indexed theImage CONVERT-DITHER-FS CONVERT-PALETTE-GENERATE inIndex + FALSE FALSE "")) + + (if (= inCopy TRUE) + (begin + (gimp-image-clean-all theImage) + (gimp-display-new theImage) + ) + ) + + (gimp-displays-flush) + ) +) + +(script-fu-register + "script-fu-spinning-globe" + _"_Spinning Globe..." + _"Create an animation by mapping the current image onto a spinning sphere" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "16th April 1998" + "RGB* GRAY*" + SF-IMAGE "The Image" 0 + SF-DRAWABLE "The Layer" 0 + SF-ADJUSTMENT _"Frames" '(10 1 360 1 10 0 1) + SF-TOGGLE _"Turn from left to right" FALSE + SF-TOGGLE _"Transparent background" TRUE + SF-ADJUSTMENT _"Index to n colors (0 = remain RGB)" '(63 0 256 1 10 0 1) + SF-TOGGLE _"Work on copy" TRUE +) + +(script-fu-menu-register "script-fu-spinning-globe" + "<Image>/Filters/Animation/Animators") diff --git a/plug-ins/script-fu/scripts/spyrogimp.scm b/plug-ins/script-fu/scripts/spyrogimp.scm new file mode 100644 index 0000000..0a1e40c --- /dev/null +++ b/plug-ins/script-fu/scripts/spyrogimp.scm @@ -0,0 +1,352 @@ +; spyrogimp.scm -*-scheme-*- +; Draws Spirographs, Epitrochoids and Lissajous Curves. +; More info at http://www.wisdom.weizmann.ac.il/~elad/spyrogimp/ +; Version 1.2 +; +; Copyright (C) 2003 by Elad Shahar <elad@wisdom.weizmann.ac.il> +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +; This routine is invoked by a dialog. +; It is the main routine in this file. +(define (script-fu-spyrogimp img drw + type shape + oteeth iteeth + margin hole-ratio start-angle + tool brush + color-method color grad) + + ; Internal function to draw the spyro. + (define (script-fu-spyrogimp-internal img drw + x1 y1 x2 y2 ; Bounding box. + type ; = 0 (Spirograph), 1 (Epitrochoid), 2(Lissajous) . + shape ; = 0 (Circle), 1 (Frame), >2 (Polygons) . + oteeth iteeth ; Outer and inner teeth. + margin hole-ratio + start-angle ; 0 <= start-angle < 360 . + tool ; = 0 (Pencil), 1 (Brush), 2 (Airbrush) . + brush + color-method ; = 0 (Single color), 1 (Grad. Loop Sawtooth), + ; 2 (Grad. Loop triangle) . + color ; Used when color-method = Single color . + grad ; Gradient used in Gradient color methods. + ) + + + ; This function returns a list of samples according to the gradient. + (define (get-gradient steps color-method grad) + (if (= color-method 1) + ; option 1 + ; Just return the gradient + (gimp-gradient-get-uniform-samples grad (min steps 50) FALSE) + + ; option 2 + ; The returned list is such that the gradient appears two times, once + ; in the normal order and once in reverse. This way there are no color + ; jumps if we go beyond the edge + (let* ( + ; Sample the gradient into array "gr". + (gr (gimp-gradient-get-uniform-samples grad + (/ (min steps 50) 2) + FALSE)) + + (grn (car gr)) ; length of sample array. + (gra (cadr gr)) ; array of color samples (R1,G1,B1,A1, R2,....) + + ; Allocate array gra-new of size (2 * grn) - 8, + ; but since each 4 items is actually one (RGBA) tuple, + ; it contains 2x - 2 entries. + (grn-new (+ grn grn -8)) + (gra-new (cons-array grn-new 'double)) + + (gr-index 0) + (gr-index2 0) + ) + + ; Copy original array gra to gra_new. + (while (< gr-index grn) + (aset gra-new gr-index (aref gra gr-index)) + (set! gr-index (+ 1 gr-index)) + ) + + ; Copy second time, but in reverse + (set! gr-index2 (- gr-index 8)) + (while (< gr-index grn-new) + (aset gra-new gr-index (aref gra gr-index2)) + (set! gr-index (+ 1 gr-index)) + (set! gr-index2 (+ 1 gr-index2)) + + (if (= (fmod gr-index 4) 0) + (set! gr-index2 (- gr-index2 8)) + ) + ) + + ; Return list. + (list grn-new gra-new) + ) + ) + ) + + + (let* ( + (steps (+ 1 (lcm oteeth iteeth))) + (*points* (cons-array (* steps 2) 'double)) + + (ot 0) ; current outer tooth + (cx 0) ; Current x,y + (cy 0) + + ; If its a polygon or frame, how many sides does it have. + (poly (if (= shape 1) 4 ; A frame has four sides. + (if (> shape 1) (+ shape 1) 0))) + + (2pi (* 2 *pi*)) + + (drw-width (- x2 x1)) + (drw-height (- y2 y1)) + (half-width (/ drw-width 2)) + (half-height (/ drw-height 2)) + (midx (+ x1 half-width)) + (midy (+ y1 half-height)) + + (hole (* hole-ratio + (- (/ (min drw-width drw-height) 2) margin) + ) + ) + (irad (+ hole margin)) + + (radx (- half-width irad)) ; + (rady (- half-height irad)) ; + + (gradt (get-gradient steps color-method grad)) + (grada (cadr gradt)) ; Gradient array. + (gradn (car gradt)) ; Number of entries of gradients. + + ; Indexes + (grad-index 0) ; for array: grada + (point-index 0) ; for array: *points* + (index 0) + ) + + ; Do one step of the loop. + (define (calc-and-step!) + (let* ( + (oangle (* 2pi (/ ot oteeth)) ) + (shifted-oangle (+ oangle (* 2pi (/ start-angle 360))) ) + (xfactor (cos shifted-oangle)) + (yfactor (sin shifted-oangle)) + (lenfactor 1) + (ofactor (/ (+ oteeth iteeth) iteeth)) + + ; The direction of the factor changes according + ; to whether the type is a sypro or an epitcorhoid. + (mfactor (if (= type 0) (- ofactor) ofactor)) + ) + + ; If we are drawing a polygon then compute a contortion + ; factor "lenfactor" which deforms the standard circle. + (if (> poly 2) + (let* ( + (pi4 (/ *pi* poly)) + (pi2 (* pi4 2)) + + (oanglemodpi2 (fmod (+ oangle + (if (= 1 (fmod poly 2)) + 0 ;(/ pi4 2) + 0 + ) + ) + pi2)) + ) + + (set! lenfactor (/ ( if (= shape 1) 1 (cos pi4) ) + (cos + (if (< oanglemodpi2 pi4) + oanglemodpi2 + (- pi2 oanglemodpi2) + ) + ) + ) + ) + ) + ) + + (if (= type 2) + (begin ; Lissajous + (set! cx (+ midx + (* half-width (cos shifted-oangle)) )) + (set! cy (+ midy + (* half-height (cos (* mfactor oangle))) )) + ) + (begin ; Spyrograph or Epitrochoid + (set! cx (+ midx + (* radx xfactor lenfactor) + (* hole (cos (* mfactor oangle) ) ) )) + (set! cy (+ midy + (* rady yfactor lenfactor) + (* hole (sin (* mfactor oangle) ) ) )) + ) + ) + + ;; Advance teeth + (set! ot (+ ot 1)) + ) + ) + + + ;; Draw all the points in *points* with appropriate tool. + (define (flush-points len) + (if (= tool 0) + (gimp-pencil drw len *points*) ; Use pencil + (if (= tool 1) + (gimp-paintbrush-default drw len *points*); use paintbrush + (gimp-airbrush-default drw len *points*) ; use airbrush + ) + ) + + ; Reset points array, but copy last point to first + ; position so it will connect the next time. + (aset *points* 0 (aref *points* (- point-index 2))) + (aset *points* 1 (aref *points* (- point-index 1))) + (set! point-index 2) + ) + + ;; + ;; Execution starts here. + ;; + + (gimp-context-push) + + (gimp-image-undo-group-start img) + + ; Set new color, brush, opacity, paint mode. + (gimp-context-set-foreground color) + (gimp-context-set-brush (car brush)) + (gimp-context-set-opacity (car (cdr brush))) + (gimp-context-set-paint-mode (car (cdr (cdr (cdr brush))))) + + (gimp-progress-set-text _"Rendering Spyro") + + (while (< index steps) + + (calc-and-step!) + + (aset *points* point-index cx) + (aset *points* (+ point-index 1) cy) + (set! point-index (+ point-index 2)) + + ; Change color and draw points if using gradient. + (if (< 0 color-method) ; use gradient. + (if (< (/ (+ grad-index 4) gradn) (/ index steps)) + (begin + (gimp-context-set-foreground + (list + (* 255 (aref grada grad-index)) + (* 255 (aref grada (+ 1 grad-index)) ) + (* 255 (aref grada (+ 2 grad-index)) ) + ) + ) + (gimp-context-set-opacity (* 100 (aref grada (+ 3 grad-index) ) ) ) + (set! grad-index (+ 4 grad-index)) + + ; Draw points + (flush-points point-index) + ) + ) + ) + + (set! index (+ index 1)) + + (if (= 0 (modulo index 16)) + (gimp-progress-update (/ index steps)) + ) + ) + + ; Draw remaining points. + (flush-points point-index) + + (gimp-progress-update 1.0) + + (gimp-image-undo-group-end img) + (gimp-displays-flush) + + (gimp-context-pop) + ) + ) + + (let* ( + ; Get current selection to determine where to draw. + (bounds (cdr (gimp-selection-bounds img))) + (x1 (car bounds)) + (y1 (cadr bounds)) + (x2 (caddr bounds)) + (y2 (car (cdddr bounds))) + ) + + (set! oteeth (trunc (+ oteeth 0.5))) + (set! iteeth (trunc (+ iteeth 0.5))) + + (script-fu-spyrogimp-internal img drw + x1 y1 x2 y2 + type shape + oteeth iteeth + margin hole-ratio start-angle + tool brush + color-method color grad) + ) +) + + + +(script-fu-register "script-fu-spyrogimp" + _"_Spyrogimp (older script-fu version)..." + _"This procedure is deprecated! Use 'plug-in-spyrogimp' instead." + "Elad Shahar <elad@wisdom.weizmann.ac.il>" + "Elad Shahar" + "June 2003" + "RGB*, INDEXED*, GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + + SF-OPTION _"Type" '(_"Spyrograph" + _"Epitrochoid" + _"Lissajous") + SF-OPTION _"Shape" '(_"Circle" + _"Frame" + _"Triangle" + _"Square" + _"Pentagon" + _"Hexagon" + _"Polygon: 7 sides" + _"Polygon: 8 sides" + _"Polygon: 9 sides" + _"Polygon: 10 sides") + SF-ADJUSTMENT _"Outer teeth" '(86 1 120 1 10 0 0) + SF-ADJUSTMENT _"Inner teeth" '(70 1 120 1 10 0 0) + SF-ADJUSTMENT _"Margin (pixels)" '(0 -10000 10000 1 10 0 1) + SF-ADJUSTMENT _"Hole ratio" '(0.4 0.0 1.0 0.01 0.1 2 0) + SF-ADJUSTMENT _"Start angle" '(0 0 359 1 10 0 0) + + SF-OPTION _"Tool" '(_"Pencil" + _"Brush" + _"Airbrush") + SF-BRUSH _"Brush" '("Circle (01)" 100 -1 0) + + SF-OPTION _"Color method" '(_"Solid Color" + _"Gradient: Loop Sawtooth" + _"Gradient: Loop Triangle") + SF-COLOR _"Color" "black" + SF-GRADIENT _"Gradient" "Deep Sea" +) diff --git a/plug-ins/script-fu/scripts/test-sphere.scm b/plug-ins/script-fu/scripts/test-sphere.scm new file mode 100644 index 0000000..5d55602 --- /dev/null +++ b/plug-ins/script-fu/scripts/test-sphere.scm @@ -0,0 +1,307 @@ +; This is a a test script to show and test the possibilities of the +; Script-Fu parameter API. +; +; ---------------------------------------------------------------------- +; SF-ADJUSTMENT +; is only useful in interactive mode, if you call a script from +; the console, it acts just like a normal SF-VALUE +; In interactive mode it creates an adjustment widget in the dialog. +; +; Usage: +; SF-ADJUSTMENT "label" '(value lower upper step_inc page_inc digits type) +; +; type is one of: SF-SLIDER(0), SF-SPINNER(1) +; +; ---------------------------------------------------------------------- +; SF-COLOR +; creates a color button in the dialog. It accepts either a list of three +; values for the red, green and blue components or a color name in CSS +; notatation +; +; Usage: +; SF-COLOR "label" '(red green blue) +; SF-COLOR "label" "color" +; +; ---------------------------------------------------------------------- +; SF-FONT +; creates a font-selection widget in the dialog. It returns a fontname as +; a string. There are two new gimp-text procedures to ease the use of this +; return parameter: +; +; (gimp-text-fontname image drawable +; x-pos y-pos text border antialias size unit font) +; (gimp-text-get-extents-fontname text size unit font)) +; +; where font is the fontname you get. The size specified in the fontname +; is silently ignored. It is only used in the font-selector. So you are +; asked to set it to a useful value (24 pixels is a good choice) when +; using SF-FONT. +; +; Usage: +; SF-FONT "label" "fontname" +; +; ---------------------------------------------------------------------- +; SF-BRUSH +; is only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a preview area (which when pressed will +; produce a popup preview ) and a button with the "..." label. The button will +; popup a dialog where brushes can be selected and each of the +; characteristics of the brush can be modified. +; +; The actual value returned when the script is invoked is a list +; consisting of Brush name, opacity, spacing and brush mode in the same +; units as passed in as the default value. +; +; Usage: +; SF-BRUSH "Brush" '("Circle (03)" 100 44 0) +; +; Here the brush dialog will be popped up with a default brush of Circle (03) +; opacity 100 spacing 44 and paint mode of Normal (value 0). +; If this selection was unchanged the value passed to the function as a +; parameter would be '("Circle (03)" 100 44 0). +; +; ---------------------------------------------------------------------- +; SF-PATTERN +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a preview area (which when pressed will +; produce a popup preview ) and a button with the "..." label. The button will +; popup a dialog where patterns can be selected. +; +; Usage: +; SF-PATTERN "Pattern" "Maple Leaves" +; +; The value returned when the script is invoked is a string containing the +; pattern name. If the above selection was not altered the string would +; contain "Maple Leaves" +; +; ---------------------------------------------------------------------- +; SF-GRADIENT +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a button containing a preview of the selected +; gradient. If the button is pressed a gradient selection dialog will popup. +; +; Usage: +; SF-GRADIENT "Gradient" "Deep Sea" +; +; The value returned when the script is invoked is a string containing the +; gradient name. If the above selection was not altered the string would +; contain "Deep Sea" +; +; ---------------------------------------------------------------------- +; SF-PALETTE +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a button containing a preview of the selected +; palette. If the button is pressed a palette selection dialog will popup. +; +; Usage: +; SF-PALETTE "Palette" "Named Colors" +; +; The value returned when the script is invoked is a string containing the +; palette name. If the above selection was not altered the string would +; contain "Named Colors" +; +; ---------------------------------------------------------------------- +; SF-FILENAME +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a button containing the name of a file. +; If the button is pressed a file selection dialog will popup. +; +; Usage: +; SF-FILENAME "Environment Map" +; (string-append "" gimp-data-directory "/scripts/beavis.jpg") +; +; The value returned when the script is invoked is a string containing the +; filename. +; +; ---------------------------------------------------------------------- +; SF-DIRNAME +; Only useful in interactive mode. Very similar to SF-FILENAME, but the +; created widget allows to choose a directory instead of a file. +; +; Usage: +; SF-DIRNAME "Image Directory" "/var/tmp/images" +; +; The value returned when the script is invoked is a string containing the +; dirname. +; +; ---------------------------------------------------------------------- +; SF-OPTION +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget is a combo-box showing the options that are passed +; as a list. The first option is the default choice. +; +; Usage: +; SF-OPTION "Orientation" '("Horizontal" "Vertical") +; +; The value returned when the script is invoked is the number of the +; chosen option, where the option first is counted as 0. +; +; ---------------------------------------------------------------------- +; SF-ENUM +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget is a combo-box showing all enum values for the given +; enum type. This has to be the name of a registered enum, without the +; "Gimp" prefix. The second parameter specifies the default value, using +; the enum value's nick. +; +; Usage: +; SF-ENUM "Interpolation" '("InterpolationType" "linear") +; +; The value returned when the script is invoked corresponds to chosen +; enum value. +; +; ---------------------------------------------------------------------- + + +(define (script-fu-test-sphere radius + light + shadow + bg-color + sphere-color + brush + text + multi-text + pattern + gradient + gradient-reverse + font + size + unused-palette + unused-filename + unused-orientation + unused-interpolation + unused-dirname + unused-image + unused-layer + unused-channel + unused-drawable) + (let* ( + (width (* radius 3.75)) + (height (* radius 2.5)) + (img (car (gimp-image-new width height RGB))) + (drawable (car (gimp-layer-new img width height RGB-IMAGE + "Sphere Layer" 100 LAYER-MODE-NORMAL))) + (radians (/ (* light *pi*) 180)) + (cx (/ width 2)) + (cy (/ height 2)) + (light-x (+ cx (* radius (* 0.6 (cos radians))))) + (light-y (- cy (* radius (* 0.6 (sin radians))))) + (light-end-x (+ cx (* radius (cos (+ *pi* radians))))) + (light-end-y (- cy (* radius (sin (+ *pi* radians))))) + (offset (* radius 0.1)) + (text-extents (gimp-text-get-extents-fontname multi-text + size PIXELS + font)) + (x-position (- cx (/ (car text-extents) 2))) + (y-position (- cy (/ (cadr text-extents) 2))) + (shadow-w 0) + (shadow-x 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + (gimp-context-set-foreground sphere-color) + (gimp-context-set-background bg-color) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + (gimp-context-set-background '(20 20 20)) + + (if (and + (or (and (>= light 45) (<= light 75)) + (and (<= light 135) (>= light 105))) + (= shadow TRUE)) + (let ((shadow-w (* (* radius 2.5) (cos (+ *pi* radians)))) + (shadow-h (* radius 0.5)) + (shadow-x cx) + (shadow-y (+ cy (* radius 0.65)))) + (if (< shadow-w 0) + (begin (set! shadow-x (+ cx shadow-w)) + (set! shadow-w (- shadow-w)))) + + (gimp-context-set-feather TRUE) + (gimp-context-set-feather-radius 7.5 7.5) + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE shadow-x shadow-y shadow-w shadow-h) + (gimp-context-set-pattern pattern) + (gimp-drawable-edit-fill drawable FILL-PATTERN))) + + (gimp-context-set-feather FALSE) + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE (- cx radius) (- cy radius) + (* 2 radius) (* 2 radius)) + + (gimp-context-set-gradient-fg-bg-rgb) + (gimp-drawable-edit-gradient-fill drawable + GRADIENT-RADIAL offset + FALSE 0 0 + TRUE + light-x light-y + light-end-x light-end-y) + + (gimp-selection-none img) + + (gimp-image-select-ellipse img CHANNEL-OP-REPLACE 10 10 50 50) + + (gimp-context-set-gradient gradient) + (gimp-context-set-gradient-reverse gradient-reverse) + (gimp-drawable-edit-gradient-fill drawable + GRADIENT-LINEAR offset + FALSE 0 0 + TRUE + 10 10 + 30 60) + + (gimp-selection-none img) + + (gimp-context-set-foreground '(0 0 0)) + (gimp-floating-sel-anchor (car (gimp-text-fontname img drawable + x-position y-position + multi-text + 0 TRUE + size PIXELS + font))) + + (gimp-image-undo-enable img) + (gimp-display-new img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-test-sphere" + _"_Sphere..." + "Simple script to test and show the usage of the new Script-Fu API extensions." + "Spencer Kimball, Sven Neumann" + "Spencer Kimball" + "1996, 1998" + "" + SF-ADJUSTMENT "Radius (in pixels)" (list 100 1 5000 1 10 0 SF-SPINNER) + SF-ADJUSTMENT "Lighting (degrees)" (list 45 0 360 1 10 1 SF-SLIDER) + SF-TOGGLE "Shadow" TRUE + SF-COLOR "Background color" "white" + SF-COLOR "Sphere color" "red" + SF-BRUSH "Brush" '("Circle (03)" 100 44 0) + SF-STRING "Text" "Tiny-Fu rocks!" + SF-TEXT "Multi-line text" "Hello,\nWorld!" + SF-PATTERN "Pattern" "Maple Leaves" + SF-GRADIENT "Gradient" "Deep Sea" + SF-TOGGLE "Gradient reverse" FALSE + SF-FONT "Font" "Agate" + SF-ADJUSTMENT "Font size (pixels)" '(50 1 1000 1 10 0 1) + SF-PALETTE "Palette" "Default" + SF-FILENAME "Environment map" + (string-append gimp-data-directory + "/scripts/images/beavis.jpg") + SF-OPTION "Orientation" '("Horizontal" + "Vertical") + SF-ENUM "Interpolation" '("InterpolationType" "linear") + SF-DIRNAME "Output directory" "/var/tmp/" + SF-IMAGE "Image" -1 + SF-LAYER "Layer" -1 + SF-CHANNEL "Channel" -1 + SF-DRAWABLE "Drawable" -1 + SF-VECTORS "Vectors" -1 +) + +(script-fu-menu-register "script-fu-test-sphere" + "<Image>/Filters/Languages/Script-Fu/Test") diff --git a/plug-ins/script-fu/scripts/tileblur.scm b/plug-ins/script-fu/scripts/tileblur.scm new file mode 100644 index 0000000..4be7a6c --- /dev/null +++ b/plug-ins/script-fu/scripts/tileblur.scm @@ -0,0 +1,83 @@ +; Chris Gutteridge (cjg@ecs.soton.ac.uk) +; At ECS Dept, University of Southampton, England. + +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-tile-blur inImage inLayer inRadius inVert inHoriz inType) + + (let* ( + (theImage inImage) + (theLayer inLayer) + (theHeight (car (gimp-drawable-height theLayer))) + (theWidth (car (gimp-drawable-width theLayer))) + ) + + (define (pasteat xoff yoff) + (let ((theFloat (car(gimp-edit-paste theLayer 0)))) + (gimp-layer-set-offsets theFloat (* xoff theWidth) (* yoff theHeight) ) + (gimp-floating-sel-anchor theFloat) + ) + ) + + (gimp-context-push) + (gimp-context-set-feather FALSE) + (gimp-image-undo-group-start theImage) + + (gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0) + + (gimp-image-select-rectangle theImage CHANNEL-OP-REPLACE 0 0 theWidth theHeight) + (gimp-edit-cut theLayer) + + (gimp-selection-none theImage) + (gimp-layer-set-offsets theLayer theWidth theHeight) + + (pasteat 1 1) (pasteat 1 2) (pasteat 1 3) + (pasteat 2 1) (pasteat 2 2) (pasteat 2 3) + (pasteat 3 1) (pasteat 3 2) (pasteat 3 3) + + (gimp-selection-none theImage) + (if (= inType 0) + (plug-in-gauss-iir RUN-NONINTERACTIVE + theImage theLayer inRadius inHoriz inVert) + (plug-in-gauss-rle RUN-NONINTERACTIVE + theImage theLayer inRadius inHoriz inVert) + ) + + (gimp-layer-resize theLayer + theWidth theHeight (- 0 theWidth) (- 0 theHeight)) + (gimp-layer-set-offsets theLayer 0 0) + (gimp-image-undo-group-end theImage) + (gimp-displays-flush) + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-tile-blur" + _"_Tileable Blur..." + _"Blur the edges of an image so the result tiles seamlessly" + "Chris Gutteridge" + "1998, Chris Gutteridge / ECS dept, University of Southampton, England." + "25th April 1998" + "RGB*" + SF-IMAGE "The Image" 0 + SF-DRAWABLE "The Layer" 0 + SF-ADJUSTMENT _"Radius" '(5 0 128 1 1 0 0) + SF-TOGGLE _"Blur vertically" TRUE + SF-TOGGLE _"Blur horizontally" TRUE + SF-OPTION _"Blur type" '(_"IIR" _"RLE") +) + +(script-fu-menu-register "script-fu-tile-blur" + "<Image>/Filters/Blur") diff --git a/plug-ins/script-fu/scripts/ts-helloworld.scm b/plug-ins/script-fu/scripts/ts-helloworld.scm new file mode 100644 index 0000000..2c04105 --- /dev/null +++ b/plug-ins/script-fu/scripts/ts-helloworld.scm @@ -0,0 +1,65 @@ +; "Hello, World" Test v1.00 February 29, 2004 +; by Kevin Cozens <kcozens@interlog.com> +; +; Creates an image with the text "Hello, World!" +; This was the first TinyScheme based script ever created and run for the +; 2.x version of GIMP. + +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; Tiny-Fu first successfully ran this script at 2:07am on March 6, 2004. + +(define (script-fu-helloworld text font size color) + (let* ( + (width 10) + (height 10) + (img (car (gimp-image-new width height RGB))) + (text-layer) + ) + + (gimp-context-push) + + (gimp-image-undo-disable img) + (gimp-context-set-foreground color) + + (set! text-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) + (set! width (car (gimp-drawable-width text-layer))) + (set! height (car (gimp-drawable-height text-layer))) + (gimp-image-resize img width height 0 0) + + (gimp-image-undo-enable img) + (gimp-display-new img) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-helloworld" + "_Hello World..." + "Creates an image with a user specified text string." + "Kevin Cozens <kcozens@interlog.com>" + "Kevin Cozens" + "February 29, 2004" + "" + SF-STRING "Text string" "Hello, World!" + SF-FONT "Font" "Sans" + SF-ADJUSTMENT "Font size (pixels)" '(100 2 1000 1 10 0 1) + SF-COLOR "Color" '(0 0 0) +) + +(script-fu-menu-register "script-fu-helloworld" + "<Image>/Filters/Languages/Script-Fu/Test") diff --git a/plug-ins/script-fu/scripts/unsharp-mask.scm b/plug-ins/script-fu/scripts/unsharp-mask.scm new file mode 100644 index 0000000..77daf82 --- /dev/null +++ b/plug-ins/script-fu/scripts/unsharp-mask.scm @@ -0,0 +1,84 @@ +;;; unsharp-mask.scm +;;; Time-stamp: <1998/11/17 13:18:39 narazaki@gimp.org> +;;; Author: Narazaki Shuji <narazaki@gimp.org> +;;; Version 0.8 + +(define (script-fu-unsharp-mask img drw mask-size mask-opacity) + (let* ( + (drawable-width (car (gimp-drawable-width drw))) + (drawable-height (car (gimp-drawable-height drw))) + (new-image (car (gimp-image-new drawable-width drawable-height RGB))) + (original-layer (car (gimp-layer-new new-image + drawable-width drawable-height + RGB-IMAGE "Original" + 100 LAYER-MODE-NORMAL))) + (original-layer-for-darker 0) + (original-layer-for-lighter 0) + (blurred-layer-for-darker 0) + (blurred-layer-for-lighter 0) + (darker-layer 0) + (lighter-layer 0) + ) + + (gimp-selection-all img) + (gimp-edit-copy drw) + + (gimp-image-undo-disable new-image) + + (gimp-image-insert-layer new-image original-layer 0 0) + (gimp-floating-sel-anchor + (car (gimp-edit-paste original-layer FALSE))) + + (set! original-layer-for-darker (car (gimp-layer-copy original-layer TRUE))) + (set! original-layer-for-lighter (car (gimp-layer-copy original-layer TRUE))) + (set! blurred-layer-for-darker (car (gimp-layer-copy original-layer TRUE))) + (gimp-item-set-visible original-layer FALSE) + (gimp-display-new new-image) + + ;; make darker mask + (gimp-image-insert-layer new-image blurred-layer-for-darker 0 -1) + (plug-in-gauss-iir RUN-NONINTERACTIVE + new-image blurred-layer-for-darker mask-size TRUE TRUE) + (set! blurred-layer-for-lighter + (car (gimp-layer-copy blurred-layer-for-darker TRUE))) + (gimp-image-insert-layer new-image original-layer-for-darker 0 -1) + (gimp-layer-set-mode original-layer-for-darker LAYER-MODE-SUBTRACT) + (set! darker-layer + (car (gimp-image-merge-visible-layers new-image CLIP-TO-IMAGE))) + (gimp-item-set-name darker-layer "darker mask") + (gimp-item-set-visible darker-layer FALSE) + + ;; make lighter mask + (gimp-image-insert-layer new-image original-layer-for-lighter 0 -1) + (gimp-image-insert-layer new-image blurred-layer-for-lighter 0 -1) + (gimp-layer-set-mode blurred-layer-for-lighter LAYER-MODE-SUBTRACT) + (set! lighter-layer + (car (gimp-image-merge-visible-layers new-image CLIP-TO-IMAGE))) + (gimp-item-set-name lighter-layer "lighter mask") + + ;; combine them + (gimp-item-set-visible original-layer TRUE) + (gimp-layer-set-mode darker-layer LAYER-MODE-SUBTRACT) + (gimp-layer-set-opacity darker-layer mask-opacity) + (gimp-item-set-visible darker-layer TRUE) + (gimp-layer-set-mode lighter-layer LAYER-MODE-ADDITION) + (gimp-layer-set-opacity lighter-layer mask-opacity) + (gimp-item-set-visible lighter-layer TRUE) + + (gimp-image-undo-enable new-image) + (gimp-displays-flush) + ) +) + +(script-fu-register "script-fu-unsharp-mask" + "Unsharp Mask..." + "Make a new image from the current layer by applying the unsharp mask method" + "Shuji Narazaki <narazaki@gimp.org>" + "Shuji Narazaki" + "1997,1998" + "" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable to apply" 0 + SF-ADJUSTMENT _"Mask size" '(5 1 100 1 1 0 1) + SF-ADJUSTMENT _"Mask opacity" '(50 0 100 1 1 0 1) +) diff --git a/plug-ins/script-fu/scripts/waves-anim.scm b/plug-ins/script-fu/scripts/waves-anim.scm new file mode 100644 index 0000000..4e43d98 --- /dev/null +++ b/plug-ins/script-fu/scripts/waves-anim.scm @@ -0,0 +1,110 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. +; +; +; waves-anim.scm version 1.01 1997/12/13 +; +; CHANGE-LOG: +; 1.00 - initial release +; 1.01 - some code cleanup, no real changes +; +; Copyright (C) 1997 Sven Neumann <sven@gimp.org> +; +; +; Makes a copy of your image and creates an animation of the active layer +; as if a stone was thrown into the image. The animation may be saved with +; the gif-plug-in. + +(define (script-fu-waves-anim img + drawable + amplitude + wavelength + num-frames + invert) + (let* ((amplitude (max 0 amplitude)) + (wavelength (max 0 wavelength)) + (num-frames (max 1 num-frames)) + (remaining-frames num-frames) + (phase 0) + (phaseshift (/ 360 num-frames)) + (image (car (gimp-image-duplicate img))) + (source-layer (car (gimp-image-get-active-layer image)))) + + (gimp-image-undo-disable image) + + (if (= invert TRUE) + (set! phaseshift (- 0 phaseshift))) + + (while (> remaining-frames 1) + (let* ( + (waves-layer (car (gimp-layer-copy source-layer TRUE))) + (layer-name (string-append "Frame " + (number->string + (- (+ num-frames 2) + remaining-frames) 10 + ) + " (replace)")) + ) + (gimp-layer-set-lock-alpha waves-layer FALSE) + (gimp-image-insert-layer image waves-layer 0 -1) + (gimp-item-set-name waves-layer layer-name) + + (plug-in-waves RUN-NONINTERACTIVE + image + waves-layer + amplitude + phase + wavelength + 0 + FALSE) + + (set! remaining-frames (- remaining-frames 1)) + (set! phase (- phase phaseshift)) + ) + ) + + (gimp-item-set-name source-layer "Frame 1") + (plug-in-waves RUN-NONINTERACTIVE + image + source-layer + amplitude + phase + wavelength + 0 + FALSE) + + (gimp-image-undo-enable image) + (gimp-display-new image) + ) +) + +(script-fu-register "script-fu-waves-anim" + _"_Waves..." + _"Create a multi-layer image with an effect like a stone was thrown into the current image" + "Sven Neumann <sven@gimp.org>" + "Sven Neumann" + "1997/13/12" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Amplitude" '(10 1 101 1 10 1 0) + SF-ADJUSTMENT _"Wavelength" '(10 0.1 100 1 10 1 0) + SF-ADJUSTMENT _"Number of frames" '(6 1 512 1 10 0 1) + SF-TOGGLE _"Invert direction" FALSE +) + +(script-fu-menu-register "script-fu-waves-anim" + "<Image>/Filters/Animation/Animators") diff --git a/plug-ins/script-fu/scripts/weave.scm b/plug-ins/script-fu/scripts/weave.scm new file mode 100644 index 0000000..81fd0a7 --- /dev/null +++ b/plug-ins/script-fu/scripts/weave.scm @@ -0,0 +1,415 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; Weave script --- make an image look as if it were woven +; Copyright (C) 1997 Federico Mena Quintero +; federico@nuclecu.unam.mx +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +; Copies the specified rectangle from/to the specified drawable + +(define (copy-rectangle img + drawable + x1 + y1 + width + height + dest-x + dest-y) + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE x1 y1 width height) + (gimp-edit-copy drawable) + (let ((floating-sel (car (gimp-edit-paste drawable FALSE)))) + (gimp-layer-set-offsets floating-sel dest-x dest-y) + (gimp-floating-sel-anchor floating-sel)) + (gimp-selection-none img)) + +; Creates a single weaving tile + +(define (create-weave-tile ribbon-width + ribbon-spacing + shadow-darkness + shadow-depth) + (let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing))) + (darkness (* 255 (/ (- 100 shadow-darkness) 100))) + (img (car (gimp-image-new tile-size tile-size RGB))) + (drawable (car (gimp-layer-new img tile-size tile-size RGB-IMAGE + "Weave tile" 100 LAYER-MODE-NORMAL)))) + + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + ; Create main horizontal ribbon + + (gimp-context-set-foreground '(255 255 255)) + (gimp-context-set-background (list darkness darkness darkness)) + + (gimp-image-select-rectangle img + CHANNEL-OP-REPLACE + 0 + ribbon-spacing + (+ (* 2 ribbon-spacing) ribbon-width) + ribbon-width) + + (gimp-context-set-gradient-fg-bg-rgb) + (gimp-drawable-edit-gradient-fill drawable + GRADIENT-BILINEAR (- 100 shadow-depth) + FALSE 0 0 + TRUE + (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) 0 + 0 0) + + ; Create main vertical ribbon + + (gimp-image-select-rectangle img + CHANNEL-OP-REPLACE + (+ (* 2 ribbon-spacing) ribbon-width) + 0 + ribbon-width + (+ (* 2 ribbon-spacing) ribbon-width)) + + (gimp-drawable-edit-gradient-fill drawable + GRADIENT-BILINEAR (- 100 shadow-depth) + FALSE 0 0 + TRUE + 0 (/ (+ (* 2 ribbon-spacing) ribbon-width -1) 2) + 0 0) + + ; Create the secondary horizontal ribbon + + (copy-rectangle img + drawable + 0 + ribbon-spacing + (+ ribbon-width ribbon-spacing) + ribbon-width + (+ ribbon-width ribbon-spacing) + (+ (* 2 ribbon-spacing) ribbon-width)) + + (copy-rectangle img + drawable + (+ ribbon-width ribbon-spacing) + ribbon-spacing + ribbon-spacing + ribbon-width + 0 + (+ (* 2 ribbon-spacing) ribbon-width)) + + ; Create the secondary vertical ribbon + + (copy-rectangle img + drawable + (+ (* 2 ribbon-spacing) ribbon-width) + 0 + ribbon-width + (+ ribbon-width ribbon-spacing) + ribbon-spacing + (+ ribbon-width ribbon-spacing)) + + (copy-rectangle img + drawable + (+ (* 2 ribbon-spacing) ribbon-width) + (+ ribbon-width ribbon-spacing) + ribbon-width + ribbon-spacing + ribbon-spacing + 0) + + ; Done + + (gimp-image-undo-enable img) + (list img drawable))) + +; Creates a complete weaving mask + +(define (create-weave width + height + ribbon-width + ribbon-spacing + shadow-darkness + shadow-depth) + (let* ((tile (create-weave-tile ribbon-width ribbon-spacing shadow-darkness + shadow-depth)) + (tile-img (car tile)) + (tile-layer (cadr tile)) + (weaving (plug-in-tile RUN-NONINTERACTIVE tile-img tile-layer width height TRUE))) + (gimp-image-delete tile-img) + weaving)) + +; Creates a single tile for masking + +(define (create-mask-tile ribbon-width + ribbon-spacing + r1-x1 + r1-y1 + r1-width + r1-height + r2-x1 + r2-y1 + r2-width + r2-height + r3-x1 + r3-y1 + r3-width + r3-height) + (let* ((tile-size (+ (* 2 ribbon-width) (* 2 ribbon-spacing))) + (img (car (gimp-image-new tile-size tile-size RGB))) + (drawable (car (gimp-layer-new img tile-size tile-size RGB-IMAGE + "Mask" 100 LAYER-MODE-NORMAL)))) + (gimp-image-undo-disable img) + (gimp-image-insert-layer img drawable 0 0) + + (gimp-context-set-background '(0 0 0)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + + (gimp-image-select-rectangle img CHANNEL-OP-REPLACE r1-x1 r1-y1 r1-width r1-height) + (gimp-image-select-rectangle img CHANNEL-OP-ADD r2-x1 r2-y1 r2-width r2-height) + (gimp-image-select-rectangle img CHANNEL-OP-ADD r3-x1 r3-y1 r3-width r3-height) + + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + (gimp-selection-none img) + + (gimp-image-undo-enable img) + + (list img drawable))) + +; Creates a complete mask image + +(define (create-mask final-width + final-height + ribbon-width + ribbon-spacing + r1-x1 + r1-y1 + r1-width + r1-height + r2-x1 + r2-y1 + r2-width + r2-height + r3-x1 + r3-y1 + r3-width + r3-height) + (let* ((tile (create-mask-tile ribbon-width ribbon-spacing + r1-x1 r1-y1 r1-width r1-height + r2-x1 r2-y1 r2-width r2-height + r3-x1 r3-y1 r3-width r3-height)) + (tile-img (car tile)) + (tile-layer (cadr tile)) + (mask (plug-in-tile RUN-NONINTERACTIVE tile-img tile-layer final-width final-height + TRUE))) + (gimp-image-delete tile-img) + mask)) + +; Creates the mask for horizontal ribbons + +(define (create-horizontal-mask ribbon-width + ribbon-spacing + final-width + final-height) + (create-mask final-width + final-height + ribbon-width + ribbon-spacing + 0 + ribbon-spacing + (+ (* 2 ribbon-spacing) ribbon-width) + ribbon-width + 0 + (+ (* 2 ribbon-spacing) ribbon-width) + ribbon-spacing + ribbon-width + (+ ribbon-width ribbon-spacing) + (+ (* 2 ribbon-spacing) ribbon-width) + (+ ribbon-width ribbon-spacing) + ribbon-width)) + +; Creates the mask for vertical ribbons + +(define (create-vertical-mask ribbon-width + ribbon-spacing + final-width + final-height) + (create-mask final-width + final-height + ribbon-width + ribbon-spacing + (+ (* 2 ribbon-spacing) ribbon-width) + 0 + ribbon-width + (+ (* 2 ribbon-spacing) ribbon-width) + ribbon-spacing + 0 + ribbon-width + ribbon-spacing + ribbon-spacing + (+ ribbon-width ribbon-spacing) + ribbon-width + (+ ribbon-width ribbon-spacing))) + +; Adds a threads layer at a certain orientation to the specified image + +(define (create-threads-layer img + width + height + length + density + orientation) + (let* ((drawable (car (gimp-layer-new img width height RGBA-IMAGE + "Threads" 100 LAYER-MODE-NORMAL))) + (dense (/ density 100.0))) + (gimp-image-insert-layer img drawable 0 -1) + (gimp-context-set-background '(255 255 255)) + (gimp-drawable-edit-fill drawable FILL-BACKGROUND) + (plug-in-noisify RUN-NONINTERACTIVE img drawable FALSE dense dense dense dense) + (plug-in-c-astretch RUN-NONINTERACTIVE img drawable) + (cond ((eq? orientation 'horizontal) + (plug-in-gauss-rle RUN-NONINTERACTIVE img drawable length TRUE FALSE)) + ((eq? orientation 'vertical) + (plug-in-gauss-rle RUN-NONINTERACTIVE img drawable length FALSE TRUE))) + (plug-in-c-astretch RUN-NONINTERACTIVE img drawable) + drawable)) + +(define (create-complete-weave width + height + ribbon-width + ribbon-spacing + shadow-darkness + shadow-depth + thread-length + thread-density + thread-intensity) + (let* ((weave (create-weave width height ribbon-width ribbon-spacing + shadow-darkness shadow-depth)) + (w-img (car weave)) + (w-layer (cadr weave)) + + (h-layer (create-threads-layer w-img width height thread-length + thread-density 'horizontal)) + (h-mask (car (gimp-layer-create-mask h-layer ADD-MASK-WHITE))) + + (v-layer (create-threads-layer w-img width height thread-length + thread-density 'vertical)) + (v-mask (car (gimp-layer-create-mask v-layer ADD-MASK-WHITE))) + + (hmask (create-horizontal-mask ribbon-width ribbon-spacing + width height)) + (hm-img (car hmask)) + (hm-layer (cadr hmask)) + + (vmask (create-vertical-mask ribbon-width ribbon-spacing width height)) + (vm-img (car vmask)) + (vm-layer (cadr vmask))) + + (gimp-layer-add-mask h-layer h-mask) + (gimp-selection-all hm-img) + (gimp-edit-copy hm-layer) + (gimp-image-delete hm-img) + (gimp-floating-sel-anchor (car (gimp-edit-paste h-mask FALSE))) + (gimp-layer-set-opacity h-layer thread-intensity) + (gimp-layer-set-mode h-layer LAYER-MODE-MULTIPLY) + + (gimp-layer-add-mask v-layer v-mask) + (gimp-selection-all vm-img) + (gimp-edit-copy vm-layer) + (gimp-image-delete vm-img) + (gimp-floating-sel-anchor (car (gimp-edit-paste v-mask FALSE))) + (gimp-layer-set-opacity v-layer thread-intensity) + (gimp-layer-set-mode v-layer LAYER-MODE-MULTIPLY) + + ; Uncomment this if you want to keep the weaving mask image + ; (gimp-display-new (car (gimp-image-duplicate w-img))) + + (list w-img + (car (gimp-image-flatten w-img))))) + +; The main weave function + +(define (script-fu-weave img + drawable + ribbon-width + ribbon-spacing + shadow-darkness + shadow-depth + thread-length + thread-density + thread-intensity) + (gimp-context-push) + (gimp-image-undo-group-start img) + + (let* ( + (d-img (car (gimp-item-get-image drawable))) + (d-width (car (gimp-drawable-width drawable))) + (d-height (car (gimp-drawable-height drawable))) + (d-offsets (gimp-drawable-offsets drawable)) + + (weaving (create-complete-weave d-width + d-height + ribbon-width + ribbon-spacing + shadow-darkness + shadow-depth + thread-length + thread-density + thread-intensity)) + (w-img (car weaving)) + (w-layer (cadr weaving)) + ) + + (gimp-context-set-paint-mode LAYER-MODE-NORMAL) + (gimp-context-set-opacity 100.0) + (gimp-context-set-feather FALSE) + + (gimp-selection-all w-img) + (gimp-edit-copy w-layer) + (gimp-image-delete w-img) + (let ((floating-sel (car (gimp-edit-paste drawable FALSE)))) + (gimp-layer-set-offsets floating-sel + (car d-offsets) + (cadr d-offsets)) + (gimp-layer-set-mode floating-sel LAYER-MODE-MULTIPLY) + (gimp-floating-sel-to-layer floating-sel) + ) + ) + (gimp-context-pop) + (gimp-image-undo-group-end img) + (gimp-displays-flush) +) + +(script-fu-register "script-fu-weave" + _"_Weave..." + _"Create a new layer filled with a weave effect to be used as an overlay or bump map" + "Federico Mena Quintero" + "Federico Mena Quintero" + "June 1997" + "RGB* GRAY*" + SF-IMAGE "Image to Weave" 0 + SF-DRAWABLE "Drawable to Weave" 0 + SF-ADJUSTMENT _"Ribbon width" '(30 0 256 1 10 1 1) + SF-ADJUSTMENT _"Ribbon spacing" '(10 0 256 1 10 1 1) + SF-ADJUSTMENT _"Shadow darkness" '(75 0 100 1 10 1 1) + SF-ADJUSTMENT _"Shadow depth" '(75 0 100 1 10 1 1) + SF-ADJUSTMENT _"Thread length" '(200 0 256 1 10 1 1) + SF-ADJUSTMENT _"Thread density" '(50 0 100 1 10 1 1) + SF-ADJUSTMENT _"Thread intensity" '(100 0 100 1 10 1 1) +) + +(script-fu-menu-register "script-fu-weave" + "<Image>/Filters/Artistic") diff --git a/plug-ins/script-fu/scripts/xach-effect.scm b/plug-ins/script-fu/scripts/xach-effect.scm new file mode 100644 index 0000000..ae83885 --- /dev/null +++ b/plug-ins/script-fu/scripts/xach-effect.scm @@ -0,0 +1,142 @@ +; GIMP - The GNU Image Manipulation Program +; Copyright (C) 1995 Spencer Kimball and Peter Mattis +; +; xach effect script +; Copyright (c) 1997 Adrian Likins +; aklikins@eos.ncsu.edu +; +; based on a idea by Xach Beane <xach@mint.net> +; +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation; either version 3 of the License, or +; (at your option) any later version. +; +; This program 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 General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see <https://www.gnu.org/licenses/>. + + +(define (script-fu-xach-effect image + drawable + hl-offset-x + hl-offset-y + hl-color + hl-opacity-comp + ds-color + ds-opacity + ds-blur + ds-offset-x + ds-offset-y + keep-selection) + (let* ( + (ds-blur (max ds-blur 0)) + (ds-opacity (min ds-opacity 100)) + (ds-opacity (max ds-opacity 0)) + (type (car (gimp-drawable-type-with-alpha drawable))) + (image-width (car (gimp-image-width image))) + (hl-opacity (list hl-opacity-comp hl-opacity-comp hl-opacity-comp)) + (image-height (car (gimp-image-height image))) + (active-selection 0) + (from-selection 0) + (theLayer 0) + (hl-layer 0) + (shadow-layer 0) + (mask 0) + ) + + (gimp-context-push) + (gimp-context-set-defaults) + + (gimp-image-undo-group-start image) + (gimp-layer-add-alpha drawable) + + (if (= (car (gimp-selection-is-empty image)) TRUE) + (begin + (gimp-image-select-item image CHANNEL-OP-REPLACE drawable) + (set! active-selection (car (gimp-selection-save image))) + (set! from-selection FALSE)) + (begin + (set! from-selection TRUE) + (set! active-selection (car (gimp-selection-save image))))) + + (set! hl-layer (car (gimp-layer-new image image-width image-height type _"Highlight" 100 LAYER-MODE-NORMAL))) + (gimp-image-insert-layer image hl-layer 0 -1) + + (gimp-selection-none image) + (gimp-drawable-edit-clear hl-layer) + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + + (gimp-context-set-background hl-color) + (gimp-drawable-edit-fill hl-layer FILL-BACKGROUND) + (gimp-selection-translate image hl-offset-x hl-offset-y) + (gimp-drawable-edit-fill hl-layer FILL-BACKGROUND) + (gimp-selection-none image) + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + + (set! mask (car (gimp-layer-create-mask hl-layer ADD-MASK-WHITE))) + (gimp-layer-add-mask hl-layer mask) + + (gimp-context-set-background hl-opacity) + (gimp-drawable-edit-fill mask FILL-BACKGROUND) + + (set! shadow-layer (car (gimp-layer-new image + image-width + image-height + type + _"Shadow" + ds-opacity + LAYER-MODE-NORMAL))) + (gimp-image-insert-layer image shadow-layer 0 -1) + (gimp-selection-none image) + (gimp-drawable-edit-clear shadow-layer) + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-selection-translate image ds-offset-x ds-offset-y) + (gimp-context-set-background ds-color) + (gimp-drawable-edit-fill shadow-layer FILL-BACKGROUND) + (gimp-selection-none image) + (plug-in-gauss-rle RUN-NONINTERACTIVE image shadow-layer ds-blur TRUE TRUE) + (gimp-image-select-item image CHANNEL-OP-REPLACE active-selection) + (gimp-drawable-edit-clear shadow-layer) + (gimp-image-lower-item image shadow-layer) + + (if (= keep-selection FALSE) + (gimp-selection-none image)) + + (gimp-image-set-active-layer image drawable) + (gimp-image-remove-channel image active-selection) + (gimp-image-undo-group-end image) + (gimp-displays-flush) + + (gimp-context-pop) + ) +) + +(script-fu-register "script-fu-xach-effect" + _"_Xach-Effect..." + _"Add a subtle translucent 3D effect to the selected region (or alpha)" + "Adrian Likins <adrian@gimp.org>" + "Adrian Likins" + "9/28/97" + "RGB* GRAY*" + SF-IMAGE "Image" 0 + SF-DRAWABLE "Drawable" 0 + SF-ADJUSTMENT _"Highlight X offset" '(-1 -100 100 1 10 0 1) + SF-ADJUSTMENT _"Highlight Y offset" '(-1 -100 100 1 10 0 1) + SF-COLOR _"Highlight color" "white" + SF-ADJUSTMENT _"Highlight opacity" '(66 0 255 1 10 0 0) + SF-COLOR _"Drop shadow color" "black" + SF-ADJUSTMENT _"Drop shadow opacity" '(100 0 100 1 10 0 0) + SF-ADJUSTMENT _"Drop shadow blur radius" '(12 0 255 1 10 0 1) + SF-ADJUSTMENT _"Drop shadow X offset" '(5 0 255 1 10 0 1) + SF-ADJUSTMENT _"Drop shadow Y offset" '(5 0 255 1 10 0 1) + SF-TOGGLE _"Keep selection" TRUE +) + +(script-fu-menu-register "script-fu-xach-effect" + "<Image>/Filters/Light and Shadow/Shadow") |