summaryrefslogtreecommitdiff
path: root/ipl/gprogs/giftopat.icn
blob: 86abe9d8458c888b4c51a50ad68e4a6c8f89fa4c (plain)
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
############################################################################
#
#	File:     giftopat.icn
#
#	Subject:  Program to convert GIF image to hex-form pattern
#
#	Author:   Ralph E. Griswold
#
#	Date:     May 29, 1999
#
############################################################################
#
#  This file is in the public domain.
#
############################################################################
#
#  This program convert GIF images, whose names are given on the command
#  line to bi-level patterns.  The GIFs are expected to be black and white.
#  All non-white pixels are treated as black
#
############################################################################
#
#  Requires:  Version 9 graphics
#
############################################################################
#
#  Links:  imsutils, wopen
#
############################################################################

link imsutils
link wopen

procedure main(args)
   local file, win

   while file := get(args) do {
      win := WOpen("image=" || file, "canvas=hidden") | {
         write(&errout, "cannot open ", file)
         next
         }
      write(pix2pat(win, 0, 0, WAttrib("width"), WAttrib("height")))
      WClose(win)
      }

end