home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 June / june_2001.iso / Multimedia / Images / Gimp / setup.exe / Main / erase-rows.scm < prev    next >
Encoding:
Text File  |  2000-10-23  |  1.1 KB  |  35 lines

  1. (define (script-fu-erase-rows img drawable orientation which)
  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.                (gimp-edit-fill drawable BG-IMAGE-FILL)
  12.                (loop (+ i 2) max))))))
  13.       (loop (if (= which 0)
  14.         0
  15.         1)
  16.         (if (= orientation 0)
  17.         height
  18.         width)))
  19.     (gimp-selection-none img)
  20.     (gimp-undo-push-group-end img)
  21.     (gimp-displays-flush)))
  22.  
  23. (script-fu-register "script-fu-erase-rows"
  24.             _"<Image>/Script-Fu/Alchemy/Erase every other Row..."
  25.             "Erase every other row/column with the background color"
  26.             "Federico Mena Quintero"
  27.             "Federico Mena Quintero"
  28.             "June 1997"
  29.             "RGB* GRAY* INDEXED*"
  30.             SF-IMAGE "Image" 0
  31.             SF-DRAWABLE "Drawable" 0
  32.             SF-OPTION _"Rows/Cols" '(_"Rows" _"Columns")
  33.             SF-OPTION _"Even/Odd"  '(_"Even" _"Odd"))
  34.  
  35.