home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / beveled-pattern-bullet.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  3.1 KB  |  96 lines

  1. ; GIMP - The GNU Image Manipulation Program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; Beveled pattern bullet for web pages
  5. ; Copyright (C) 1997 Federico Mena Quintero
  6. ; federico@nuclecu.unam.mx
  7. ;
  8. ; This program is free software: you can redistribute it and/or modify
  9. ; it under the terms of the GNU General Public License as published by
  10. ; the Free Software Foundation; either version 3 of the License, or
  11. ; (at your option) any later version.
  12. ;
  13. ; This program is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20.  
  21.  
  22. (define (script-fu-beveled-pattern-bullet diameter pattern transparent)
  23.   (let* (
  24.         (img (car (gimp-image-new diameter diameter RGB)))
  25.         (background (car (gimp-layer-new img diameter diameter RGBA-IMAGE "Bullet" 100 NORMAL-MODE)))
  26.         (bumpmap (car (gimp-layer-new img diameter diameter RGBA-IMAGE "Bumpmap" 100 NORMAL-MODE)))
  27.         )
  28.  
  29.     (gimp-context-push)
  30.  
  31.     (gimp-image-undo-disable img)
  32.     (gimp-image-add-layer img background -1)
  33.     (gimp-image-add-layer img bumpmap -1)
  34.  
  35.     ; Create pattern layer
  36.  
  37.     (gimp-context-set-background '(0 0 0))
  38.     (gimp-edit-fill background BACKGROUND-FILL)
  39.     (gimp-context-set-pattern pattern)
  40.     (gimp-edit-bucket-fill background PATTERN-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
  41.  
  42.     ; Create bumpmap layer
  43.  
  44.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  45.  
  46.     (gimp-context-set-background '(127 127 127))
  47.     (gimp-ellipse-select img 1 1 (- diameter 2) (- diameter 2) CHANNEL-OP-REPLACE TRUE FALSE 0)
  48.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  49.  
  50.     (gimp-context-set-background '(255 255 255))
  51.     (gimp-ellipse-select img 2 2 (- diameter 4) (- diameter 4) CHANNEL-OP-REPLACE TRUE FALSE 0)
  52.     (gimp-edit-fill bumpmap BACKGROUND-FILL)
  53.  
  54.     (gimp-selection-none img)
  55.  
  56.     ; Bumpmap
  57.  
  58.     (plug-in-bump-map RUN-NONINTERACTIVE img background bumpmap 135 45 2 0 0 0 0 TRUE FALSE 0)
  59.  
  60.     ; Background
  61.  
  62.     (gimp-context-set-background '(0 0 0))
  63.     (gimp-ellipse-select img 0 0 diameter diameter CHANNEL-OP-REPLACE TRUE FALSE 0)
  64.     (gimp-selection-invert img)
  65.     (gimp-edit-clear background)
  66.     (gimp-selection-none img)
  67.  
  68.     (gimp-image-set-active-layer img background)
  69.     (gimp-image-remove-layer img bumpmap)
  70.  
  71.     (if (= transparent FALSE)
  72.         (gimp-image-flatten img))
  73.  
  74.     (gimp-image-undo-enable img)
  75.     (gimp-display-new img)
  76.  
  77.     (gimp-context-pop)
  78.   )
  79. )
  80.  
  81.  
  82. (script-fu-register "script-fu-beveled-pattern-bullet"
  83.   _"_Bullet..."
  84.   _"Create a beveled pattern bullet for webpages"
  85.   "Federico Mena Quintero"
  86.   "Federico Mena Quintero"
  87.   "July 1997"
  88.   ""
  89.   SF-ADJUSTMENT _"Diameter"               '(16 1 150 1 10 0 1)
  90.   SF-PATTERN    _"Pattern"                "Wood"
  91.   SF-TOGGLE     _"Transparent background" FALSE
  92. )
  93.  
  94. (script-fu-menu-register "script-fu-beveled-pattern-bullet"
  95.                          "<Image>/File/Create/Web Page Themes/Beveled Pattern")
  96.