1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
############################################################################
#
# File: isd2gif.icn
#
# Subject: Program to create woven image from ISD
#
# Author: Ralph E. Griswold
#
# Date: May 23, 2002
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# This program reads a internal structure draft and creates a GIF image of
# the corresponding weave. The command-line option
#
# -n s
#
# allows the basename for the GIF file to be specified. Otherwise, it
# is take from the name field of the ISD. If other command-line arguments
# are given, they are used as attributes for the window in which the
# woven image is created.
#
############################################################################
#
# Links: options, weavegif, weavutil, xcode
#
############################################################################
link options
link weavegif
link weavutil
link xcode
procedure main(args)
local draft, width, spacing, bg, opts
isd # Hands off, linker.
opts := options(args, "n:")
width := 5
spacing := 0
bg := "black"
push(args, "canvas=hidden")
draft := xdecode(&input) | stop("*** cannot decode isd")
draft.name := \opts["n"] # override if given
if /draft.name then draft.name := "untitled"
/draft.width := *draft.threading
/draft.height := *draft.treadling
WriteImage(weavegif(draft, args),
draft.name || ".gif")
end
|