home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / os9 / 1561 < prev    next >
Encoding:
Text File  |  1992-12-25  |  3.7 KB  |  71 lines

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