mirror of https://github.com/GNOME/gimp.git
parent
916d858e49
commit
47ba671e41
|
@ -1,3 +1,10 @@
|
|||
Tue Feb 17 09:24:44 EST 1998 Adrian Likins <adrian@gimp.org>
|
||||
|
||||
* updated all of Sven Neumanns scripts. Including
|
||||
blend-anim.scm, waves-anim.scm, drop-shadows.scm,
|
||||
perspective-shadow.scm, round-corners.scm, slide.scm,
|
||||
and selection-round.scm.
|
||||
|
||||
Sat Feb 14 15:34:08 PST 1998 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* app/iscissors.c: iscissors released for initial public
|
||||
|
|
|
@ -16,7 +16,11 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; blend-anim.scm version 1.00 08/11/97
|
||||
; blend-anim.scm version 1.01 12/13/97
|
||||
;
|
||||
; CHANGE-LOG:
|
||||
; 1.00 - initial release
|
||||
; 1.01 - some code cleanup, no real changes
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
;
|
||||
|
@ -26,8 +30,8 @@
|
|||
|
||||
(define (multi-raise-layer image layer times)
|
||||
(while (> times 0)
|
||||
(gimp-image-raise-layer image layer)
|
||||
(set! times (- times 1))))
|
||||
(gimp-image-raise-layer image layer)
|
||||
(set! times (- times 1))))
|
||||
|
||||
|
||||
(define (script-fu-blend-anim img
|
||||
|
@ -42,156 +46,165 @@
|
|||
(height (car (gimp-image-height image)))
|
||||
(layers (gimp-image-get-layers image))
|
||||
(num-layers (car layers))
|
||||
(layer-array (cadr 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-disable-undo image)
|
||||
|
||||
(if (= looped TRUE)
|
||||
(begin
|
||||
(set! copy (car (gimp-layer-copy
|
||||
(aref layer-array (- num-layers 2)) 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-add-layer image copy 0)
|
||||
(set! layers (gimp-image-get-layers image))
|
||||
(set! num-layers (car layers))
|
||||
(set! layer-array (cadr layers))))
|
||||
(set! layer-array (cadr layers))
|
||||
(set! slots (- num-layers 2))
|
||||
(set! bg-layer (aref layer-array (- num-layers 1)))))
|
||||
|
||||
|
||||
(set! bg-layer (aref layer-array (- num-layers 1)))
|
||||
(set! slots (- num-layers 2))
|
||||
|
||||
; make all layers invisible and check for sizes
|
||||
(set! max-width 0)
|
||||
(set! max-height 0)
|
||||
(set! min-offset-x width)
|
||||
(set! min-offset-y height)
|
||||
(set! layer-count slots)
|
||||
(gimp-layer-set-visible bg-layer FALSE)
|
||||
(while (> layer-count -1)
|
||||
(set! layer (aref layer-array layer-count))
|
||||
(let* ((min-offset-x width)
|
||||
(min-offset-y height)
|
||||
(layer-count slots))
|
||||
(gimp-layer-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-layer-set-visible layer FALSE)
|
||||
(set! layer-width (+ (car (gimp-drawable-width layer))
|
||||
(* max-blur 2)))
|
||||
(set! layer-height (+ (car (gimp-drawable-height layer))
|
||||
(* max-blur 2)))
|
||||
(set! layer-offsets (gimp-drawable-offsets layer))
|
||||
(set! layer-offset-x (- (car layer-offsets) max-blur))
|
||||
(set! layer-offset-y (- (cadr layer-offsets) max-blur))
|
||||
(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))
|
||||
(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 adjascent 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-add-layer image bg-copy 0)
|
||||
(gimp-image-add-layer image lower-copy 0)
|
||||
(gimp-image-add-layer image upper-copy 0)
|
||||
(gimp-layer-set-visible upper-copy TRUE)
|
||||
(gimp-layer-set-visible lower-copy TRUE)
|
||||
(gimp-layer-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-preserve-trans upper-copy FALSE)
|
||||
(gimp-layer-resize upper-copy
|
||||
(+ layer-width (* blur 2))
|
||||
(+ layer-height (* blur 2))
|
||||
blur
|
||||
blur)
|
||||
(plug-in-gauss-rle 1
|
||||
image
|
||||
upper-copy
|
||||
blur
|
||||
TRUE TRUE)
|
||||
(set! blur (- max-blur blur))
|
||||
(gimp-layer-set-preserve-trans 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)
|
||||
(plug-in-gauss-rle 1
|
||||
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-layer-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-add-layer image
|
||||
bg-copy
|
||||
(* layer-count (+ frames 1)))
|
||||
(multi-raise-layer image
|
||||
orig-layer
|
||||
(+ (* (- slots layer-count) frames) 1))
|
||||
(gimp-layer-set-visible orig-layer TRUE)
|
||||
(gimp-layer-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-layer-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-layer-set-visible bg-layer TRUE)
|
||||
(gimp-layer-set-visible orig-layer TRUE)
|
||||
(gimp-image-merge-visible-layers image CLIP-TO-IMAGE))
|
||||
|
||||
(set! layer-count slots)
|
||||
(while (> layer-count 0)
|
||||
(set! frame-count frames)
|
||||
(set! lower-layer (aref layer-array layer-count))
|
||||
(set! upper-layer (aref layer-array (- layer-count 1)))
|
||||
(while (> frame-count 0)
|
||||
(set! opacity (* (/ frame-count (+ frames 1)) 100))
|
||||
(set! blur (/ (* opacity max-blur) 100))
|
||||
(set! upper-copy (car (gimp-layer-copy upper-layer TRUE)))
|
||||
(set! lower-copy (car (gimp-layer-copy lower-layer TRUE)))
|
||||
(set! bg-copy (car (gimp-layer-copy bg-layer TRUE)))
|
||||
(gimp-image-add-layer image bg-copy 0)
|
||||
(gimp-image-add-layer image lower-copy 0)
|
||||
(gimp-image-add-layer image upper-copy 0)
|
||||
(gimp-layer-set-visible upper-copy TRUE)
|
||||
(gimp-layer-set-visible lower-copy TRUE)
|
||||
(gimp-layer-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)
|
||||
(begin
|
||||
(gimp-layer-set-preserve-trans upper-copy FALSE)
|
||||
(set! layer-width (car (gimp-drawable-width upper-copy)))
|
||||
(set! layer-height (car (gimp-drawable-height upper-copy)))
|
||||
(gimp-layer-resize upper-copy
|
||||
(+ layer-width (* blur 2))
|
||||
(+ layer-height (* blur 2))
|
||||
blur
|
||||
blur)
|
||||
(plug-in-gauss-rle 1
|
||||
image
|
||||
upper-copy
|
||||
blur
|
||||
TRUE TRUE)
|
||||
(set! blur (- max-blur blur))
|
||||
(gimp-layer-set-preserve-trans 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)
|
||||
(plug-in-gauss-rle 1
|
||||
image
|
||||
lower-copy
|
||||
blur
|
||||
TRUE TRUE)))
|
||||
(gimp-layer-resize bg-copy
|
||||
max-width
|
||||
max-height
|
||||
offset-x
|
||||
offset-y)
|
||||
(set! merged-layer (car (gimp-image-merge-visible-layers
|
||||
image CLIP-TO-IMAGE)))
|
||||
(gimp-layer-set-visible merged-layer FALSE)
|
||||
(set! frame-count (- frame-count 1)))
|
||||
(set! layer-count (- layer-count 1)))
|
||||
|
||||
(set! layer-count 0)
|
||||
(while (< layer-count slots)
|
||||
(set! orig-layer (aref layer-array layer-count))
|
||||
(set! bg-copy (car (gimp-layer-copy bg-layer TRUE)))
|
||||
(gimp-image-add-layer image
|
||||
bg-copy
|
||||
(* layer-count (+ frames 1)))
|
||||
(multi-raise-layer image
|
||||
orig-layer
|
||||
(+ (* (- slots layer-count) frames) 1))
|
||||
(gimp-layer-set-visible orig-layer TRUE)
|
||||
(gimp-layer-set-visible bg-copy TRUE)
|
||||
(gimp-layer-resize bg-copy
|
||||
max-width
|
||||
max-height
|
||||
offset-x
|
||||
offset-y)
|
||||
(set! merged-layer (car (gimp-image-merge-visible-layers
|
||||
image CLIP-TO-IMAGE)))
|
||||
(gimp-layer-set-visible merged-layer FALSE)
|
||||
(set! layer-count (+ layer-count 1)))
|
||||
|
||||
(set! orig-layer (aref layer-array (- num-layers 2)))
|
||||
(gimp-layer-set-visible bg-layer TRUE)
|
||||
(gimp-layer-set-visible orig-layer TRUE)
|
||||
(gimp-image-merge-visible-layers image CLIP-TO-IMAGE)
|
||||
|
||||
; make all layers visible again
|
||||
(set! result-layers (gimp-image-get-layers image))
|
||||
(set! num-result-layers (car result-layers))
|
||||
(set! result-layer-array (cadr result-layers))
|
||||
(set! layer-count (- num-result-layers 1))
|
||||
(while (> layer-count -1)
|
||||
(set! layer (aref result-layer-array layer-count))
|
||||
(gimp-layer-set-visible layer TRUE)
|
||||
(set! name (string-append "Frame "
|
||||
(number->string
|
||||
(- num-result-layers layer-count) 10)))
|
||||
(gimp-layer-set-name layer name)
|
||||
(set! layer-count (- layer-count 1)))
|
||||
|
||||
(if (= looped TRUE)
|
||||
(gimp-image-remove-layer image (aref result-layer-array 0)))
|
||||
(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-layer-set-visible layer TRUE)
|
||||
(gimp-layer-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-enable-undo image)
|
||||
(gimp-display-new image)
|
||||
|
@ -203,7 +216,7 @@
|
|||
animation can be saved"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"08/11/1997"
|
||||
"12/13/1997"
|
||||
"RGB RGBA GRAY GRAYA"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; drop-shadow.scm version 1.01 08/11/97
|
||||
; drop-shadow.scm version 1.02 12/13/97
|
||||
;
|
||||
; 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
|
||||
;
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
|
@ -47,7 +48,10 @@
|
|||
(type (car (gimp-drawable-type-with-alpha drawable)))
|
||||
(image-width (car (gimp-image-width image)))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(old-bg (car (gimp-palette-get-background))))
|
||||
(old-bg (car (gimp-palette-get-background)))
|
||||
(from-selection 0)
|
||||
(active-selection 0)
|
||||
(shadow-layer 0))
|
||||
|
||||
(gimp-image-disable-undo image)
|
||||
|
||||
|
@ -60,64 +64,65 @@
|
|||
(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))
|
||||
(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))
|
||||
|
||||
(set! shadow-width (+ select-width (* 2 shadow-blur)))
|
||||
(set! shadow-height (+ select-height (* 2 shadow-blur)))
|
||||
(shadow-width (+ select-width (* 2 shadow-blur)))
|
||||
(shadow-height (+ select-height (* 2 shadow-blur)))
|
||||
|
||||
(set! shadow-offset-x (- select-offset-x shadow-blur))
|
||||
(set! shadow-offset-y (- select-offset-y shadow-blur))
|
||||
(shadow-offset-x (- select-offset-x shadow-blur))
|
||||
(shadow-offset-y (- select-offset-y shadow-blur)))
|
||||
|
||||
(if (= allow-resize TRUE)
|
||||
(begin
|
||||
(set! new-image-width image-width)
|
||||
(set! new-image-height image-height)
|
||||
(set! image-offset-x 0)
|
||||
(set! image-offset-y 0)
|
||||
(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)))
|
||||
(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)))
|
||||
(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-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)))
|
||||
(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)))
|
||||
(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
|
||||
NORMAL)))
|
||||
(gimp-layer-set-offsets shadow-layer
|
||||
shadow-offset-x
|
||||
shadow-offset-y)
|
||||
(set! shadow-layer (car (gimp-layer-new image
|
||||
shadow-width
|
||||
shadow-height
|
||||
type
|
||||
"Drop-Shadow"
|
||||
shadow-opacity
|
||||
NORMAL)))
|
||||
(gimp-layer-set-offsets shadow-layer
|
||||
shadow-offset-x
|
||||
shadow-offset-y))
|
||||
|
||||
(gimp-drawable-fill shadow-layer TRANS-IMAGE-FILL)
|
||||
(gimp-palette-set-background shadow-color)
|
||||
|
@ -155,7 +160,7 @@
|
|||
alpha-channel"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"08/11/1997"
|
||||
"12/13/1997"
|
||||
"RGB RGBA GRAY GRAYA"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,11 +16,12 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; perspective-shadow.scm version 1.01 08/11/97
|
||||
; perspective-shadow.scm version 1.02 12/13/97
|
||||
;
|
||||
; 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
|
||||
;
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
|
@ -48,7 +49,11 @@
|
|||
(type (car (gimp-drawable-type-with-alpha drawable)))
|
||||
(image-width (car (gimp-image-width image)))
|
||||
(image-height (car (gimp-image-height image)))
|
||||
(old-bg (car (gimp-palette-get-background))))
|
||||
(old-bg (car (gimp-palette-get-background)))
|
||||
(from-selection 0)
|
||||
(active-selection 0)
|
||||
(shadow-layer 0))
|
||||
|
||||
|
||||
(if (= rel-distance 0) (set! rel-distance 999999))
|
||||
(gimp-image-disable-undo image)
|
||||
|
@ -62,99 +67,99 @@
|
|||
(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))
|
||||
(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))
|
||||
|
||||
(set! abs-length (* rel-length select-height))
|
||||
(set! abs-distance (* rel-distance select-height))
|
||||
(set! half-bottom-width (/ select-width 2))
|
||||
(set! half-top-width (* half-bottom-width
|
||||
(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)))
|
||||
|
||||
(set! x0 (+ select-offset-x (+ (- half-bottom-width half-top-width)
|
||||
(x0 (+ select-offset-x (+ (- half-bottom-width half-top-width)
|
||||
(* (cos alpha) abs-length))))
|
||||
(set! y0 (+ select-offset-y (- select-height
|
||||
(y0 (+ select-offset-y (- select-height
|
||||
(* (sin alpha) abs-length))))
|
||||
(set! x1 (+ x0 (* 2 half-top-width)))
|
||||
(set! y1 y0)
|
||||
(set! x2 select-offset-x)
|
||||
(set! y2 (+ select-offset-y select-height))
|
||||
(set! x3 (+ x2 select-width))
|
||||
(set! y3 y2)
|
||||
(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
|
||||
NORMAL)))
|
||||
(gimp-layer-set-offsets shadow-layer select-offset-x select-offset-y)
|
||||
(gimp-drawable-fill shadow-layer TRANS-IMAGE-FILL)
|
||||
(gimp-palette-set-background shadow-color)
|
||||
(gimp-edit-fill image shadow-layer)
|
||||
(gimp-selection-none image)
|
||||
(set! shadow-layer (car (gimp-layer-new image
|
||||
select-width
|
||||
select-height
|
||||
type
|
||||
"Perspective Shadow"
|
||||
shadow-opacity
|
||||
NORMAL)))
|
||||
(gimp-layer-set-offsets shadow-layer select-offset-x select-offset-y)
|
||||
(gimp-drawable-fill shadow-layer TRANS-IMAGE-FILL)
|
||||
(gimp-palette-set-background shadow-color)
|
||||
(gimp-edit-fill image shadow-layer)
|
||||
(gimp-selection-none image)
|
||||
|
||||
(set! shadow-width (+ (- (max x1 x3) (min x0 x2)) (* 2 shadow-blur)))
|
||||
(set! shadow-height (+ (- (max y1 y3) (min y0 y2)) (* 2 shadow-blur)))
|
||||
(set! shadow-offset-x (- (min x0 x2) shadow-blur))
|
||||
(set! shadow-offset-y (- (min y0 y2) 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 (= allow-resize TRUE)
|
||||
(begin
|
||||
(set! new-image-width image-width)
|
||||
(set! new-image-height image-height)
|
||||
(set! image-offset-x 0)
|
||||
(set! image-offset-y 0)
|
||||
|
||||
(if (< shadow-offset-x 0)
|
||||
(begin
|
||||
(set! image-offset-x (- 0 shadow-offset-x))
|
||||
(if (< shadow-offset-x 0)
|
||||
(begin
|
||||
(set! image-offset-x (- 0 shadow-offset-x))
|
||||
(set! new-image-width (- new-image-width image-offset-x))))
|
||||
|
||||
(if (< shadow-offset-y 0)
|
||||
(begin
|
||||
(set! image-offset-y (- 0 shadow-offset-y))
|
||||
(if (< shadow-offset-y 0)
|
||||
(begin
|
||||
(set! image-offset-y (- 0 shadow-offset-y))
|
||||
(set! new-image-height (- new-image-height 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)))
|
||||
|
||||
(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-image-add-layer image shadow-layer -1)
|
||||
(gimp-image-add-layer image shadow-layer -1)
|
||||
|
||||
(gimp-perspective image
|
||||
shadow-layer
|
||||
interpolate
|
||||
x0 y0
|
||||
x1 y1
|
||||
x2 y2
|
||||
x3 y3)
|
||||
(gimp-perspective image
|
||||
shadow-layer
|
||||
interpolate
|
||||
x0 y0
|
||||
x1 y1
|
||||
x2 y2
|
||||
x3 y3)
|
||||
|
||||
(if (> shadow-blur 0)
|
||||
(begin
|
||||
(gimp-layer-set-preserve-trans shadow-layer FALSE)
|
||||
(gimp-layer-resize shadow-layer
|
||||
shadow-width
|
||||
shadow-height
|
||||
shadow-blur
|
||||
shadow-blur)
|
||||
(plug-in-gauss-rle 1
|
||||
image
|
||||
shadow-layer
|
||||
shadow-blur
|
||||
TRUE
|
||||
TRUE)))
|
||||
(if (> shadow-blur 0)
|
||||
(begin
|
||||
(gimp-layer-set-preserve-trans shadow-layer FALSE)
|
||||
(gimp-layer-resize shadow-layer
|
||||
shadow-width
|
||||
shadow-height
|
||||
shadow-blur
|
||||
shadow-blur)
|
||||
(plug-in-gauss-rle 1
|
||||
image
|
||||
shadow-layer
|
||||
shadow-blur
|
||||
TRUE
|
||||
TRUE))))
|
||||
|
||||
(if (= from-selection TRUE)
|
||||
(begin
|
||||
|
@ -177,7 +182,7 @@
|
|||
"Add a perspective shadow"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"08/11/1997"
|
||||
"12/13/1997"
|
||||
"RGB RGBA GRAY GRAYA"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,7 +16,11 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; round-corners.scm version 1.00 07/28/97
|
||||
; round-corners.scm version 1.01 12/13/97
|
||||
;
|
||||
; CHANGE-LOG:
|
||||
; 1.00 - initial release
|
||||
; 1.01 - some code cleanup, no real changes
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
;
|
||||
|
@ -52,12 +56,12 @@
|
|||
(image (cond ((= work-on-copy TRUE)
|
||||
(car (gimp-channel-ops-duplicate img)))
|
||||
((= work-on-copy FALSE)
|
||||
img))))
|
||||
img)))
|
||||
(pic-layer (car (gimp-image-active-drawable image))))
|
||||
|
||||
(gimp-image-disable-undo image)
|
||||
|
||||
; add an alpha channel to the image
|
||||
(set! pic-layer (car (gimp-image-active-drawable image)))
|
||||
(gimp-layer-add-alpha pic-layer)
|
||||
|
||||
; round the edges
|
||||
|
@ -91,14 +95,13 @@
|
|||
|
||||
; optionally add a background
|
||||
(if (= background-toggle TRUE)
|
||||
(begin
|
||||
(set! bg-layer (car (gimp-layer-new image
|
||||
(let* ((bg-layer (car (gimp-layer-new image
|
||||
width
|
||||
height
|
||||
type
|
||||
"Background"
|
||||
100
|
||||
NORMAL)))
|
||||
NORMAL))))
|
||||
(gimp-drawable-fill bg-layer BG-IMAGE-FILL)
|
||||
(gimp-image-add-layer image bg-layer -1)
|
||||
(gimp-image-raise-layer image pic-layer)
|
||||
|
@ -116,7 +119,7 @@
|
|||
"Round the corners of an image and optionally adds a drop-shadow and a background"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"07/28/1997"
|
||||
"12/13/1997"
|
||||
"RGB GRAY"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,9 +16,14 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; selection-round.scm version 1.00 09/04/97
|
||||
; selection-round.scm version 1.02 02/06/98
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
; CHANGE-LOG:
|
||||
; 1.00 - initial release
|
||||
; 1.01 - some code cleanup, no real changes
|
||||
; 1.02 - made script undoable
|
||||
;
|
||||
; Copyright (C) 1997,1998 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
;
|
||||
;
|
||||
; Rounds the current selection by cutting of rectangles from the edges and
|
||||
|
@ -39,9 +44,11 @@
|
|||
(select-x2 (cadr (cddr select-bounds)))
|
||||
(select-y2 (caddr (cddr select-bounds)))
|
||||
(select-width (- select-x2 select-x1))
|
||||
(select-height (- select-y2 select-y1)))
|
||||
(select-height (- select-y2 select-y1))
|
||||
(cut-radius 0)
|
||||
(ellipse-radius 0))
|
||||
|
||||
(gimp-image-disable-undo image)
|
||||
(gimp-undo-push-group-start image)
|
||||
|
||||
(if (> select-width select-height)
|
||||
(begin
|
||||
|
@ -111,7 +118,7 @@
|
|||
TRUE
|
||||
FALSE 0)
|
||||
|
||||
(gimp-image-enable-undo image)
|
||||
(gimp-undo-push-group-end image)
|
||||
(gimp-displays-flush)))
|
||||
|
||||
|
||||
|
@ -121,7 +128,7 @@
|
|||
rectangular."
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"09/04/97"
|
||||
"02/06/98"
|
||||
"RGB RGBA GRAY GRAYA INDEXED INDEXEDA"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,7 +16,12 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; slide.scm version 0.20 07/28/97
|
||||
; slide.scm version 0.30 12/13/97
|
||||
;
|
||||
; CHANGE-LOG:
|
||||
; 0.20 - first public release
|
||||
; 0.30 - some code cleanup
|
||||
; now uses the rotate plug-in to improve speed
|
||||
;
|
||||
; !still in development!
|
||||
; TODO: - change the script so that the film is rotated, not the image
|
||||
|
@ -80,12 +85,14 @@
|
|||
type
|
||||
"Background"
|
||||
100
|
||||
NORMAL))))
|
||||
NORMAL)))
|
||||
(pic-layer (car (gimp-image-active-drawable image)))
|
||||
(numbera (string-append number "A")))
|
||||
|
||||
|
||||
(gimp-image-disable-undo image)
|
||||
|
||||
; add an alpha channel to the image
|
||||
(set! pic-layer (car (gimp-image-active-drawable image)))
|
||||
(gimp-layer-add-alpha pic-layer)
|
||||
|
||||
; crop, resize and eventually rotate the image
|
||||
|
@ -99,10 +106,11 @@
|
|||
height
|
||||
(/ (- width crop-width) 2)
|
||||
(/ (- height crop-height) 2))
|
||||
(if (< ratio 1) (set! pic-layer (car (gimp-rotate image
|
||||
pic-layer
|
||||
FALSE
|
||||
(/ *pi* 2)))))
|
||||
(if (< ratio 1) (plug-in-rotate 1
|
||||
image
|
||||
pic-layer
|
||||
1
|
||||
FALSE))
|
||||
|
||||
; add the background layer
|
||||
(gimp-drawable-fill bg-layer BG-IMAGE-FILL)
|
||||
|
@ -150,52 +158,49 @@
|
|||
TRUE
|
||||
(* 0.050 height) PIXELS
|
||||
"*" font-family "*" "*" "*" "*" )))
|
||||
(set! numbera (string-append number "A"))
|
||||
(gimp-floating-sel-anchor (car (gimp-text image
|
||||
film-layer
|
||||
(+ hole-start (* 0.85 width))
|
||||
(* 0.95 height)
|
||||
numbera
|
||||
0
|
||||
TRUE
|
||||
(* 0.045 height) PIXELS
|
||||
"*" font-family "*" "*" "*" "*" )))
|
||||
film-layer
|
||||
(+ hole-start (* 0.85 width))
|
||||
(* 0.95 height)
|
||||
numbera
|
||||
0
|
||||
TRUE
|
||||
(* 0.045 height) PIXELS
|
||||
"*" font-family "*" "*" "*" "*" )))
|
||||
|
||||
; create a mask for the holes
|
||||
(set! film-mask (car (gimp-layer-create-mask film-layer WHITE-MASK)))
|
||||
|
||||
; cut out the holes...
|
||||
(gimp-selection-none image)
|
||||
(set! hole hole-start)
|
||||
(set! top-y (* height 0.06))
|
||||
(set! bottom-y(* height 0.855))
|
||||
(while (< hole 8)
|
||||
(gimp-rect-select image
|
||||
(* hole-space hole)
|
||||
top-y
|
||||
hole-width
|
||||
hole-height
|
||||
ADD
|
||||
FALSE
|
||||
0)
|
||||
(gimp-rect-select image
|
||||
(* hole-space hole)
|
||||
bottom-y
|
||||
hole-width
|
||||
hole-height
|
||||
ADD
|
||||
FALSE
|
||||
0)
|
||||
(set! hole (+ hole 1)))
|
||||
; create a mask for the holes and cut them out
|
||||
(let* ((film-mask (car (gimp-layer-create-mask film-layer WHITE-MASK)))
|
||||
(hole hole-start)
|
||||
(top-y (* height 0.06))
|
||||
(bottom-y(* height 0.855)))
|
||||
(gimp-selection-none image)
|
||||
(while (< hole 8)
|
||||
(gimp-rect-select image
|
||||
(* hole-space hole)
|
||||
top-y
|
||||
hole-width
|
||||
hole-height
|
||||
ADD
|
||||
FALSE
|
||||
0)
|
||||
(gimp-rect-select image
|
||||
(* hole-space hole)
|
||||
bottom-y
|
||||
hole-width
|
||||
hole-height
|
||||
ADD
|
||||
FALSE
|
||||
0)
|
||||
(set! hole (+ hole 1)))
|
||||
|
||||
(gimp-palette-set-foreground '(0 0 0))
|
||||
(gimp-edit-fill image film-mask)
|
||||
(gimp-selection-none image)
|
||||
(plug-in-gauss-rle 1 image film-mask hole-radius TRUE TRUE)
|
||||
(gimp-threshold image film-mask 127 255)
|
||||
(gimp-palette-set-foreground '(0 0 0))
|
||||
(gimp-edit-fill image film-mask)
|
||||
(gimp-selection-none image)
|
||||
(plug-in-gauss-rle 1 image film-mask hole-radius TRUE TRUE)
|
||||
(gimp-threshold image film-mask 127 255)
|
||||
|
||||
(gimp-image-add-layer image film-layer -1)
|
||||
(gimp-image-add-layer-mask image film-layer film-mask)
|
||||
(gimp-image-add-layer image film-layer -1)
|
||||
(gimp-image-add-layer-mask image film-layer film-mask))
|
||||
|
||||
; reorder the layers
|
||||
(gimp-image-raise-layer image pic-layer)
|
||||
|
@ -214,7 +219,7 @@
|
|||
"Gives the image the look of a slide"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"07/28/1997"
|
||||
"12/13/1997"
|
||||
"RGB GRAY"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
|
@ -16,7 +16,11 @@
|
|||
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
;
|
||||
;
|
||||
; waves-anim.scm version 1.00 09/04/97
|
||||
; waves-anim.scm version 1.01 12/13/97
|
||||
;
|
||||
; CHANGE-LOG:
|
||||
; 1.00 - initial release
|
||||
; 1.01 - some code cleanup, no real changes
|
||||
;
|
||||
; Copyright (C) 1997 Sven Neumann (neumanns@uni-duesseldorf.de)
|
||||
;
|
||||
|
@ -37,22 +41,22 @@
|
|||
(remaining-frames num-frames)
|
||||
(phase 0)
|
||||
(phaseshift (/ 360 num-frames))
|
||||
(image (car (gimp-channel-ops-duplicate img))))
|
||||
(image (car (gimp-channel-ops-duplicate img)))
|
||||
(source-layer (car (gimp-image-get-active-layer image))))
|
||||
|
||||
(gimp-image-disable-undo image)
|
||||
|
||||
(if (= invert TRUE)
|
||||
(set! phaseshift (- 0 phaseshift)))
|
||||
(set! source-layer (car (gimp-image-get-active-layer image)))
|
||||
|
||||
(while (> remaining-frames 1)
|
||||
(set! waves-layer (car (gimp-layer-copy source-layer TRUE)))
|
||||
(let* ((waves-layer (car (gimp-layer-copy source-layer TRUE)))
|
||||
(layer-name (string-append "Frame "
|
||||
(number->string
|
||||
(- (+ num-frames 2)
|
||||
remaining-frames) 10))))
|
||||
(gimp-layer-set-preserve-trans waves-layer FALSE)
|
||||
(gimp-image-add-layer image waves-layer -1)
|
||||
(set! layer-name (string-append "Frame "
|
||||
(number->string
|
||||
(- (+ num-frames 2)
|
||||
remaining-frames) 10)))
|
||||
(gimp-layer-set-name waves-layer layer-name)
|
||||
|
||||
(plug-in-waves 1
|
||||
|
@ -65,7 +69,7 @@
|
|||
FALSE)
|
||||
|
||||
(set! remaining-frames (- remaining-frames 1))
|
||||
(set! phase (- phase phaseshift)))
|
||||
(set! phase (- phase phaseshift))))
|
||||
|
||||
(gimp-layer-set-name source-layer "Frame 1")
|
||||
(plug-in-waves 1
|
||||
|
@ -85,7 +89,7 @@
|
|||
"Animate an image like a stone's been thrown into it"
|
||||
"Sven Neumann (neumanns@uni-duesseldorf.de)"
|
||||
"Sven Neumann"
|
||||
"09/04/1997"
|
||||
"12/13/1997"
|
||||
"RGB RGBA GRAY GRAYA"
|
||||
SF-IMAGE "Image" 0
|
||||
SF-DRAWABLE "Drawable" 0
|
||||
|
|
Loading…
Reference in New Issue