Advertisement
metallaro1980

signature for gimp

Apr 9th, 2018
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. ;enable only works with bottom and right checkbox
  2.  
  3.  
  4. (define (script-fu-Firma InImage InLayer en bottom right ur fg)
  5. (gimp-image-undo-group-start InImage)
  6.  
  7. (define line_points_1 (cons-array 4 'double)) ; line_points: Array of 4 doubles
  8. (define line_points_2 (cons-array 4 'double)) ; line_points: Array of 4 doubles
  9. (define line_points_3 (cons-array 4 'double)) ; line_points: Array of 4 doubles
  10. (define line_points_4 (cons-array 4 'double)) ; line_points: Array of 4 doubles
  11.  
  12. (let* ((cur-width (car (gimp-image-width InImage)))
  13. (cur-height (car (gimp-image-height InImage)))
  14. (y (- cur-height 60))
  15. (x (- cur-width 245))
  16. )
  17.  
  18.  
  19.  
  20. (aset line_points_1 0 190) ; x1
  21. (aset line_points_1 1 80) ; y1
  22. (aset line_points_1 2 690) ; x2
  23. (aset line_points_1 3 80) ; y2
  24.  
  25. (aset line_points_2 0 190)
  26. (aset line_points_2 1 y)
  27. (aset line_points_2 2 690)
  28. (aset line_points_2 3 y)
  29.  
  30. (aset line_points_3 0 x)
  31. (aset line_points_3 1 y)
  32. (aset line_points_3 2 690)
  33. (aset line_points_3 3 (+ x 500))
  34.  
  35. (aset line_points_4 0 x)
  36. (aset line_points_4 1 80)
  37. (aset line_points_4 2 (+ x 500))
  38. (aset line_points_4 3 80)
  39.  
  40.  
  41. )
  42.  
  43.  
  44. (gimp-context-set-paint-mode NORMAL-MODE)
  45. (gimp-context-set-background '(000 000 000))
  46. (gimp-context-set-foreground fg)
  47. (gimp-context-set-paint-method "gimp-paintbrush")
  48.  
  49. (gimp-brushes-set-brush "Firma")
  50. (gimp-context-set-brush-force 1.0)
  51. (gimp-context-set-brush-size 500)
  52. (gimp-context-set-brush-angle 0.0)
  53. (gimp-context-set-brush-aspect-ratio 0.0)
  54.  
  55.  
  56. (cond ;ULTIME MOD
  57. ((= en TRUE) ;ULTIME MOD
  58.  
  59. (cond
  60. ((= bottom FALSE) (gimp-paintbrush InLayer 0 2 line_points_1 PAINT-CONSTANT 0))
  61. ((= bottom TRUE)
  62. (cond ((= right TRUE) (gimp-paintbrush InLayer 0 2 line_points_3 PAINT-CONSTANT 0))
  63. ((= right FALSE) (gimp-paintbrush InLayer 0 2 line_points_2 PAINT-CONSTANT 0)))
  64.  
  65. )
  66. )
  67.  
  68. )) ;ULTIME MOD
  69.  
  70.  
  71.  
  72. (cond
  73. ((= ur TRUE) (gimp-paintbrush InLayer 0 2 line_points_4 PAINT-CONSTANT 0))
  74. )
  75.  
  76. (gimp-image-undo-group-end InImage)
  77. (gimp-displays-flush)
  78. )
  79.  
  80. (script-fu-register
  81. "script-fu-Firma"
  82. _"Firma"
  83. _"With Bottom and Right = false -> Upper Left, With Bottom = True and Right = False -> Bottom Left, With Bottom = True and Right = True -> Bottom Right"
  84. "Andrea Verdi"
  85. "Andrea Verdi"
  86. "2017,2018"
  87. "RGB*"
  88. SF-IMAGE "The Image" 0
  89. SF-DRAWABLE "The Layer" 0
  90. SF-TOGGLE _"Enable Bottom and Right" FALSE
  91. SF-TOGGLE _"Bottom (Parte inferiore)" FALSE
  92. SF-TOGGLE _"Right (Destra)" FALSE
  93. SF-TOGGLE _"Top Right (Parte superiore Destra)" FALSE
  94. SF-COLOR _"Color of signature (Colore firma)" '(255 255 255)
  95. )
  96.  
  97.  
  98. (script-fu-menu-register "script-fu-Firma"
  99. "<Image>/Filters/Image/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement