


IMTGA(3IM)             SDSC IMAGE LIBRARY              IMTGA(3IM)



NAME
     imtga - TrueVision TGA file translation

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

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

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

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

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


DESCRIPTION
     tga image files are generated by Truevision  Targa  software
     products  as well as an assortment of IBM PC platform graph-
     ics utilities.

FILE RECOGNITION
     Truevision  tga  files  are  recognized  by  the   following
     filename suffixe:  .tga.

NOTES
     SDSC image library support of the Truevision tga format does
     not  require use of any Truevision libraries or hardware and
     contains no proprietary code. Truevision tga format handling
     is available on any machine for which the SDSC image library
     is available.

  Reading Truevision TGA files
     The SDSC image library  reads  uncompressed  and  runlength-
     encoded (RLE) 8-bit grayscale, 16-bit grayscale, 8-bit color
     mapped, 16-bit color mapped, 2 byte RGB, 3 byte RGB,  and  4
     byte RGB images.  The RGB and grayscale images may also con-
     tain CLT's.  The pictures with the screen origin bit set are
     handled properly.  CLT's may be 16, 24 or 32 bit.



SDSC              Last change: August 24, 1992                  1






IMTGA(3IM)             SDSC IMAGE LIBRARY              IMTGA(3IM)



     Only non-interleaved images are supported.  Targa  types  32
     and 33 are not supported, but types 0,1,2,3,9,10 and 11 are.

  Writing Truevision TGA files
     Image library IMVFBRGB, IMVFBINDEX8, and  IMVFBINDEX16  VFBs
     are  written  to  uncompressed  or  runlength-encoded  8-bit
     grayscale, 16-bit  grayscale,  8-bit  color  mapped,  16-bit
     color mapped, 2 byte RGB, 3 byte RGB, and 4 byte RGB images.
     Color indexed images may contain a CLT.  The  screen  origin
     bit  is always set to the upper left.  CLT's are stored with
     24-bit entries (8-bits per channel).

     Images are stored non-interleaved.  Targa types 0, 32 and 33
     are not supported, but 1,2,3,9,10 and 11 are.

     Other image library VFB types are converted to  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),  Truevision
     tga file reading returns the following error codes:

          IMEFORMAT    Cannot support this format
          IMENOIMAGE   No image contained in file
          IMENOCLT     No color color map contained if needed
          IMEMALLOC    Cannot allocate enough memory
          IMESYNTAX    Unsupported number of bytes per pixel in image
          IMESYNTAX    Type of interleaving not supported

DOCUMENTATION
     _T_r_u_e_v_i_s_i_o_n  _T_G_A  _F_i_l_e  _F_o_r_m_a_t  _S_p_e_c_i_f_i_c_a_t_i_o_n,  _V_e_r_s_i_o_n  _2._0,
     Truevision  Technical  Manual  Version  2.2,  January  1991,
     Truevision Inc.

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



