(load "/home/rebelsky/Web/Glimmer/ScriptFu/Code/gsfu.scm") ;;; Procedure: ;;; circle ;;; Parameters: ;;; image, the id of an image ;;; layer, the id of a layer on that image ;;; x, an integer ;;; y, an integer ;;; r, an integer ;;; Purpose: ;;; Draws a circle centered at (x,y) with radius r using the ;;; current foreground color and brush. ;;; Produces: ;;; Nothing, or so I hope. ;;; Preconditions: ;;; image and layer define an existing image and layer ;;; x, y, and r are all non-negative ;;; Postconditions: ;;; The specified layer now contains a circle with the specified ;;; dimensions. (define circle (lambda (image layer x y r) (gimp-ellipse-select image (- x r) (- y r) (+ r r) (+ r r) REPLACE 0 0 0) (gimp-edit-stroke layer) (gimp-selection-none image))) ;;; Procedure: ;;; random-circle ;;; Parameters: ;;; image, the id of an image ;;; layer, the id of a layer on that image ;;; Purpose: ;;; Draws an "unpredictable" circle (or portion thereof) in the image. ;;; Produces: ;;; Nothing (define random-circle (let ((num-brushes (car (gimp-brushes-list))) (brushes (cadr (gimp-brushes-list)))) (lambda (image layer) (gimp-brushes-set-brush (list-ref brushes (rand num-brushes))) (gimp-palette-set-foreground (list (rand 256) (rand 256) (rand 256))) (circle image layer (rand (car (gimp-image-width image))) (rand (car (gimp-image-height image))) (rand 100)) )))