From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- media-plugins/gimp-resynthesizer/Manifest | 7 ++ .../files/gimp-resynthesizer-0.16-makefile.patch | 27 +++++ .../gimp-resynthesizer/files/smart-remove.scm | 111 +++++++++++++++++++++ .../gimp-resynthesizer-0.16.ebuild | 47 +++++++++ media-plugins/gimp-resynthesizer/metadata.xml | 5 + 5 files changed, 197 insertions(+) create mode 100644 media-plugins/gimp-resynthesizer/Manifest create mode 100644 media-plugins/gimp-resynthesizer/files/gimp-resynthesizer-0.16-makefile.patch create mode 100644 media-plugins/gimp-resynthesizer/files/smart-remove.scm create mode 100644 media-plugins/gimp-resynthesizer/gimp-resynthesizer-0.16.ebuild create mode 100644 media-plugins/gimp-resynthesizer/metadata.xml (limited to 'media-plugins/gimp-resynthesizer') diff --git a/media-plugins/gimp-resynthesizer/Manifest b/media-plugins/gimp-resynthesizer/Manifest new file mode 100644 index 000000000000..84e7bb0a850a --- /dev/null +++ b/media-plugins/gimp-resynthesizer/Manifest @@ -0,0 +1,7 @@ +AUX gimp-resynthesizer-0.16-makefile.patch 655 SHA256 d3f6df2e07d8312605ee3d576ff0dcad8f83c7a9963330ab1472cf67eac5ba48 SHA512 bef9c4e34df739a5d25f03c15b822fcd69aa31c3231ac1c6afb49b196dc5f9a4d237a79e8fd501151787d9a20afb449174ade3279b00eac5b7b15d4ade36f575 WHIRLPOOL 1c013643d9f8e4f25b77159fe14a0de971c87327d8c76da95a8f9f801ffdac3f1d7a3eead6dde7db0e104fa480a27ba23e6793ac7748d251148019a8b35349f8 +AUX smart-remove.scm 4157 SHA256 ae3d225cf9040c3ab50c8845bb3b62c9a05359169ce6f6a9c6e507fb61809297 SHA512 057ea904445f81ab391fde660f8fa0c195b1a0211431947c87f3f0d048d3af973e9c810b9749c91741092f46a989ce512227783775db6fada5fbd1fd84bedf05 WHIRLPOOL 1f69effad303920dbafb89c84493bdce54eb7429eff139301a153482fe3254251537bc072011837b223956ec2c3fd5b718a73e010d30019556848b6ad6f1df36 +DIST resynthesizer-0.16.tar.gz 18241 SHA256 dd24ec89f3a36f867b733c6a5c1d193b6d603251bd6553ac54b573fd655020cd SHA512 6838dfe919e45bd8e8eea570127a586dc5718ee57504748d1de192bd627e26670bd7d82a25b7cb56a4fe597f3eb2c9d0c922da318fec5b6bf8a52801a856b662 WHIRLPOOL 4c90e587155a68afc7fe408a0286162c4dc595d472a4cbaa187eefc204b5db71dc0e768916b501d9cfda086555fe90b9dc7203fecd9bbfcb8f58b308bfdfcfc4 +EBUILD gimp-resynthesizer-0.16.ebuild 1054 SHA256 cf4fd8b66387f15ca4e172b6038fdc886ce2d29f5644578c6029fb795a82403d SHA512 45a172ce2eb60d0dce3127e893146675f3f14887b9ed62258b041aeff787cb2a5452f200cef935932ef66ac9ce3d2526c3726ced9a6d9b8940f65592f1dfd6e7 WHIRLPOOL ae11b06fc386deb0bb528ed0244af109d4fe6657741c4098dcd3af1c3345869ec81207683cd8e9cd3b6b8f8500ec28af6d0b5f35a9f26666c74e9116e5900029 +MISC ChangeLog 2632 SHA256 b492eb107a16b792ec880caea70c6a25db7ccaf6ea8734e761500de7294f26f6 SHA512 3f38ed8d6dfd3f3c632f9c8a712da4bb05794333c71332451ef297e47d68ebbf6bbec8f3f8262b922c644b5383c22a0fdfd9d6b6b131eb783347dfbcf77eac33 WHIRLPOOL d1b290dc109edf5065da5c8a23b8f2ac2b036c137e127e07f3b8cfe4f277b61d5565a21f66ef989b009748de19fff33720b4d17c4771641d4a21905618f457d9 +MISC ChangeLog-2015 800 SHA256 3f7d49d65576b01d7bc6f5fa59bf1b9d5b888e3b39f8a5a38d0f2f040f3c0127 SHA512 09accdd6661047bf1415e53823ca6a5c4b495191eb8f6068f445f014accc57f0ae39aa55ab1fb99bdf9f709d8a7b64e25cc0e9031fb5929efbc3b18719babc0c WHIRLPOOL 5651ddb1b2fdeb0d88ba2e9f870197347c1c7085cc01403202baf8bf4b7797539e678b2b091ddb88c607c6dbc536f84efd31c6e793df3f0b86b0e11115ca3023 +MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b SHA512 a56648c974a1d14dd4c18237532773c72057a13ab90c58b5da04f185e3c12a8bd8d5c21fb06053507f31766291a82dc7d87b34cd65fd94cfe2af7295c813ef84 WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968 diff --git a/media-plugins/gimp-resynthesizer/files/gimp-resynthesizer-0.16-makefile.patch b/media-plugins/gimp-resynthesizer/files/gimp-resynthesizer-0.16-makefile.patch new file mode 100644 index 000000000000..04d25511e61c --- /dev/null +++ b/media-plugins/gimp-resynthesizer/files/gimp-resynthesizer-0.16-makefile.patch @@ -0,0 +1,27 @@ +--- Makefile-orig 2010-03-28 00:42:45.759669796 +0300 ++++ Makefile 2010-03-28 00:43:33.024936557 +0300 +@@ -1,15 +1,8 @@ +-CC = g++ +- + GIMPTOOL = gimptool-2.0 + + GIMP_LDFLAGS=`$(GIMPTOOL) --libs` + GIMP_CFLAGS=`$(GIMPTOOL) --cflags` + +-CFLAGS=$(GIMP_CFLAGS) -O3 -fno-common -ffast-math -frename-registers -fomit-frame-pointer +- +-LDFLAGS=$(GIMP_LDFLAGS) -lm +- +- + all: resynth + @echo + @echo 'Now type "make install" to install resynthesizer' +@@ -30,7 +23,7 @@ + @echo + + resynth: resynth.cc +- $(CC) $(CFLAGS) -o $@ resynth.cc $(LDFLAGS) ++ $(CXX) $(CFLAGS) $(GIMP_CFLAGS) $(LDFLAGS) -o $@ resynth.cc $(GIMP_LDFLAGS) -lm + + clean: + -rm -f *~ *.o core resynth diff --git a/media-plugins/gimp-resynthesizer/files/smart-remove.scm b/media-plugins/gimp-resynthesizer/files/smart-remove.scm new file mode 100644 index 000000000000..7324ebd56741 --- /dev/null +++ b/media-plugins/gimp-resynthesizer/files/smart-remove.scm @@ -0,0 +1,111 @@ + +; Smart Remove + +; Smart selection eraser. +; Requires resynthesizer plug-in. +; Paul Harrison (pfh@logarithmic.net) + +; Versions +; lloyd konneker lkk 3/29/2009 Fix passing workLayerID to plugin. +; Other non-functional changes: comments, error checking, menu item, blurb, license +; + +; License: +; +; 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 2 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. +; +; The GNU Public License is available at +; http://www.gnu.org/copyleft/gpl.html + +; lkk comment: creates stencil selection in a temp dupe image to pass as source drawable to plugin + + +(define (script-fu-smart-remove img layer corpus-border) + (cond + ((= 0 (car (gimp-selection-bounds img))) + (gimp-message "To use this script-fu, first select the region you wish to remove.") + ) + (#t (let* + ( + (dupe (car (gimp-image-duplicate img))) + (channel (car (gimp-selection-save dupe))) + (workLayerID -1) ; lkk + ) + + ; lkk flatten (so stencil gets everything visible) and to activate a layer in dupe + ; (gimp-message-set-handler 1) ; debug messages to console + (gimp-image-flatten dupe) ; lkk !!! flatten, activates layer, but deletes alpha + (set! workLayerID (car (gimp-image-get-active-layer dupe))) + (cond ((= -1 workLayerID) + (gimp-message "Failed get active layer") + ) ) + ; lkk plugin requires equal count of channels, target and source. Plugin should be changed to relax this reqt. + (cond ((= 1 (car (gimp-drawable-has-alpha layer))) + ;debug (gimp-message "Adding alpha") + (if (not (car (gimp-layer-add-alpha workLayerID))) (gimp-message "Failed add alpha") ) + ) ) + + + ; lkk comment: grow selection, invert, save to channel2, cut a hole size of orig selection + ; lkk in the grown selection in channel2, select channel2, un invert + (gimp-selection-grow dupe corpus-border) + (gimp-selection-invert dupe) + (let* + ( + (old-background (car (gimp-context-get-background))) + (channel2 (car (gimp-selection-save dupe))) + ) + + (gimp-selection-load channel) + (gimp-context-set-background '(255 255 255)) + (if (not (car (gimp-edit-clear channel2))) (gimp-message "Failed edit clear") ) + (gimp-context-set-background old-background) + (gimp-selection-load channel2) + ) + + (gimp-selection-invert dupe) + ; lkk comment: crop the dupe to size of stencil to save memory + (let* + ( + (bounds (gimp-selection-bounds dupe)) + (x1 (nth 1 bounds)) + (y1 (nth 2 bounds)) + (x2 (nth 3 bounds)) + (y2 (nth 4 bounds)) + ) + + (gimp-image-crop dupe (- x2 x1) (- y2 y1) x1 y1) + ) + + (gimp-selection-invert dupe) ; lkk !!! plugin requires inverted selection + ;(gimp-display-new dupe) ; debug to see the stencil as passed to plugin + ;(gimp-displays-flush) ; debug + + ; lkk originally 7th param was layer (the in layer), which only SEEMED to work. Should be the stencil. + (plug-in-resynthesizer 1 img layer 0 0 1 workLayerID -1 -1 0.0 0.117 16 500) + + (gimp-image-delete dupe) + (gimp-displays-flush) +) ) )) + +(script-fu-register "script-fu-smart-remove" + "/Filters/Enhance/Heal selection..." + "Extend surrounding texture to cover the selection. Works best with homogenous, not regular surroundings. \ +Requires separate resynthesizer plug-in." + "Paul Harrison (pfh@logarithmic.net)" + "Copyright 2000 Paul Harrison, 2009 Lloyd Konneker" + "13/9/2000" + "RGB* GRAY*" + SF-IMAGE "Input Image" 0 + SF-DRAWABLE "Input Layer" 0 + SF-ADJUSTMENT "Radius to take texture from" '(50 7 1000 1.0 1.0 0 1) +) + diff --git a/media-plugins/gimp-resynthesizer/gimp-resynthesizer-0.16.ebuild b/media-plugins/gimp-resynthesizer/gimp-resynthesizer-0.16.ebuild new file mode 100644 index 000000000000..03265bdf6ce1 --- /dev/null +++ b/media-plugins/gimp-resynthesizer/gimp-resynthesizer-0.16.ebuild @@ -0,0 +1,47 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=2 + +inherit eutils toolchain-funcs + +MY_PN="${PN#gimp-}" +MY_P="${MY_PN}-${PV}" + +DESCRIPTION="GIMP plug-ing for texture synthesis" +HOMEPAGE="http://www.logarithmic.net/pfh/resynthesizer" +SRC_URI="http://www.logarithmic.net/pfh-files/${MY_PN}/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="media-gfx/gimp" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}" + +src_prepare() { + epatch "${FILESDIR}/${P}-makefile.patch" + cp "${FILESDIR}/smart-remove.scm" "${S}" || die + + tc-export CXX +} + +src_install() { + exeinto $(gimptool-2.0 --gimpplugindir)/plug-ins + doexe resynth || die + + insinto $(gimptool-2.0 --gimpdatadir)/scripts + doins smart-enlarge.scm smart-remove.scm || die + + dodoc README || die +} + +pkg_postinst() { + elog "The Resynthesizer plugin is accessible from the menu:" + elog "* Filters -> Map -> Resynthesize" + elog "* Filters -> Enhance -> Smart enlarge/sharpen" + elog "* Filters -> Enhance -> Heal selection" +} diff --git a/media-plugins/gimp-resynthesizer/metadata.xml b/media-plugins/gimp-resynthesizer/metadata.xml new file mode 100644 index 000000000000..6f49eba8f496 --- /dev/null +++ b/media-plugins/gimp-resynthesizer/metadata.xml @@ -0,0 +1,5 @@ + + + + + -- cgit v1.2.3