;;; thirds.scm v0.1 ;;; Copyright (c) 2005 John Hall (jhall@alum.wpi.edu) ;;; ;;; A Script-Fu script for The GIMP to draw the lines for the "Rule Of ;;; Thirds." ;;; ;;; ;;; This program is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2 of the License, or ;;; (at your option) any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software ;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; ;;; ;;; Revision history: ;;; ;;; v0.1: - First public release ;; Draws the lines for the "Rule Of Thirds." The lines are drawn on a ;; new layer. (define (script-fu-rule-of-thirds image drawable) (let* ((old-brush (gimp-context-get-brush)) (old-foreground (gimp-context-get-foreground)) (*points* (cons-array 4 'double)) (width (car (gimp-image-width image))) (height (car (gimp-image-height image))) (new-layer (car (gimp-layer-new image width height RGBA-IMAGE "Rule Of Thirds" 100.0 NORMAL-MODE)))) (gimp-image-undo-group-start image) (gimp-image-add-layer image new-layer -1) (gimp-edit-clear new-layer) (gimp-context-set-brush "Circle (03)") (gimp-context-set-foreground '(255 0 0)) (aset *points* 0 (/ width 3)) (aset *points* 1 0) (aset *points* 2 (/ width 3)) (aset *points* 3 height) (gimp-pencil new-layer 4 *points*) (aset *points* 0 (* 2 (/ width 3))) (aset *points* 2 (* 2 (/ width 3))) (gimp-pencil new-layer 4 *points*) (aset *points* 0 0) (aset *points* 1 (/ height 3)) (aset *points* 2 width) (aset *points* 3 (/ height 3)) (gimp-pencil new-layer 4 *points*) (aset *points* 1 (* 2 (/ height 3))) (aset *points* 3 (* 2 (/ height 3))) (gimp-pencil new-layer 4 *points*) (gimp-context-set-brush (car old-brush)) (gimp-context-set-foreground (car old-foreground)) (gimp-image-undo-group-end image) (gimp-displays-flush) (list image))) (script-fu-register "script-fu-rule-of-thirds" "/Script-Fu/Utils/Rule Of Thirds" "Draws the lines for the Rule Of Thirds." "John Hall" "John Hall" "2004" "" SF-IMAGE "The image" 0 SF-DRAWABLE "The layer (not used)" 0)