; The GIMP -- an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; read/write a tattoo script for GIMP 1.2 ; Copyright (C) 2001 Iccii ; ; ; -------------------------------------------------------------------- ; version 0.1 by Iccii 2001/09/29 ; - Initial relase (Beta test version) ; version 0.1a by Iccii 2001/10/20 ; - Can read a tattoo in Path (Beta test version2) ; ; -------------------------------------------------------------------- ; ; 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., 675 Mass Ave, Cambridge, MA 02139, USA. ; ;; View current parasites, or Read or Write or Remove a parasite (define (script-fu-read-write-tattoo img ;; target imgae drawable ;; target drawable method ;; read / write / get by tattoo check ;; check Drawable or Path? tattoo-no ;; tattoo number ) (define (list-ref l n) (nth n l)) (let* ((result-tattoo 0) (target-object (cond ((= check 0) "Drawable") ((= check 1) "Path" ) ((= check 2) "Image" ) ('else "!! FAILURE !!")))) (cond ((= check 0) (if (< 0 (car (gimp-drawable-is-layer drawable))) (set! result-tattoo (car (gimp-layer-get-tattoo drawable))) ) (if (< 0 (car (gimp-drawable-is-channel drawable))) (set! result-tattoo (car (gimp-channel-get-tattoo drawable))) ) ) ((= check 1) (if (eqv? (car (gimp-path-list img)) FALSE) (gimp-message "Found not current active Path.") (begin (set! pathname (car (gimp-path-get-current img))) (set! result-tattoo (car (gimp-path-get-tattoo img pathname))) )) ) ((= check 2) (set! result-tattoo (car (gimp-image-get-tattoo-state img))) ) ) ; end of cond (if (< 0 result-tattoo) (gimp-message (string-append "Current Tattoo is " (number->string result-tattoo) " in " target-object)) (gimp-message "Found not a tattoo.") ) ) ; end of let* ) ; end of define (script-fu-register "script-fu-read-write-tattoo" "/Script-Fu/Utils/Read or Write a Tattoo..." "Read/Write a tattoo in drawable or path" "Iccii " "Iccii" "2001, Oct" "RGB* GRAY* INDEXED*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-OPTION "Method" '("Read" "Write" "Get by tattoo") SF-OPTION "Target Object" '("Current Drawable" "Current Path" "Current Image" "W") SF-ADJUSTMENT "Number" '(0 0 127 1 10 0 1) )