


IMPCX(3IM)             SDSC IMAGE LIBRARY              IMPCX(3IM)



NAME
     impcx - ZSoft IBM PC Paintbrush file translation

SYNOPSIS
     #include <stdio.h>
     #include "sdsc.h"
     #include "im.h"

     int ImFileRead( fd, "pcx", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFRead( fp, "pcx", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileWrite( fd, "pcx", flagsTable, dataTable )
          int         fd;
          TagTable   *flagsTable;
          TagTable   *dataTable;

     int ImFileFWrite( fp, "pcx", flagsTable, dataTable )
          FILE         *fp;
          TagTable   *flagsTable;
          TagTable   *dataTable;


DESCRIPTION
     The pcx image file format was invented by ZSoft for  use  in
     its  IBM  PC  PC  Paintbrush  tool  series.  It has become a
     defacto standard in the IBM PC world and is  regularly  used
     for the storage of monochrome and color pixel information by
     paint-type tools.

     See the documentation for each  of  the  IBM  PC  tools  for
     details on how to use them.

FILE RECOGNITION
     ZSoft pcx files are recognized by these  filename  suffixes:
     .pcx and .pcc.

NOTES
     SDSC image library support of the ZSoft pcx format does  not
     require  use of IBM PC graphics or compute hardware and con-
     tains no proprietary code.  ZSoft  pcx  format  handling  is
     available on any machine for which the SDSC image library is
     available.

  Reading ZSoft PCX files
     The SDSC image library can read ZSoft pcx files and map them



SDSC              Last change: August 24, 1992                  1






IMPCX(3IM)             SDSC IMAGE LIBRARY              IMPCX(3IM)



     to VFBs are as follows:

          Depth/color         Mapped to VFB
          1-bit monochrome    IMVFBMONO without CLT
          2-bit color index   IMVFBINDEX8 with or without CLT
          3-bit color index   IMVFBINDEX8 with or without CLT
          4-bit color index   IMVFBINDEX8 with or without CLT
          8-bit color index   IMVFBINDEX8 with or without CLT

     2-, 3-, 4- and 8-bit depths may or may not contain a pallete
     (color lookup table).

  Writing ZSoft PCX files
     Images to be written out are mapped from image library  VFBs
     are as follows:

          Mapped from VFB   Depth/color
          IMVFBMONO         1-bit monochrome
          IMVFBINDEX8       8-bit color index

     If the incoming VFB has a CLT, the image written to the  pcx
     file contains a pallete.

     pcx files are always compressed with a variant of RLE encod-
     ing.   However,  ZSoft's  pcx RLE encoding scheme was poorly
     designed.  In the worst case,  a  compressed  pcx  file  may
     require  _d_o_u_b_l_e  the  disk  space that an uncompressed image
     would occupy.  Unfortunately, ZSoft's pcx file  format  does
     not  allow  for  uncompressed  images or compression schemes
     other than their faulty RLE scheme.

     Other image library VFB types are converted to  one  of  the
     above   types   prior   to  being  written  out.    See  the
     ImFileWrite(3IM) man page for details.

ERRORS
     In addition to those listed for ImFileRead(3IM),  ZSoft  pcx
     file reading returns the following error codes:

          IMEMALLOC   Cannot allocate enough memory
          IMESYNTAX   Unknown parameter in file header
          IMESYS      System call error in read operation

     In addition to those listed for ImFileWrite(3IM), ZSoft  pcx
     file writing returns the following error codes:

          IMEMALLOC   Cannot allocate enough memory
          IMESYS      System call error in write operation

DOCUMENTATION
     _T_e_c_h_n_i_c_a_l _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, ZSoft Corporation, 1988.




2                 Last change: August 24, 1992               SDSC






IMPCX(3IM)             SDSC IMAGE LIBRARY              IMPCX(3IM)



     _B_i_t-_M_a_p_p_e_d  _G_r_a_p_h_i_c_s,  Steve  Rimmer,  Windcrest/McGraw-Hill
     publishing, 1990.

SEE ALSO
     ImIntro(3IM),   ImErrNo(3IM),   imconv(1IM),    imfile(1IM),
     imformats(1IM)

AUTHOR
     Dave Nadeau
     San Diego Supercomputer Center

CONTACT
     SDSC consultants, (619)534-5100, consult@y1.sdsc.edu










































SDSC              Last change: August 24, 1992                  3



