[fa.info-mac] New MACQMS.PAS

info-mac@uw-beaver (01/04/85)

From: Eric <LAVITSKY@RUTGERS.ARPA>

Hi,

 I have updated Macqms to create an output file without all the
positioning information. This is for the purpose of inserting the
picture into a document with a system like Scribe. It is assumed
that whatever system is used will create the space for the picture
and position it properly within the document. I am also including
the documentation that is being used here at Rutgers. It gives a few
details of the bitmap formats for the different machines and how to
use pictures from within Scribe. While this stuff is probably pretty
specific to our site, it should provide some insights on how it
could/should be done elswhere.

Eric


[Eric's MACQMS is written in Pascal and runs on TOPS20.  The program
and document are stored on <info-mac>macqms.pas and macqms.pasdoc.
Below some sections from the document.]



                                    MACQMS

                           A Macintosh To QMS Bitmap
                              Conversion Facility


                               By: Eric Lavitsky
                               26 December 1984
                 Center For Computer and Information Services
                              Rutgers University
                            Piscataway, New Jersey


1. Introduction

1.1. Overview

The  Program  is  written  in  Rutgers  Pascal  and  was  inspired and based on
MACIMP.PAS from Ed Pattermann at Stanford  and  MACQMS.C  by  Van  Jacobsen  at
Lawrence  Berkely Laboratory. The latter version would not work at our site, so
I set out to write one in Pascal which  could  also  be  transported  to  other
sites/Pascals.

After a general understanding of the MacPaint and QUIC formats is accquired, it
would be a fairly trivial project to insert Macintosh pictures  into  your  own
documents  for printing on the QMS. The Macintosh image could also be converted
for output on various other devices. The appendices at the end of this document
may  give  you some insights. I would also recommend looking through the source
code to see  how  the  conversion  is  done.  If  these  don't  provide  enough
information,  I  have  found  the  QMS  programmers' manual to be an invaluable
resource in my efforts.

My thanks to Charles Mcgrew for his undying enthusiasm and contributions.

1.2. System Requirements

What you will need:

   - Macintosh computer with or without external disk drive
   - MacTerminal V1.1 or MacKermit
   - Modem or hardwired line to the DEC-20
   - The MODEM or Kermit program on the DEC-20
   - A Mac disk with MacPaint images on it (MacPaint is not needed)


2. Transferring files to the host computer

2.1. Modem and MacTerminal 1.1

2.1.1. Macintosh Settings

2.1.2. Transferring the file to the DEC-20

2.2. Kermit

2.2.1. Macintosh Settings

2.2.2. Transferring Files To The DEC-20

3. Running MACQMS

The MacPaint image has now been transferred to the 20. You can now go ahead and
convert it to a format suitable  for  printing  on  the  QMS  Lasergrafix  1200
printer.  You  can convert it to be printed as a seperate document (standalone)
or to be inserted in a document (document).

3.1. Converting Images For Standalone Printing

Suppose we called the picture file 'MAC-PICTURE.PIC'.  To  convert  it  to  QMS
format, run MACQMS on the 20:

            @MACQMS.EXE

MACQMS will prompt you for several things:

            MacQMS - A Mac Bitmap File to QMS Conversion Program
            Mac Filename to be Converted > MAC-PICTURE.PIC.1 
            Output filename > MAC-PICTURE.LG1200.1 
            Image Type > STANDALONE
            Enter magnification desired > 4
            Change default positioning parameters? No
            Processing file MAC-PICTURE.PIC.1 [OK]


Normally  you  will  respond  with  'No' to the prompt 'Change default printing
parameters? ' This will produce a  full  page,  1  image  reproduction  of  the
original  mac  picture in portrait mode (vertically oriented on the page). What
happens if you respond with 'Yes' at this prompt? ...

            MacQMS - A Mac Bitmap File to QMS Conversion Program
            Mac Filename to be Converted > MAC-PICTURE.PIC.1 
            Output filename > MAC-PICTURE.LG1200.1 
            Image Type > STANDALONE 
            Change default positioning parameters? Yes
            Enter magnification desired > 4 
            Number of copies > 1 
            Orientation > P 
            Images per page > 1 
            Images per row > 0 
            X-position > 410 
            Y-position > 700 
            Processing file MAC-PICTURE.PIC.1 [OK]


You may enter a value for any of these parameters or enter a carriage return to
use  the  default  value.  The settings shown here are the default values which
will print a full page image as described above. You may type a  question  mark
at any of the prompts for more help.

3.5. Using A Macintosh Picture In Scribe

If  you  want  to  use  the bitmap image from within a scribe document you must
first run MACQMS on the file and specify 'document' as the image type. In  your
SCRIBE source file, include the following where you want the image to appear:

            @picture(size=4.25in,nonscaleablelaser=foo.mss)

Where  'foo.mss'  is  the  name  of  the converted bitmap file.  The size tells
SCRIBE how much space to allow for the picture within the  text.  To  determine
what size you should use, use the following table:


            MACQMS Magnification                      SCRIBE Size

                    4                                     8.50 in
                    3                                     6.40 in
                    2                                     4.25 in
                    1                                     2.20 in

These  are  only  suggestions,  you  may  get  better results by using slightly
different values.

Mail any bug reports, comments to LAVITSKY@RUTGERS



I. MacPaint File Format

The first 512 bytes of the file are the header. The first four  bytes  comprise
the  version  number, followed by 38 * 8 = 304 bytes of patterns. The remaining
204 bytes are reserved for future expansion.  If the version  number  is  zero,
the  patterns are ignored. Hence, programs that wish to create files to be read
into MacPaint can just write out 512 bytes of zero as the header.

Following the header are 720 compressed scanlines of data which  form  the  576
wide  by 720 tall bitmap. The bitmap is compressed as follows: Any run of three
or more equal bytes is compressed into a count byte and  a  single  data  byte.
Runs of unequal bytes are passed on literally, preceeded also by a count byte.

          <count byte> <data byte>

                    count = -1..-127 ==> replicate byte 2..128 times

          <count byte> <n data bytes>

                    count = 0..127 ==> copy 1..128 times uncompressed

                    count = -128 ignored for backward compatibility



II. QMS Quic Bitmap Format

II.1. General Overview

The  QMS  Lasergrafix  1200  has  its'  own command language called 'QUIC'. The
printer has an actual resolution of 90,000 dots per square inch  and  the  QUIC
language  lets you take full advantage of all the 1200s' graphics capabilities.
The QUIC command language allows selection of fonts and use of downloaded fonts
for  multiple fonts on a page, bar codes, line drwaing, box drawing, horizontal
and vertical form drawing, bar charts,  pie  charts,  raster  graphics,  vector
graphics  and  area fill. QUIC also provides several powerfull page positioning
commands which allow precise plotting of all  QUIC  features  anywhere  on  the
page.

II.2. General QUIC Conventions

II.0.1. MacQms File Format