1;; Tuxracer - RGBs saver
2;; Copyright (C) 2000 Ingo Ruhnke <grumbel@gmx.de>
3;;
4;; Saves a layed image as seperated RGB images using the layer names
5;; as filenames + .rgb
6;;
7;; This program is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 2 of the License, or
10;; (at your option) any later version.
11;;
12;; This program is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15;; GNU General Public License for more details.
16;;
17;; You should have received a copy of the GNU General Public License
18;; along with this program; if not, write to the Free Software
19;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21(define (script-fu-tuxracer-save-as-rgbs inImage inDraw pathname)
22  (let ((layers (gimp-image-get-layers inImage))
23	(layer-count 0))
24
25    (while (< layer-count (car layers))
26	   (let ((layer (aref (cadr layers) layer-count)))
27	     (file-sgi-save 1 inImage layer
28			    (string-append pathname "/"
29					   (car (gimp-layer-get-name layer))
30					   ".rgb")
31			    "foobar"
32			    0))
33	   (set! layer-count (+ layer-count 1)))))
34
35(script-fu-register
36    "script-fu-tuxracer-save-as-rgbs"
37    "<Image>/Script-Fu/Tuxracer/Save Image as RGBs"
38    "Saves a layed image as seperated RGB images using the layer names as filenames + .rgb"
39    "Ingo Ruhnke"
40    "1999, Ingo Ruhnke"
41    "Fri Mar  3 16:00:13 2000"
42    "RGBA"
43    SF-IMAGE "Image" 0
44    SF-DRAWABLE "Drawable" 0
45    SF-FILENAME "Directory:" "/tmp/")
46