scripts: Port scripts with SF-OPTION

After ab626e79, Script-Fu v3 now has the
SF-OPTION parameter again. This patch
ports a few scripts that use it or were
not otherwise covered by other merge
requests.
Note that further improvements are
necessary to allow these to work on
multiple layers simultaneously.
This commit is contained in:
Alx Sa 2024-02-03 18:39:10 +00:00
parent 3c264411ad
commit 0bca939daf
4 changed files with 26 additions and 28 deletions

View File

@ -16,6 +16,7 @@
(2pi (* 2 *pi*))
(rad/deg (/ 2pi 360))
(variation/2 (/ variation 2))
(drw (aref (cadr (gimp-image-get-selected-drawables img)) 0))
(drw-width (car (gimp-drawable-get-width drw)))
(drw-height (car (gimp-drawable-get-height drw)))
(drw-offsets (gimp-drawable-get-offsets drw))
@ -102,19 +103,18 @@
)
)
(script-fu-register "script-fu-line-nova"
(script-fu-register-filter "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)
SF-ONE-DRAWABLE
SF-ADJUSTMENT _"_Number of lines" '(200 40 1000 1 1 0 1)
SF-ADJUSTMENT _"S_harpness (degrees)" '(1.0 0.0 10.0 0.1 1 1 1)
SF-ADJUSTMENT _"O_ffset radius" '(100 0 2000 1 1 0 1)
SF-ADJUSTMENT _"Ran_domness" '(30 1 2000 1 1 0 1)
)
(script-fu-menu-register "script-fu-line-nova"

View File

@ -14,7 +14,7 @@
; 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)
(define (script-fu-reverse-layers img drawables)
(let* (
(layers (gimp-image-get-layers img))
(num-layers (car layers))
@ -38,15 +38,14 @@
)
)
(script-fu-register "script-fu-reverse-layers"
(script-fu-register-filter "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
SF-ONE-OR-MORE-DRAWABLE
)
(script-fu-menu-register "script-fu-reverse-layers"

View File

@ -7,8 +7,9 @@
; 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-get-width drawable)))
(define (script-fu-ripply-anim image drawables displacement num-frames edge-type)
(let* ((drawable (aref (cadr (gimp-image-get-selected-drawables image)) 0))
(width (car (gimp-drawable-get-width drawable)))
(height (car (gimp-drawable-get-height drawable)))
(work-image (car (gimp-image-new width
height
@ -65,18 +66,17 @@
(gimp-context-pop)))
(script-fu-register "script-fu-ripply-anim"
(script-fu-register-filter "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")
SF-ONE-DRAWABLE
SF-ADJUSTMENT _"Ri_ppling 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"

View File

@ -15,11 +15,11 @@
; along with this program. If not, see <https://www.gnu.org/licenses/>.
(define (script-fu-tile-blur inImage inLayer inRadius inVert inHoriz inType)
(define (script-fu-tile-blur inImage drawables inRadius inVert inHoriz inType)
(let* (
(theImage inImage)
(theLayer inLayer)
(theLayer (aref (cadr (gimp-image-get-selected-drawables theImage)) 0))
(theHeight (car (gimp-drawable-get-height theLayer)))
(theWidth (car (gimp-drawable-get-width theLayer)))
)
@ -68,19 +68,18 @@
)
)
(script-fu-register "script-fu-tile-blur"
(script-fu-register-filter "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 5 0 0)
SF-TOGGLE _"Blur vertically" TRUE
SF-TOGGLE _"Blur horizontally" TRUE
SF-OPTION _"Blur type" '(_"IIR" _"RLE")
SF-ONE-DRAWABLE
SF-ADJUSTMENT _"Ra_dius" '(5 0 128 1 5 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"