home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!cs.utexas.edu!tamsun.tamu.edu!tamsun.tamu.edu!news
- From: rlm7638@tamsun.tamu.edu (Ross Mckinney)
- Newsgroups: comp.os.os9
- Subject: gif to printer and standard os9 format!!!
- Date: 25 Dec 1992 10:58:37 -0600
- Organization: Texas A&M University, College Station, TX
- Lines: 59
- Distribution: na
- Message-ID: <1hfejtINN3uf@tamsun.tamu.edu>
- NNTP-Posting-Host: tamsun.tamu.edu
-
- I have just recently finished a program I have been working on for
- my Coco III under os9. I have been wanting a program to print GIF files
- to my printer, and have been wanting to distribute it here. The problem
- is that people woth different printers would not be able to use my code.
- My solution was to write two programs: gif2bits and nx1000. This made it
- necessary to have an intermediate format. For this I created a real
- simple format: a bitmap. The first six bytes of the file are 'BITMAP'.
- The next two are x-size (in bits), and the next two are y-size in bits.
- Then follow a succession of bits representing the image (x-size is rounded
- up to a multiple of eight so that each new line starts on a byte).
- Now all one has to do to use this program for their printer is to
- write a program which will send the simpler bitmap file to their printer.
- The point of this post is two-fold: Firstly, to point out that using
- this format, people could write other programs (say, a postscript translator
- that write this format. Then one printer program could print all of them,
- making it easier to have a secure printer(see below)
- The second reason is this: So far the 'frills' my gif2bits program has
- is limited: It currently will extract a subset of the image (specified in
- x and y positions). I am about to add an option to allow specifying a
- brightness file (256-byte file representing what each color should _really_
- be printed as). In the future I will be adding a '-m2' option which doubles
- the image size, allowing four printer pixels per image pixel, giving better
- color (greyscale, albeit) resolution. Does anyone have any ideas as to
- what else should be added? I'll post what I have in a day or two (after I
- add the brightness option and make up some standard brightness files).
-
- On nx1000: This program (and programs for the other printers) is
- written as a filter. I.e., the easiest way to print a file is
-
- OS9: nx1000 < bitsfile > /p
-
- The reason behind this is that nx1000 most modify the printers line
- spacing in order for the image to come out correctly. It does _not_
- reset the line spacing (it doesn't know what line spacing the _next_
- file printed may need). If someone were to write a printing program,
- say 'lpr', that printed text files to the printer in a queue, then it
- could set up such parameters at print time. But how then would one print
- a raw file as generated by nx1000? Simple: create an option: -r: print
- in pure (raw) format, no processing:
-
- OS9: nx1000 < bitsfile > raw file ; lpr -r rawfile
- <or>
- OS9: nx1000 < bitsfile | lpr -r rawfile
-
- Even better (and the point of all of this), since nx1000 is a filter,
- design lpr with the option of running its input through a filter (-f):
-
- OS9: lpr -r -fnx1000 bitsfile
-
- This allows the operator to have one printer queue to control _all_
- jobs.
- More to come (including the program) in a couple of days!
-
- +---------------------------------------------------+------------------------+
- | "I'll never be creul to electrons in a particle | Jack McKinney |
- | accelerator again." | jmckinney@tamu.edu |
- | -the Fourth Doctor, "The Pirate Planet", +------------------------+
- | Dr. Who | R[x] / <x^2+1> = C!!!! |
- +---------------------------------------------------+------------------------+
-