


IMRLE(3IM)             SDSC IMAGE LIBRARY              IMRLE(3IM)



NAME
     imrle - Utah RLE file translation

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

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

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

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

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


DESCRIPTION
     rle image files are generated by the tools of Utah's  Raster
     Toolkit.   See the Utah documentation set for details on how
     to use these tools.

FILE RECOGNITION
     Utah rle files are only recognized by the following filename
     suffix: .rle

NOTES
     SDSC image library support of the Utah rle format  does  not
     require  use  of  any Utah tools and contains no proprietary
     code.  Utah rle format handling is available on any  machine
     for which the SDSC image library is available.

     The Utah rle format is very flexible and allows the  defini-
     tion  of  a  wide  range  of image depths.  Depth parameters
     include two ways to define color channels:

     1.  Each pixel has a number of  "channels"  of  information,
     such  as one channel for color index images, and three chan-
     nels for red-green-blue (RGB) images.  The rle  format  puts
     no  restriction  on  the number of pixel "color channels" an



SDSC              Last change: August 24, 1992                  1






IMRLE(3IM)             SDSC IMAGE LIBRARY              IMRLE(3IM)



     image may have.

     2.  If a color lookup table (CLT) is present, each entry has
     a  number  of "channels" of information, such as three chan-
     nels for a red-green-blue (RGB) color table (the only  well-
     defined  case).   The rle format puts no restrictions on the
     number of CLT "color map channels" an image may have.   Such
     a  flexible file format design allows for the standard image
     types:

          Color index   1 channel/pixel        Stores color index
                        3 channels/map entry   Stores RGB value

          RGB           3 channels/pixel       Stores RGB value
                        no color map

     Unfortunately, such a flexible file format can also  specify
     a  very wide range of implausible image types.  So, clearly,
     restrictions have to be made.  The image  library's  support
     of  Utah  rle  image  files restricts images to either 8-bit
     color index images (1 color channel, 3 color map color chan-
     nels)  or  24-bit RGB images (3 color channels, 0 or 3 color
     map color channels).

  Reading Utah RLE files
     The SDSC image library can read Utah rle files and map  them
     to VFBs as follows:

     Depth/color                                      Mapped to VFB
     8-bit color index, with or without CLT           IMVFBINDEX8
     8-bit color index + alpha, with or without CLT   (IMVFBINDEX8 | IMVFBALPHA)
     24-bit RGB, with or without CLT                  IMVFBRGB
     24-bit RGB + alpha, with or without CLT          (IMVFBRGB | IMVFBALPHA)

     If the image has a color map, the VFB includes a CLT.

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

          Mapped from VFB    Depth/color
          IMVFBINDEX8        8-bit color index, with or without CLT
          IMVFBRGB           24-bit RGB, with or without CLT

     If the incoming VFB has a CLT, the image written to the Utah
     rle file contains a CLT.

     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.





2                 Last change: August 24, 1992               SDSC






IMRLE(3IM)             SDSC IMAGE LIBRARY              IMRLE(3IM)



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

          IMEMALLOC   Cannot allocate enough memory
          IMESYNTAX   Syntax error in incoming file
          IMESYS      System call error in read operation

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

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

DOCUMENTATION
     _D_e_s_i_g_n _o_f _t_h_e _U_t_a_h _R_L_E _F_o_r_m_a_t, Spencer W. Thomas, University
     of Utah, Department of Computer Science

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



