Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ coloropen(3) — GL1 W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

capture(1G)

colord(1)

capture(3G)

tek(7)

COLOROPEN(3)  —  Silicon Graphics

NAME

coloropen − open a file for color image output
colorwrite − write a record for color image output
colorclose − close an opened file for color image output and print it

SYNOPSIS

#include <stdio.h>
#include <sys/tek4692.h>
 
FILE *coloropen (dest, format, header, copies)
char *dest;
int format;
struct co_union *header;
int copies;
 
int colorwrite (fdesc,format,count,buf)
FILE *fdesc;
int format;
int count;
char *buf;
 
int colorclose (fdesc);
FILE *fdesc;

DESCRIPTION

Coloropen returns a pointer to an I/O stream to allow the calling program to write color raster data to the Tektronix 4692 printer.  Before returning the stream pointer, coloropen writes a header to the stream, specifying the image color resolution, the number of copies to print, and other information supplied by the calling program.  Colorwrite is called many times to write a raster line to the stream.  Colorclose closes the stream and queues the file for printing as needed. 

Coloropen

Dest specifies the destination for the data.  If dest is an empty string (""), then the image is spooled to the local system.  If the last character is a colon ( : ), then the data is sent via XNS to the specified system (the name to the left of the colon) to be spooled and printed there. Thus “sauron:” will spool to the system named sauron. 

If the last character of the dest parameter is an exclamation mark ( ! ), then the data is sent to the specified system using UUCP.  (UUCP should be running on XNS or IP/TCP to that system rather than serial communication which is too slow).  If the name preceding the colon or exclamation mark is absent, then the default name specified in /usr­/spool­/colord­/DEFAULT­xns or /usr­/spool­/colord­/DEFAULT­uucp, respectively, will be used. 

Any other sequence of characters in the dest string will cause the image to be stored in a file of the specified name.  In this case, the user will probably want to invoke colord(1) to print the file. 

Format specifies the format of the user-supplied header. Three different formats are available. The first, CO_DEFAULT, specifies that the image will be 1024 x 768 pixels with standard Tektronix 4692 parameters (landscape mode, no black and white inversion, etc.)  The user need only specify the resolution, for hardware dithering, as either 1, 2, or 4 bits per color in each pixel. 

In addition to the resolution, the second format, CO_XY, allows the user to also specify the x and y coordinate sizes.  The third format, CO_TEK4692, allows the user to specify the actual Tektronix 4692 header (except for the checksum and EOL bytes which are supplied by the system) for complete control and functionality. 

Header is a pointer to the header containing configuration information such as the desired number of pixels for the x and y axis. 

Copies allows the user to print up to 100 copies of the same image.  One should not attempt to print an image when the paper tray is empty. 

The output stream (file or pipe output) that coloropen produces consists of a 1024 byte header followed by zero or more data records.  The header format depends on the format parameter supplied to coloropen. The data record format depends on the format specified to colorwrite.

The header formats are in decimal as follows
 

CO_DEFAULT
Byte Contents Comments
0 0 CO_DEFAULT >> 8
1 85 CO_DEFAULT & 0xff



2 varies copies >> 8
3 varies copies & 0xff



4 0 resolution >> 8
5 {1,2,4} resolution & 0xff

 

CO_XY
Byte Contents Comments
0 0 CO_XY >> 8
1 86 CO_XY & 0xff



2 varies copies >> 8
3 varies copies & 0xff



4 0 resolution >> 8
5 {1,2,4} resolution & 0xff



6 1 to 1536 x size, in pixels
7 1 to 1122 y size, in pixels

 

CO_TEK4692
Byte Contents Comments
0 0 CO_TEK4692 >> 8
1 87 CO_TEK4692 & 0xff



2 varies copies >> 8
3 varies copies & 0xff



4 varies mode (see below)
5 varies repaint (see below)



6 varies x size, high byte (see below)
7 varies x size, low byte (see below)



8 varies y size, high byte (see below)
9 varies y size, low byte (see below)

In CO_TEK4692 format, the user must supply the data in the actual Tektronix 4692’s format. This is documented in the Tektronix 4692 Color Graphics Copier Device Driver Development Guide and summarized here. 

The mode byte is broken up into several bit fields. Bit 0 is the low order bit.  Set bit 0 to true to specify black and white inversion.  Black and white inversion means that white will be printed when the intensity of all colors for a given pixel is zero (normally black) and vice versa.  This inversion allows for the fact that the background color on many CRTs is black and the background color for the printer is white (blank paper). 

Set bit 1 (the "quality bit") to true to fix the image resolution at 158 pixels per inch. If bit one is false, then the pixels will be spread as needed.   The  pixels can spread up to 128 pixels per inch.   When the pixels are allowed to spread, the image takes up as much of the page as possible. 

Bits 2 and 3 specify the image orientation. 
 

Image orientation
Bit 3 Bit 2 Format
0 0 Landscape (normal mode)
0 1 Portrait (bottom of page)
1 0 Portrait (center of page)
1 1 Portrait (top of page)

Bits 4 and 5 specify the image resolution in bits per color per pixel. 
 

Image resolution
Bit 5 Bit 4 Resolution
0 0 1 bit/primary (2 pixels/byte)
0 1 2 bit/primary (1 byte/pixel)
1 0 4 bit/primary (2 bytes/pixel)
1 1 not allowed

 

Bit 6 is the communications mode. The driver ignores it.  Bit 7 must be true. 

Byte 5 is the repaint byte. The low-order three bits specify how many images should be painted on the same page.  These bits should normally be set to 0x01 for paper.  The count can be increased for transparencies since they generally require more ink. If this is done then the image data should be replicated.  It may also be used to superimpose several different images on the same page.  The repaint count should be ored with 0x80.

Byte 6 is the high-order 7 bits of the size of the x dimension, in pixels, ored with 0x80. Byte 7 is the low-order 7 bits of the x dimension size ored with 0x80.

Bytes 8 and 9 are, respectively, the high-order and low-order 7 bits of the y size, ored with 0x80.

The system will supply the checksum and EOL bytes.  The format of the raster data is documented in tek(7). 

Colorwrite

Colorwrite writes out each raster line in an internal format that preserves the byte count of each write.  The first parameter, fdesc, specifies the open I/O stream destination for writing the raster line. The second parameter, format, specifies the format to be used. Currently only CW_RAW is supported.  Count specifies the number of bytes in this raster line.  Buf is a pointer to a character buffer containing the raster data. 

Colorclose

Colorclose closes the I/O stream, fdesc, and spools the image (unless output to an ordinary file was specified in coloropen). Colorclose returns non-zero on success and zero on failure.

SEE ALSO

capture(1G), colord(1), capture(3G), tek(7), Tektronix 4692 Color Graphics Copier Device Driver Development Guide (Tektronix Part No. 070-4818-00)
 
 

Version 2.3  —  July 04, 1985

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026