;############################################################################## ;# ;# Mericet Script-Fu Library - Highlight Area ;# ;# Author : Andreas Habel ;# Date : 2009/09/09 ;# Filename : mericet-highlightarea.scm ;# Version : 1.0.0 ;# ;# Support : http://mericet.de ;# Copyright : 2009, Andreas Habel (http://mericet.de) ;# ;#----------------------------------------------------------------------------- ;# ;# 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 3 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, see . ;# ;############################################################################## ; Create an array from a list. (define (list-to-array contents) (let* ((alen (length contents)) (n_array (cons-array alen 'double)) (count 0)) (for-each (lambda (val) (aset n_array count val) (set! count (+ count 1))) contents) n_array)) ;------------------------------------------------------------------------------ (define (mericet-highlightarea image layer border hcolor shadow) (gimp-image-undo-group-start image) (gimp-selection-border image border) (gimp-selection-feather image (/ border 2)) (gimp-context-set-foreground hcolor) (gimp-edit-fill layer FOREGROUND-FILL) (if (= shadow TRUE) (script-fu-drop-shadow image layer (/ border 2) (/ border 2) border '(0 0 0) 70 TRUE) () ) (gimp-image-undo-group-end image) (gimp-displays-flush) ) (script-fu-register "mericet-highlightarea" _"Highlight Area" "" "Andreas Habel " "Andreas Habel, " "Sep 09, 2009" "" SF-IMAGE "The image" 0 SF-DRAWABLE "The layer" 0 SF-VALUE "Borderwidth:" "3" SF-COLOR "Highlight Color:" '(255 0 0) SF-TOGGLE "Add shadow:" TRUE ) (script-fu-menu-register "mericet-highlightarea" "/Filters/Mericet")