Advertisement
metallaro1980

signature for gimp v2 variable

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