Commit ec43fe20 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/script-fu/scripts/Makefile.am added new script "Difference

2006-10-25  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/scripts/Makefile.am
	* plug-ins/script-fu/scripts/difference-clouds.scm: added new script
	"Difference Clouds" written by Martin Nordholts (bug #363458).
parent 51b4be9d
2006-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/Makefile.am
* plug-ins/script-fu/scripts/difference-clouds.scm: added new script
"Difference Clouds" written by Martin Nordholts (bug #363458).
2006-10-25 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/scripts/erase-rows.scm
......
......@@ -44,6 +44,7 @@ scripts = \
coolmetal-logo.scm \
copy-visible.scm \
crystal-logo.scm \
difference-clouds.scm \
distress-selection.scm \
drop-shadow.scm \
erase-rows.scm \
......
; 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 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.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
; 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 (car (gimp-layer-new image width height type
"Clouds" 100 DIFFERENCE-MODE)))
(offset-x 0)
(offset-y 0)
)
(gimp-image-undo-group-start image)
; Add the cloud layer above the current layer
(gimp-image-add-layer image diff-clouds -1)
; Clear the layer (so there are no noise in it)
(gimp-drawable-fill diff-clouds TRANSPARENT-FILL)
; Selections are relative to the drawable, so we must 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-drawable-is-layer drawable)
(gimp-layer-translate diff-clouds
offset-x offset-y))
(gimp-drawable-update diff-clouds)
; Show the solid noise dialog
(plug-in-solid-noise 0 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)
)
)
(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/Clouds")
......@@ -43,6 +43,7 @@ plug-ins/script-fu/scripts/comic-logo.scm
plug-ins/script-fu/scripts/coolmetal-logo.scm
plug-ins/script-fu/scripts/copy-visible.scm
plug-ins/script-fu/scripts/crystal-logo.scm
plug-ins/script-fu/scripts/difference-clouds.scm
plug-ins/script-fu/scripts/distress-selection.scm
plug-ins/script-fu/scripts/drop-shadow.scm
plug-ins/script-fu/scripts/erase-rows.scm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment