Advertisement
metallaro1980

signature for gimp v2

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