Updated with upstream update

This commit is contained in:
2023-10-30 15:55:30 -07:00
parent 098531073c
commit 3bbdd873ef
584 changed files with 91827 additions and 70362 deletions

View File

@ -23,7 +23,7 @@
; If > 255 set to 255
; Return the new value
(define (script-fu-addborder aimg adraw xsize ysize color dvalue)
(define (script-fu-addborder aimg adraw xsize ysize color dvalue allow-resize)
(define (deltacolor col delta)
(let* ((newcol (+ col delta)))
@ -98,72 +98,87 @@
)
(let* ((img (car (pika-item-get-image adraw)))
(owidth (car (pika-image-get-width img)))
(oheight (car (pika-image-get-height img)))
(width (+ owidth (* 2 xsize)))
(height (+ oheight (* 2 ysize)))
(layer (car (pika-layer-new img
width height
(car (pika-drawable-type-with-alpha adraw))
_"Border Layer" 100 LAYER-MODE-NORMAL))))
(imagewidth (car (pika-image-get-width img)))
(imageheight (car (pika-image-get-height img)))
(innerwidth 0)
(innerheight 0)
(outerwidth 0)
(outerheight 0))
(pika-context-push)
(pika-context-set-paint-mode LAYER-MODE-NORMAL)
(pika-context-set-opacity 100.0)
(pika-context-set-antialias FALSE)
(pika-context-set-feather FALSE)
(if (= allow-resize TRUE)
(begin
(set! outerwidth (+ imagewidth (* 2 xsize)))
(set! outerheight (+ imageheight (* 2 ysize)))
(set! innerwidth imagewidth)
(set! innerheight imageheight))
(begin
(set! outerwidth imagewidth)
(set! outerheight imageheight)
(set! innerwidth (- imagewidth (* 2 xsize)))
(set! innerheight (- imageheight (* 2 ysize)))))
(pika-image-undo-group-start img)
(let* ((layer (car (pika-layer-new img
outerwidth outerheight
(car (pika-drawable-type-with-alpha adraw))
_"Border Layer" 100 LAYER-MODE-NORMAL))))
(pika-image-resize img
width
height
xsize
ysize)
(pika-context-push)
(pika-context-set-antialias FALSE)
(pika-context-set-feather FALSE)
(pika-image-insert-layer img layer 0 0)
(pika-drawable-fill layer FILL-TRANSPARENT)
(pika-image-undo-group-start img)
(pika-context-set-background (adjcolor color dvalue))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_top_array xsize ysize owidth oheight width height))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (/ dvalue 2)))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_left_array xsize ysize owidth oheight width height))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (- 0 (/ dvalue 2))))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_right_array xsize ysize owidth oheight width height))
(if (= allow-resize TRUE)
(pika-image-resize img
outerwidth
outerheight
xsize
ysize))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (- 0 dvalue)))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_bottom_array xsize ysize owidth oheight width height))
(pika-image-insert-layer img layer 0 0)
(pika-drawable-fill layer FILL-TRANSPARENT)
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-selection-none img)
(pika-image-undo-group-end img)
(pika-displays-flush)
(pika-context-set-background (adjcolor color dvalue))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_top_array xsize ysize innerwidth innerheight outerwidth outerheight))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (/ dvalue 2)))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_left_array xsize ysize innerwidth innerheight outerwidth outerheight))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (- 0 (/ dvalue 2))))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_right_array xsize ysize innerwidth innerheight outerwidth outerheight))
(pika-context-pop)
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-context-set-background (adjcolor color (- 0 dvalue)))
(pika-image-select-polygon img
CHANNEL-OP-REPLACE
10
(gen_bottom_array xsize ysize innerwidth innerheight outerwidth outerheight))
(pika-drawable-edit-fill layer FILL-BACKGROUND)
(pika-selection-none img)
(pika-image-undo-group-end img)
(pika-displays-flush)
(pika-context-pop)
)
)
)
(script-fu-register "script-fu-addborder"
_"Add _Border..."
_"Add a border around an image"
"Andy Thomas <alt@picnic.demon.co.uk>"
"Andy Thomas"
"6/10/97"
"Andy Thomas <alt@picnic.demon.co.uk>, Michael Schumacher <schumaml@gmx.de>"
"Andy Thomas, Michael Schumacher"
"6/10/1997, 26/05/2017"
"*"
SF-IMAGE "Input image" 0
SF-DRAWABLE "Input drawable" 0
@ -171,6 +186,7 @@
SF-ADJUSTMENT _"Border Y size" '(12 1 250 1 10 0 1)
SF-COLOR _"Border color" '(38 31 207)
SF-ADJUSTMENT _"Delta value on color" '(25 1 255 1 10 0 1)
SF-TOGGLE _"Allow resizing" TRUE
)
(script-fu-menu-register "script-fu-addborder"

View File

@ -23,6 +23,7 @@
(theNumber inNumber)
(theSize (min theWidth theHeight))
(theStain 0)
(theSpread 0)
)
(pika-context-push)
@ -42,6 +43,7 @@
(pika-drawable-edit-clear theStain)
(let ((blobSize (/ (rand (- theSize 40)) (+ (rand 3) 1))))
(if (< blobSize 32) (set! blobSize 32))
(pika-image-select-ellipse theImage
CHANNEL-OP-REPLACE
(/ (- theSize blobSize) 2)
@ -49,17 +51,24 @@
blobSize blobSize)
)
; clamp the spread value to the 'plug-in-spread' limits
(set! theSpread (/ theSize 25))
(if (> theSpread 200) (set! theSpread 200))
(script-fu-distress-selection theImage theStain
(- (* (+ (rand 15) 1) (+ (rand 15) 1)) 1)
(/ theSize 25) 4 2 TRUE TRUE)
theSpread 4 2 TRUE TRUE)
(pika-context-set-gradient "Coffee")
(pika-drawable-edit-gradient-fill theStain
GRADIENT-SHAPEBURST-DIMPLED 0
FALSE 0 0
TRUE
0 0 0 0)
; only fill if there is a selection
(if (> (car (pika-selection-bounds theImage)) 0)
(pika-drawable-edit-gradient-fill theStain
GRADIENT-SHAPEBURST-DIMPLED 0
FALSE 0 0
TRUE
0 0 0 0)
)
(pika-layer-set-offsets theStain
(- (rand theWidth) (/ theSize 2))

View File

@ -115,11 +115,11 @@
(pika-drawable-fill (aref (cadr (pika-image-get-selected-layers img)) 0)
FILL-BACKGROUND)
(pika-selection-none img)
(set! text-layer (car (pika-text-fontname img -1 0 0
(set! text-layer (car (pika-text-font img -1 0 0
(string-append _"Contact Sheet "
(number->string num)
_" for directory " dir)
0 TRUE 14 PIXELS title-font)))
0 TRUE 14 title-font)))
(set! text-width (car (pika-drawable-get-width text-layer)))
(set! text-height (car (pika-drawable-get-height text-layer)))
(pika-layer-set-offsets text-layer
@ -246,8 +246,8 @@
(pika-image-delete new-img)
(set! tmp-layer (car (pika-text-fontname sheet-img -1 0 0 file
0 TRUE 12 PIXELS legend-font)))
(set! tmp-layer (car (pika-text-font sheet-img -1 0 0 file
0 TRUE 12 legend-font)))
(pika-layer-set-offsets tmp-layer
(+ border-x off-x (* pos-x (+ thumb-w border-x))
(/ (- thumb-w (car (pika-drawable-get-width tmp-layer))) 2))

View File

@ -28,8 +28,8 @@
(if (= use-name TRUE)
(set! text font))
(set! extents (pika-text-get-extents-fontname text
font-size PIXELS
(set! extents (pika-text-get-extents-font text
font-size
font))
(set! width (car extents))
(if (> width maxwidth)
@ -55,8 +55,8 @@
(if (= use-name TRUE)
(set! text font)
)
(set! extents (pika-text-get-extents-fontname text
font-size PIXELS
(set! extents (pika-text-get-extents-font text
font-size
font))
(set! height (cadr extents))
(if (> height maxheight)
@ -120,25 +120,25 @@
(if (= use-name TRUE)
(set! text font))
(pika-text-fontname img -1
(pika-text-font img -1
border
y
text
0 TRUE font-size PIXELS
0 TRUE font-size
font)
(set! y (+ y maxheight))
(if (= labels TRUE)
(begin
(pika-floating-sel-anchor (car (pika-text-fontname img drawable
(pika-floating-sel-anchor (car (pika-text-font img drawable
(- border
(/ label-size 2))
(- y
(/ label-size 2))
font
0 TRUE
label-size PIXELS
label-size
"Sans")))
(set! y (+ y label-size))
)

View File

@ -47,7 +47,7 @@
drawable
text
number
fontname
font
font-color
work-on-copy)
@ -134,50 +134,55 @@
; add the text
(pika-context-set-foreground font-color)
(pika-floating-sel-anchor (car (pika-text-fontname image
(pika-floating-sel-anchor (car (pika-text-font
image
film-layer
(+ hole-start (* -0.25 width))
(* 0.01 height)
text
0
TRUE
(* 0.040 height) PIXELS fontname)))
(pika-floating-sel-anchor (car (pika-text-fontname image
(* 0.040 height) font)))
(pika-floating-sel-anchor (car (pika-text-font
image
film-layer
(+ hole-start (* 0.75 width))
(* 0.01 height)
text
0
TRUE
(* 0.040 height) PIXELS
fontname )))
(pika-floating-sel-anchor (car (pika-text-fontname image
(* 0.040 height)
font )))
(pika-floating-sel-anchor (car (pika-text-font
image
film-layer
(+ hole-start (* 0.35 width))
0.0
number
0
TRUE
(* 0.050 height) PIXELS
fontname )))
(pika-floating-sel-anchor (car (pika-text-fontname image
(* 0.050 height)
font )))
(pika-floating-sel-anchor (car (pika-text-font
image
film-layer
(+ hole-start (* 0.35 width))
(* 0.94 height)
number
0
TRUE
(* 0.050 height) PIXELS
fontname )))
(pika-floating-sel-anchor (car (pika-text-fontname image
(* 0.050 height)
font )))
(pika-floating-sel-anchor (car (pika-text-font
image
film-layer
(+ hole-start (* 0.85 width))
(* 0.945 height)
numbera
0
TRUE
(* 0.045 height) PIXELS
fontname )))
(* 0.045 height)
font )))
; create a mask for the holes and cut them out
(let* (

View File

@ -51,9 +51,9 @@
(light-end-x (+ cx (* radius (cos (+ *pi* radians)))))
(light-end-y (- cy (* radius (sin (+ *pi* radians)))))
(offset (* radius 0.1))
(text-extents (pika-text-get-extents-fontname multi-text
size PIXELS
font))
(text-extents (pika-text-get-extents-font multi-text
size
font))
(x-position (- cx (/ (car text-extents) 2)))
(y-position (- cy (/ (cadr text-extents) 2)))
(shadow-w 0)
@ -116,11 +116,11 @@
(pika-selection-none img)
(pika-context-set-foreground '(0 0 0))
(pika-floating-sel-anchor (car (pika-text-fontname img drawable
(pika-floating-sel-anchor (car (pika-text-font img drawable
x-position y-position
multi-text
0 TRUE
size PIXELS
size
font)))
(pika-image-undo-enable img)

View File

@ -23,82 +23,57 @@
; SF-COLOR "label" "color"
;
; ----------------------------------------------------------------------
; SF-FONT
; creates a font-selection widget in the dialog. It returns a fontname as
; a string. There are two new pika-text procedures to ease the use of this
; return parameter:
; Resources: Brush, Font, Gradient, Palette, Pattern
;
; (pika-text-fontname image drawable
; x-pos y-pos text border antialias size unit font)
; (pika-text-get-extents-fontname text size unit font))
; Resources are Pika objects for installed data such as fonts.
; Resources have a unique integer ID for the lifetime of a Pika session.
; In ScriptFu, a resource argument is bound to an integer ID.
;
; where font is the fontname you get. The size specified in the fontname
; is silently ignored. It is only used in the font-selector. So you are
; asked to set it to a useful value (24 pixels is a good choice) when
; using SF-FONT.
; Resources have names, often unique, but not always.
; For example, fonts from different collections of fonts might
; have the same names.
;
; Usage:
; SF-FONT "label" "fontname"
; ScriptFu v3 does not let you name a default resource.
; In v2, the third term of a triplet named a default resource.
; In v3, the third term is just a placeholder and is ignored.
; This is compatible with v2 scripts, but any default
; in a v2 script will be ignored in v3.
; (Similarly as for SF-IMAGE.)
;
; In the code below, a default name is shown,
; but is ignored since v3.
; Some even name resources that are not installed with Pika any longer.
;
; In non-interactive mode, a resource argument in ScriptFu
; is an integer ID passed by the caller.
;
; In interactive mode, the widget to choose a resource
; initially shows a resource from the context.
; The user can choose a different value.
;
; The resource chooser widgets are buttons.
; The choice is previewed in the label of the button,
; or in a preview window beside the button.
; Clicking the button shows another dialog for choosing.
; Clicking a preview window shows an enlarged view of the choice.
;
; ----------------------------------------------------------------------
; SF-BRUSH
; is only useful in interactive mode. It will create a widget in the control
; dialog. The widget consists of a preview area (which when pressed will
; produce a popup preview ) and a button with the "..." label. The button will
; popup a dialog where brushes can be selected and each of the
; characteristics of the brush can be modified.
;
; The actual value returned when the script is invoked is a list
; consisting of Brush name, opacity, spacing and brush mode in the same
; units as passed in as the default value.
;
; Usage:
; SF-BRUSH "Brush" '("Circle (03)" 100 44 0)
;
; Here the brush dialog will be popped up with a default brush of Circle (03)
; opacity 100 spacing 44 and paint mode of Normal (value 0).
; If this selection was unchanged the value passed to the function as a
; parameter would be '("Circle (03)" 100 44 0).
;
; SF-BRUSH "Brush to paint with" ""
; Note that v2 required a list for the third argument, the default.
; If you need the spacing attribute of the brush, get it from the brush.
; If you want to set opacity and mode when painting with the brush,
; declare more arguments and set them into a temporary context.
; ----------------------------------------------------------------------
; SF-PATTERN
; Only useful in interactive mode. It will create a widget in the control
; dialog. The widget consists of a preview area (which when pressed will
; produce a popup preview ) and a button with the "..." label. The button will
; popup a dialog where patterns can be selected.
;
; Usage:
; SF-PATTERN "Pattern" "Maple Leaves"
;
; The value returned when the script is invoked is a string containing the
; pattern name. If the above selection was not altered the string would
; contain "Maple Leaves"
;
; ----------------------------------------------------------------------
; SF-GRADIENT
; Only useful in interactive mode. It will create a widget in the control
; dialog. The widget consists of a button containing a preview of the selected
; gradient. If the button is pressed a gradient selection dialog will popup.
;
; Usage:
; SF-GRADIENT "Gradient" "Deep Sea"
;
; The value returned when the script is invoked is a string containing the
; gradient name. If the above selection was not altered the string would
; contain "Deep Sea"
;
; ----------------------------------------------------------------------
; SF-PALETTE
; Only useful in interactive mode. It will create a widget in the control
; dialog. The widget consists of a button containing a preview of the selected
; palette. If the button is pressed a palette selection dialog will popup.
;
; Usage:
; SF-PALETTE "Palette" "Named Colors"
;
; The value returned when the script is invoked is a string containing the
; palette name. If the above selection was not altered the string would
; contain "Named Colors"
; SF-FONT "Font to render with" ""
; SF-GRADIENT "Gradient to render with" ""
; SF-PALETTE "Palette to render with" ""
; SF-PATTERN "Pattern to render with" ""
;
; ----------------------------------------------------------------------
; SF-FILENAME
@ -189,9 +164,9 @@
(light-end-x (+ cx (* radius (cos (+ *pi* radians)))))
(light-end-y (- cy (* radius (sin (+ *pi* radians)))))
(offset (* radius 0.1))
(text-extents (pika-text-get-extents-fontname multi-text
size PIXELS
font))
(text-extents (pika-text-get-extents-font multi-text
size
font))
(x-position (- cx (/ (car text-extents) 2)))
(y-position (- cy (/ (cadr text-extents) 2)))
(shadow-w 0)
@ -254,11 +229,11 @@
(pika-selection-none img)
(pika-context-set-foreground '(0 0 0))
(pika-floating-sel-anchor (car (pika-text-fontname img drawable
(pika-floating-sel-anchor (car (pika-text-font img drawable
x-position y-position
multi-text
0 TRUE
size PIXELS
size
font)))
(pika-image-undo-enable img)

View File

@ -38,7 +38,7 @@
(pika-image-undo-disable img)
(pika-context-set-foreground color)
(set! text-layer (car (pika-text-fontname img -1 0 0 text 10 TRUE size PIXELS font)))
(set! text-layer (car (pika-text-font img -1 0 0 text 10 TRUE size font)))
(set! width (car (pika-drawable-get-width text-layer)))
(set! height (car (pika-drawable-get-height text-layer)))
(pika-image-resize img width height 0 0)
@ -52,7 +52,7 @@
(script-fu-register "script-fu-helloworld"
"_Hello World..."
"Creates an image with a user specified text string."
"Creates an image of a text string."
"Kevin Cozens <kcozens@interlog.com>"
"Kevin Cozens"
"February 29, 2004"