home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 February / PCWorld_2001-02_cd.bin / Software / Topware / gimp / gimp-setup-20001226.exe / Main / erase-rows.scm < prev    next >
Encoding:
Text File  |  2000-12-27  |  1.2 KB  |  38 lines

  1. (define (script-fu-erase-rows img drawable orientation which type)
  2.   (let* ((width (car (gimp-drawable-width drawable)))
  3.      (height (car (gimp-drawable-height drawable))))
  4.     (gimp-undo-push-group-start img)
  5.     (letrec ((loop (lambda (i max)
  6.              (if (< i max)
  7.              (begin
  8.                (if (= orientation 0)
  9.                    (gimp-rect-select img 0 i width 1 REPLACE FALSE 0)
  10.                    (gimp-rect-select img i 0 1 height REPLACE FALSE 0))
  11.                (if (= type 0)
  12.                    (gimp-edit-clear drawable)
  13.                    (gimp-edit-fill drawable BG-IMAGE-FILL))
  14.                (loop (+ i 2) max))))))
  15.       (loop (if (= which 0)
  16.         0
  17.         1)
  18.         (if (= orientation 0)
  19.         height
  20.         width)))
  21.     (gimp-selection-none img)
  22.     (gimp-undo-push-group-end img)
  23.     (gimp-displays-flush)))
  24.  
  25. (script-fu-register "script-fu-erase-rows"
  26.             _"<Image>/Script-Fu/Alchemy/Erase every other Row..."
  27.             "Erase every other row/column with the background color"
  28.             "Federico Mena Quintero"
  29.             "Federico Mena Quintero"
  30.             "June 1997"
  31.             "RGB* GRAY* INDEXED*"
  32.             SF-IMAGE "Image" 0
  33.             SF-DRAWABLE "Drawable" 0
  34.             SF-OPTION _"Rows/Cols" '(_"Rows" _"Columns")
  35.             SF-OPTION _"Even/Odd"  '(_"Even" _"Odd")
  36.             SF-OPTION _"Erase/Fill"  '(_"Erase" _"Fill with BG"))
  37.  
  38.