FCAST(7) — Kubota Pacfic Computer Inc.
NAME
fcast − Dupont 4CAST Digital Color Printer Driver
DESCRIPTION
The fcast printer driver provides an interface to a user program through open(2), write(2), ioctl(2) and close(2). The printer accepts color plane interleaved image data in the order of Yellow, Magenta, Cyan and Black (YMCK). The driver requires the user program to send a complete color plane for each print (write) command. To print a full color image, the user must issue four separate write calls.
A print format defines various attributes of the printing image, such as, upper left x, y coordinates, image size in width and length, image depth (bit per pixel) and paper size. The Look Up Tables (four sections, one for each color) are used for pixel intensity transformation while the image is being printed.
FUNCTIONS
open Open the printer device for writing. #include <machine/4cast.h>
int open (/dev/fcast, O_WRONLY) Only one user can open the device at one time. The device must be opened as WRITE ONLY. The driver loads the print format and the Look Up Tables defined by system initialization or by previous ioctl calls. The color code is set to Yellow. The alternate print format, Look Up Tables or color code can be defined through ioctl calls after the device is opened (see description under ioctl). On failure, errno is set to:
[EBUSY] The device is busy.
[EIO] Physical printer error. Use FCAST_STATUS in ioctl to get more error information.
write Send one image plane to the printer. int write (fd, buf, nbytes)
int fd;
char ∗buf;
unsigned long nbytes; The image data stored in buf should be one of the four color planes (YMCK). The parameter nbytes is equal to number of pixels per line times total number of lines to print. nbytes must be less than the width times the length defined in the last Print Format. The driver advances the color code to the next color in sequence after write completes. On failure, errno is set to:
[EINVAL] nbytes exceeds the defined format.
[EIO] Physical printer error. Use FCAST_STATUS in ioctl to get more error information.
ioctl Miscellaneous printer control commands. int ioctl (fd, command, arg)
int fd, command; Commands are described as follow:
FCAST_SETLUT
Set the color Look Up Tables. The Look Up Tables are set up as a one to one mapping upon system initialization. The structure of the Look Up Tables are defined in <machine/4cast.h>:
typedef struct {
unsigned long colorcode:3;
unsigned long bitsppixel:5;
unsigned long transferlen:24;
unsigned char data[1 << FCAST_BPPIXEL];
} LUTRequest;
colorcode = FCAST_YELLOW;
bitsppixel = FCAST_BPPIXEL;
transferlen = FCAST_MAX_LUTSIZE;
data = look up table for yellow;
colorcode = FCAST_MAGENTA;
bitsppixel = FCAST_BPPIXEL;
transferlen = FCAST_MAX_LUTSIZE;
data = look up table for magenta;
colorcode = FCAST_CYAN;
bitsppixel = FCAST_BPPIXEL;
transferlen = FCAST_MAX_LUTSIZE;
data = look up table for cyan;
colorcode = FCAST_BLACK;
bitsppixel = FCAST_BPPIXEL;
transferlen = FCAST_MAX_LUTSIZE;
data = look up table for black;
It is optional to load either single section or multiple sections with one ioctl call. On failure errno is set to:
[EINVAL] Invalid Look Up Table parameters.
[EFAULT] Invalid user address.
FCAST_GETLUT
Get the color Look Up Tables. On failure errno is set to:
[EFAULT] Invalid user address.
FCAST_SETFORMAT
Set the print format. The Print Format is set up upon system initialization with the default values shown as follow:
typedef struct {
unsigned short :8;
unsigned short papersize :8;
unsigned short :16;
unsigned short uleft_X;
unsigned short uleft_Y;
unsigned short width;
unsigned short length;
unsigned short :8;
unsigned short csf:1;
unsigned short :7;
unsigned short :3;
unsigned short bitppixel:5;
unsigned short :8;
unsigned short :16;
} PrintFormat;
cs = 0;
uleft_X = 0;
uleft_Y = 0;
papersize = FCAST_FREE;
width = FCAST_WIDTH;
length = FCAST_MAXLEN;
bitppixel = FCAST_BPPIXEL;
On failure errno is set to:
[EINVAL] Invalid print format parameter.
[EFAULT] Invalid user address.
FCAST_GETFORMAT
Get the print format. On failure errno is set to:
[EFAULT] Invalid user address.
FCAST_SETCOLOR
Set the next color to print. The ink ribbon will be wasted if this function is used to set the color other than the standard color sequence YMCK. On failure errno is set to:
[EINVAL] Invalid color code.
[EFAULT] Invalid user address.
FCAST_GETCOLOR
Get the next color to print. On failure errno is set to:
[EFAULT] Invalid user address.
FCAST_REZERO
Rezero printer unit and eject paper. This command is also issued when the device is closed. On failure errno is set to:
[EIO] Printer command REZERO failed.
FCAST_STATUS
Get status from last command. The structure of the status data is defined in <machine/4cast.h>:
typedef struct {
int sense_key;
int fcast_key;
} fcast_status;
On failure errno is set to:
[EFAULT] Invalid user address.
close Close the printer device. int close (fd)
int fd; The driver performs a Rezero unit command to eject the paper and reset the printer on close.
FILES
/dev/fcast
BUGS
4CAST printer does not disconnect from the SCSI bus, and may hold the bus up to 45 seconds. Due to the I/O space limit, the maximum number of bytes to print must be less than 16 megabytes.
September 02, 1992