gimp/plug-ins/script-fu/scripts/waves-anim.scm

105 lines
3.1 KiB
Scheme
Raw Normal View History

1997-11-25 06:05:25 +08:00
; The GIMP -- an 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 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.
;
;
; waves-anim.scm version 1.01 1997/12/13
1998-02-17 22:27:46 +08:00
;
; CHANGE-LOG:
; 1.00 - initial release
; 1.01 - some code cleanup, no real changes
1997-11-25 06:05:25 +08:00
;
; Copyright (C) 1997 Sven Neumann <sven@gimp.org>
1997-11-25 06:05:25 +08:00
;
;
; 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
1997-11-25 06:05:25 +08:00
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)))
1998-02-17 22:27:46 +08:00
(source-layer (car (gimp-image-get-active-layer image))))
1997-11-25 06:05:25 +08:00
1999-10-17 08:07:55 +08:00
(gimp-image-undo-disable image)
1997-11-25 06:05:25 +08:00
(if (= invert TRUE)
(set! phaseshift (- 0 phaseshift)))
(while (> remaining-frames 1)
1998-02-17 22:27:46 +08:00
(let* ((waves-layer (car (gimp-layer-copy source-layer TRUE)))
(layer-name (string-append "Frame "
1998-02-17 22:27:46 +08:00
(number->string
(- (+ num-frames 2)
remaining-frames) 10)
" (replace)")))
app/actions/layers-actions.c app/actions/layers-commands.[ch] 2005-07-10 Michael Natterer <mitch@gimp.org> * app/actions/layers-actions.c * app/actions/layers-commands.[ch] * app/core/core-enums.[ch] * app/core/gimpimage-undo-push.[ch] * app/core/gimplayer-floating-sel.c * app/core/gimplayer.[ch] * app/text/gimptextlayer-xcf.c * app/widgets/gimphelp-ids.h * app/widgets/gimplayertreeview.[ch] * app/xcf/xcf-load.c * app/xcf/xcf-private.h * app/xcf/xcf-save.c * tools/pdbgen/pdb/layer.pdb * menus/image-menu.xml.in * libgimp/gimp.def: did a global s/preserve_trans/lock_alpha/ in preparation for more layer locking flags. * app/pdb/procedural_db.c * libgimp/gimplayer.[ch]: added compat stuff for preserve_trans. * app/pdb/layer_cmds.c * libgimp/gimplayer_pdb.[ch]: regenerated. * plug-ins/common/colortoalpha.c * plug-ins/common/iwarp.c * plug-ins/common/psd.c * plug-ins/common/psd_save.c * plug-ins/common/psp.c * plug-ins/common/rotate.c * plug-ins/common/threshold_alpha.c * plug-ins/common/vpropagate.c * plug-ins/script-fu/scripts/3d-outline.scm * plug-ins/script-fu/scripts/alien-glow-bar.scm * plug-ins/script-fu/scripts/alien-glow-bullet.scm * plug-ins/script-fu/scripts/alien-glow-logo.scm * plug-ins/script-fu/scripts/basic1-logo.scm * plug-ins/script-fu/scripts/basic2-logo.scm * plug-ins/script-fu/scripts/beveled-pattern-button.scm * plug-ins/script-fu/scripts/blend-anim.scm * plug-ins/script-fu/scripts/blended-logo.scm * plug-ins/script-fu/scripts/bovinated-logo.scm * plug-ins/script-fu/scripts/burn-in-anim.scm * plug-ins/script-fu/scripts/carved-logo.scm * plug-ins/script-fu/scripts/chalk.scm * plug-ins/script-fu/scripts/chip-away.scm * plug-ins/script-fu/scripts/comic-logo.scm * plug-ins/script-fu/scripts/coolmetal-logo.scm * plug-ins/script-fu/scripts/crystal-logo.scm * plug-ins/script-fu/scripts/drop-shadow.scm * plug-ins/script-fu/scripts/gimp-headers.scm * plug-ins/script-fu/scripts/gimp-labels.scm * plug-ins/script-fu/scripts/glowing-logo.scm * plug-ins/script-fu/scripts/gradient-bevel-logo.scm * plug-ins/script-fu/scripts/image-structure.scm * plug-ins/script-fu/scripts/neon-logo.scm * plug-ins/script-fu/scripts/perspective-shadow.scm * plug-ins/script-fu/scripts/starburst-logo.scm * plug-ins/script-fu/scripts/starscape-logo.scm * plug-ins/script-fu/scripts/textured-logo.scm * plug-ins/script-fu/scripts/title-header.scm * plug-ins/script-fu/scripts/waves-anim.scm * plug-ins/xjt/xjt.c: changed accordingly.
2005-07-11 05:17:22 +08:00
(gimp-layer-set-lock-alpha waves-layer FALSE)
1997-11-25 06:05:25 +08:00
(gimp-image-add-layer image waves-layer -1)
(gimp-drawable-set-name waves-layer layer-name)
1997-11-25 06:05:25 +08:00
(plug-in-waves 1
image
1997-11-25 06:05:25 +08:00
waves-layer
amplitude
phase
wavelength
0
1997-11-25 06:05:25 +08:00
FALSE)
(set! remaining-frames (- remaining-frames 1))
1998-02-17 22:27:46 +08:00
(set! phase (- phase phaseshift))))
1997-11-25 06:05:25 +08:00
(gimp-drawable-set-name source-layer "Frame 1")
(plug-in-waves 1
image
1997-11-25 06:05:25 +08:00
source-layer
amplitude
phase
wavelength
0
1997-11-25 06:05:25 +08:00
FALSE)
1999-10-17 08:07:55 +08:00
(gimp-image-undo-enable image)
1997-11-25 06:05:25 +08:00
(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>"
1997-11-25 06:05:25 +08:00
"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 .10 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")