Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;you had to change the standard fixed number... 60, 190, 80
- ;you had to use a signature brush with 500 of size..and change them (60, 190, 80)
- ;i fixed some bugs
- (define (script-fu-Firma2 InImage InLayer size ul dl dr ur fg)
- (gimp-image-undo-group-start InImage)
- (gimp-context-set-paint-method "gimp-paintbrush")
- (gimp-context-set-paint-mode 0)
- (define line_points_1 (cons-array 4 'double)) ; line_points: Array of 4 doubles
- (define line_points_2 (cons-array 4 'double)) ; line_points: Array of 4 doubles
- (define line_points_3 (cons-array 4 'double)) ; line_points: Array of 4 doubles
- (define line_points_4 (cons-array 4 'double)) ; line_points: Array of 4 doubles
- (let* ((cur-width (car (gimp-image-width InImage)))
- (cur-height (car (gimp-image-height InImage)))
- (y (- cur-height (/ (* 60 size) 500)))
- (x (- cur-width (/ size 2)))
- )
- (aset line_points_1 0 (/ (* 190 size) 500))
- (aset line_points_1 1 (/ (* 80 size) 500)) ; y1
- (aset line_points_1 2 (/ (* 190 size) 500))
- (aset line_points_1 3 (/ (* 80 size) 500)) ; y1
- ;(aset line_points_2 0 190)
- (aset line_points_2 0 (/ (* 190 size) 500))
- (aset line_points_2 1 y)
- (aset line_points_2 2 (/ (* 190 size) 500))
- (aset line_points_2 3 y)
- (aset line_points_3 0 (+ x 10))
- (aset line_points_3 1 y)
- (aset line_points_3 2 (+ x 10))
- (aset line_points_3 3 y)
- (aset line_points_4 0 (+ x 10))
- (aset line_points_4 1 (/ (* 80 size) 500)) ; y1
- (aset line_points_4 2 (+ x 10))
- (aset line_points_4 3 (/ (* 80 size) 500)) ; y1
- )
- (gimp-context-set-paint-mode NORMAL-MODE)
- (gimp-context-set-background '(000 000 000))
- (gimp-context-set-foreground fg)
- (gimp-context-set-paint-method "gimp-paintbrush")
- (gimp-context-set-paint-mode 0)
- (gimp-context-set-brush "Firma")
- (gimp-context-set-brush-force 1)
- (gimp-context-set-brush-size size)
- (gimp-context-set-brush-angle 0)
- (gimp-context-set-brush-aspect-ratio 0)
- (cond
- ((= ul TRUE) (gimp-paintbrush InLayer 0 2 line_points_1 PAINT-CONSTANT 0))
- )
- (cond
- ((= dl TRUE) (gimp-paintbrush InLayer 0 2 line_points_2 PAINT-CONSTANT 0))
- )
- (cond
- ((= dr TRUE) (gimp-paintbrush InLayer 0 2 line_points_3 PAINT-CONSTANT 0))
- )
- (cond
- ((= ur TRUE) (gimp-paintbrush InLayer 0 2 line_points_4 PAINT-CONSTANT 0))
- )
- (gimp-image-undo-group-end InImage)
- (gimp-displays-flush)
- )
- (script-fu-register
- "script-fu-Firma2"
- _"Firma v2"
- _""
- "Andrea Verdi"
- "Andrea Verdi"
- "2017,2018"
- "RGB*"
- SF-IMAGE "The Image" 0
- SF-DRAWABLE "The Layer" 0
- SF-ADJUSTMENT _"Size of signature (Dimensione Firma)" '(500.0 200.0 1000.0 1.0 0 1 0)
- SF-TOGGLE _"Top Left (Angolo alto sx)" FALSE
- SF-TOGGLE _"Bottom Left (Angolo basso sx)" FALSE
- SF-TOGGLE _"Bottom Right (Angolo basso dx)" FALSE
- SF-TOGGLE _"Top Right (Angolo alto dx)" FALSE
- SF-COLOR _"Color of signature (Colore firma)" '(255 255 255)
- )
- (script-fu-menu-register "script-fu-Firma2"
- "<Image>/Filters/Image/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement