;;; File: ;;; forbid.ss ;;; Author: ;;; Samuel A. Rebelsky ;;; Version: ;;; 1.1 of October 2002 ;;; Summary: ;;; A simple GIMP Script for drawing a "forbidden" sign. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Libraries ;;; Load the not-so-legendary Glimmer Script Fu Utilities (load "/home/rebelsky/Web/Glimmer/ScriptFu/Code/gsfu.scm") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Procedures (define color-surround (lambda (image layer count colors) (let ((foreground (car (gimp-palette-get-foreground)))) (cs-kernel image layer count colors) (gimp-palette-set-foreground foreground) ))) (define cs-kernel (lambda (image layer count colors) (if (= count 0) (gimp-selection-none image) (begin (gimp-by-color-select layer WHITE 0 REPLACE FALSE 0 0 0) (gimp-selection-invert image) (gimp-palette-set-foreground (car colors)) (gimp-edit-stroke layer) (cs-kernel image layer (- count 1) (rotate colors)))))) (define gsfu-save-state (lambda (image layer) (gimp-selection-all image) (gimp-edit-copy layer) (gimp-selection-none image))) (define gsfu-restore-state (lambda (image layer) (gimp-selection-all image) (gimp-edit-paste layer 0) (gimp-selection-none image))) (define select-white (lambda (image layer) (gimp-by-color-select layer WHITE 0 REPLACE FALSE 0 0 0) (gimp-selection-invert image))) (define rotate (lambda (lst) (append (cdr lst) (list (car lst))))) (define BLUE0 (list 0 0 255)) (define BLUE1 (list 0 0 223)) (define BLUE2 (list 0 0 191)) (define BLUE3 (list 0 0 159)) (define BLUE4 (list 0 0 127)) (define BLUE5 (list 0 0 95)) (define BLUE6 (list 0 0 63)) (define BLUE7 (list 0 0 31)) (define blueify (lambda (image layer count) (color-surround image layer count (reflect (list BLUE0 BLUE1 BLUE2 BLUE3 BLUE4 BLUE5))))) (define reflect (lambda (lst) (append lst (cdr (reverse (cdr lst)))))) (define rainbow (lambda (image layer count) (color-surround image layer count (reflect (list RED ORANGE YELLOW GREEN BLUE INDIGO VIOLET))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Loading (script-fu-register "blueify" "/Script-Fu/Sample/Blueify" "Surrounds the image with some blue" "Samuel A. Rebelsky" "Copyright (c) 2002 Samuel A. Rebelsky. All Rights Reserved" "Wednesday, 30 October 2002" "RGB" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-VALUE "Repetitions" "10") (script-fu-register "rainbow" "/Script-Fu/Sample/Rainbow" "Surrounds the image with a rainow of colors" "Samuel A. Rebelsky" "Copyright (c) 2002 Samuel A. Rebelsky. All Rights Reserved" "Wednesday, 30 October 2002" "RGB" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-VALUE "Repetitions" "10")