


IMVIFF(3IM)            SDSC IMAGE LIBRARY             IMVIFF(3IM)



NAME
     imviff - Khoros VIFF file translation

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

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

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

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

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


DESCRIPTION
     Viff image files are generated by the Khoros Image  Process-
     ing package from the University of New Mexico.

FILE RECOGNITION
     Khoros viff files are recognized by the  following  filename
     suffixes:  .xv and .viff.

NOTES
     SDSC image library support of the Khoros  viff  format  does
     not  require  use  of  any  Khoros libraries and contains no
     proprietary code. Khoros viff format handling  is  available
     on  any  machine  for which the SDSC image library is avail-
     able.

  Reading Khoros VIFF files
     The SDSC image library reads single-image  files  containing
     uncompressed images with 1 or 3 data bands of implicit 1- or
     2-byte  data.   Single-band  1-bit  images  are  read   into
     IMVFBMONO  VFBs,  single-band  8-bit  images  are  read into
     IMVFBINDEX8 VFBs, single-band 16-bit images  are  read  into
     IMVFBINDEX16  VFBs, and 3-band 8-bit image data is read into
     IMVFBRGB VFBs.  Color  tables,  if  any,  are  read  in  and



SDSC              Last change: August 24, 1992                  1






IMVIFF(3IM)            SDSC IMAGE LIBRARY             IMVIFF(3IM)



     associated with the VFB.

  Writing Khoros Viff files
     Image library IMVFBRGB VFBs are written as 3-band 8-bit  per
     channel  uncompressed  images with or without a color lookup
     table.  IMVFBINDEX8 and IMVFBINDEX16 images are  written  as
     single-band  8-bit  or  16-bit  uncompressed  images with or
     without color lookup tables.  Finally, IMVFBMONO images  are
     written  as  single-band  1-bit  uncompressed images without
     color lookup tables.

     Other image library VFB types are  converted  to  IMVFBMONO,
     IMVFBINDEX8,  IMVFBINDEX16, or IMVFBRGB VFB's prior to being
     written out.  See the ImFileWrite(3IM) man page for details.

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

          IMEMALLOC       Cannot allocate enough memory
          IMESYNTAX       Not a Viff image
          IMESYNTAX       Unacceptable byte ordering
          IMESYNTAX       Can only deal with implicit images
          IMESYNTAX       Unacceptable data storage type for image
          IMESYNTAX       Unacceptable data storage type for map data
          IMESYNTAX       Unacceptable encoding scheme for image
          IMESYNTAX       Unacceptable color space scheme
          IMESYNTAX       Only 1 image allowed
          IMESYNTAX       Only 1 or 3 data bands allowed

DOCUMENTATION
     _K_h_o_r_o_s _P_r_o_g_r_a_m_m_e_r_s _M_a_n_u_a_l, _V_o_l_u_m_e _I_I, _C_h_a_p_t_e_r _1,  University
     of New Mexico, 1991.

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

AUTHOR
     Chris Groening
     San Diego Supercomputer Center

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











2                 Last change: August 24, 1992               SDSC



