


IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



NAME
     imintro - general information on the SDSC image library

SYNOPSIS
     #include "im.h"

     cc _f_l_a_g_s _f_i_l_e_s -lsdsc -lim


DESCRIPTION
     The SDSC Image Library _l_i_b_i_m._a is a collection  of  portable
     C-language image manipulation tools. These tools allow image
     files in a variety of formats to be read in and written  out
     and images to be manipulated while in memory.  Manipulations
     include rotating, scaling, filtering, converting to/from RGB
     and gray-scale, cutting out pieces of images, changing color
     lookup tables, rolling color lookup tables, and so on.

     The SDSC Image Library is made up of three sets of routines:

          ImVfb    Manipulates Virtual Frame Buffers (images) while in memory
          ImClt    Manipulates Color Lookup Tables while in memory
          ImFile   Reads and writes image files and streams

     Each of these is discussed in sections that follow.

VIRTUAL FRAME BUFFERS
     Many visualization tools operate on frame buffers either  to
     convert  them from one metafile representation to another or
     to manipulate images, such as  by  clipping,  filtering,  or
     transformation.   Each  tool  program requires some internal
     data structure.  It is desirable for all  such  programs  to
     use  the  same  internal structure to allow sharing of tech-
     niques and code  between  applications.   This  shared  data
     structure is called a virtual frame buffer.

  Virtual Frame Buffer Design Goals
     o+  The data structure must be able to  store  all  necessary
        pieces  of  frame  buffer information. This includes red,
        green, blue, color index,  z-value,  alpha-value,  scalar
        data, as well as others.

     o+  The data structure must be extensible to be able to  hold
        more information when new situations arise.

     o+  Programs must support multiple virtual frame buffers.

     o+  The data structure should  be  as  compact  as  possible,
        avoiding paging through a virtual frame buffer as much as
        possible.

     o+  The data structure should only be visible  inside  of  an



SDSC              Last change: August 25, 1992                  1






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



        application.  Because  we may want to change the internal
        format in the future, its structure should be hidden from
        the application with macros and procedure calls. It makes
        more sense for an application to query a red value from a
        pixel location in a virtual frame buffer with

          r = ImVfbQRed(v,p);

       instead of

         r = *( (unsigned char *) (p + v->v_roff ) );

      In the former case, a change to the definition of ImVfbQRed
      would  require  only  a recompilation of the tools that use
      the redefinition.

     o+  For efficiency, pointer  arithmetic  should  be  used  to
        address  pixels.   Thus,  constructs  like  the following
        should be possible when setting pixel color values:

          ImVfb *v;
          ImVfbPtr p, p1, p2;
          int x1, y1, x2, y2;
           ...
          p1 = ImVfbQPtr( v, x1, y1 );
          p2 = ImVfbQPtr( v, x2, y2 );
          for( p = p1; p <= p2; ImVfbSInc(v,p) )
          {
                ImVfbSRed( v, p, 64 );
                ImVfbSGreen( v, p, 128 );
                ImVfbSBlue( v, p, 255 );
          }


  Allocating a Virtual Frame Buffer
     A virtual frame buffer is allocated with a call to

       ImVfb *v;
        ...
       v = ImVfbAlloc( width, height, fields );

    where _f_i_e_l_d_s defines what information each pixel  will  hold.
    This value is specified by or'ing together one or more of the
    following:

            Constant                      Meaning
8          ________________________________________________________
          IMVFBRGB       Stores red, green, blue values (0-255)
          IMVFBALPHA     Stores an alpha value (0-255)
          IMVFBWPROT     Stores a write protection (0 or non-zero)
          IMVFBINDEX8    Stores a color index (0-255)
          IMVFBINDEX16   Stores a color index (0-65534)
          IMVFBMONO      Stores a monochrome (on/off) value



2                 Last change: August 25, 1992               SDSC


9


IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



          IMVFBZ         Stores a z-value (full integer)
          IMVFBGRAY      Stores a gray scale value (0-255)
          IMVFBGREY      Stores a gray scale value (0-255)
          IMVFBIDATA     Stores an integer data value
          IMVFBFDATA     Stores a floating-point data value

     ImVfbAlloc allocates enough memory  to  hold  such  a  frame
     buffer and sets up some internal information.

     Information about a particular virtual frame buffer  can  be
     Set with

               Call                           Meaning
8          _______________________________________________________________
          ImVfbSClt(v,c)   Attach (set) a pointer to a color lookup table


     Information about a particular virtual frame buffer  can  be
     Queried with

               Call                           Meaning
8          _____________________________________________________________
          ImVfbQWidth(v)    Returns the number of columns
          ImVfbQHeight(v)   Returns the number of rows
          ImVfbQFields(v)   Returns the fields mask
          ImVfbQNBytes(v)   Returns the number of bytes per pixel
          ImVfbQClt(v)      Returns a pointer to the color lookup table

  Freeing a Virtual Frame Buffer
     A virtual frame buffer's memory can be  freed  (deallocated)
     with a call to

       ImVfb *v;
        ...
       ImVfbFree( v );


  Per-Pixel Storage
     The per-pixel storage is  a  packed  array  of  values.  The
     storage  convention  assumes  that the top row is row #0 and
     the left column is column #0.  Pixels  are  stored  like  C-
     language  2D  arrays: left-to-right across the row.  Various
     values can be Set into a particular pixel (pointed to  by  a
     pixel pointer) within a particular virtual frame buffer by

                   Call                         Meaning
8          __________________________________________________________
          ImVfbSRed(v,p,r)         Red (byte)
          ImVfbSGreen(v,p,g)       Green (byte)
          ImVfbSBlue(v,p,b)        Blue (byte)
          ImVfbSAlpha(v,p,a)       Alpha-value (byte)
          ImVfbSIndex8(v,p,i8)     Color index (byte)
          ImVfbSIndex16(v,p,i32)   Color index (integer)
          ImVfbSMono(v,p,m)        Monochromatic value (zero or one)



SDSC              Last change: August 25, 1992                  3


9


IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



          ImVfbSIndex(v,p,i)       ImVfbSIndex8 or ImVfbSIndex16
          ImVfbSZ(v,p,z)           Z-value (integer)
          ImVfbSGray(v,p,g)        Gray scale (byte)
          ImVfbSGrey(v,p,g)        Gray scale (byte)
          ImVfbSFData(v,p,f)       Floating-point data value
          ImVfbSIData(v,p,i)       Integer data value

     Various pixel values can be Queried within a particular vir-
     tual frame buffer by

                 Call                       Meaning
8          ______________________________________________________
          ImVfbQRed(v,p)       Red (byte)
          ImVfbQGreen(v,p)     Green (byte)
          ImVfbQBlue(v,p)      Blue (byte)
          ImVfbQAlpha(v,p)     Alpha-value (byte)
          ImVfbQIndex8(v,p)    Color index (byte)
          ImVfbQIndex16(v,p)   Color index (integer)
          ImVfbQMono(v,p,m)    Monochromatic value (zero or one)
          ImVfbQIndex(v,p)     ImVfbQIndex8 or ImVfbQIndex16
          ImVfbQZ(v,p)         Z-value (integer)
          ImVfbQGray(v,p)      Gray scale (byte)
          ImVfbQGrey(v,p)      Gray scale (byte)
          ImVfbQFData(v,p)     Floating-point data value
          ImVfbQIData(v,p)     Integer data value

     Pixel pointers can be Queried and Set by

                Call                            Meaning
8          ________________________________________________________________
          ImVfbQPtr(v,x,y)   Returns a pointer to a particular pixel
          ImVfbQFirst(v)     Returns a pointer to the first (UL) pixel
          ImVfbQLast(v)      Returns a pointer to the last (LR) pixel
          ImVfbQLeft(v,p)    Returns a pointer to a pixel one column left
          ImVfbQRight(v,p)   Returns a pointer to a pixel one column right
          ImVfbQUp(v,p)      Returns a pointer to a pixel one row up
          ImVfbQDown(v,p)    Returns a pointer to a pixel one row down
          ImVfbQNext(v,p)    Same as ImVfbQRight(v,p)
          ImVfbQPrev(v,p)    Same as ImVfbQLeft(v,p)
          ImVfbSInc(v,p)     Same as p = ImVfbQRight(v,p)
          ImVfbSDec(v,p)     Same as p = ImVfbQLeft(v,p)

     The pixel just to the ImVfbQRight of the right-most pixel in
     a scanline is the left-most pixel in the next scanline down.
     The pixel just to the ImVfbQLeft of the left-most pixel in a
     scanline  is  the  last  pixel  in the previous scanline. No
     automatic wraparound occurs between the last pixel  and  the
     first pixel in the frame buffer.

COLOR LOOKUP TABLES
     A color lookup table (CLT) is an  ordered  list  of  colors.
     Each  color is represented by three 8-bit values.  The first
     value gives the Red component, the second the Green, and the



4                 Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     third the Blue component of the color.  The triplet is often
     referred to as an "RGB" value.

     Images generally come in two types:  pseudo-color and  true-
     color.   True-color  images  store  the RGB triplet for each
     pixel in the image itself.   Pseudo-color  images  store  an
     index  into  a color table.  The RGB triplet for the pixel's
     color is found at that indexed location  in  the  associated
     color table.

  Allocating a Color Lookup Table
     A color lookup table is allocated with a call to

       ImClt *c;
        ...
       c = ImCltAlloc( numColors );

    where _n_u_m_C_o_l_o_r_s indicate how many color  entries  are  to  be
    allocated. Each color entry contains 8 bits of red, 8 bits of
    green, and 8 bits of blue.

  Freeing a Color Lookup Table
     A color lookup table's memory  can  be  freed  (deallocated)
     with a call to

       ImClt *c;
        ...
       ImCltFree( c );


     Freeing a virtual frame buffer with ImVfbFree does not  free
     its color lookup table, if it has one.

  Per-Color Storage
     Information is Queried from a color lookup table by

                Call                           Meaning
8          _______________________________________________________________
          ImCltQNColors(c)   Queries the number of colors in this ImClt
          ImCltQRed(p)       Queries the Red component of a ImClt entry
          ImCltQGreen(p)     Queries the Green component of a ImClt entry
          ImCltQBlue(p)      Queries the Blue component of a ImClt entry

     where _c is the specific color lookup  table  and  _p  is  the
     pointer to a ImClt location.

     Information is Set into a color lookup table by

                Call                          Meaning
8          ____________________________________________________________
          ImCltSRed(p,r)     Sets the Red component of a ImClt entry
          ImCltSGreen(p,g)   Sets the Green component of a ImClt entry
          ImCltSBlue(p,b)    Sets the Blue component of a ImClt entry



SDSC              Last change: August 25, 1992                  5






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     A color lookup table can be attached to a particular virtual
     frame buffer by

       ImVfbSClt( v, c ) ;

    ImVfbQClt(v) can later be used to Query the  pointer  to  the
    ImClt.

     ImClt pointer values can be Queried and Set by

               Call                             Meaning
8          __________________________________________________________________
          ImCltQPtr(c,i)    Returns a pointer to a particular ImClt location
          ImCltQFirst(c)    Returns a pointer to the first ImClt location
          ImCltQLast(c)     Returns a pointer to the last ImClt location
          ImCltQNext(c,p)   Returns a pointer to the next ImClt location
          ImCltQPrev(c,p)   Returns a pointer to the previous ImClt location
          ImCltSInc(c,p)    Same as p = ImCltQNext(c,p)
          ImCltSDec(c,p)    Same as p = ImCltQPrev(c,p)

IMAGE FILE I/O
     Image files are files that contain zero or more images, zero
     or  more  color lookup tables, and zero or more other pieces
     of data such as the image`s title, date of creation, and  so
     on.   Such  image  files are often the output of proprietary
     graphics packages, such as Alias or Wavefront, or are graph-
     ics  vendor  standard storage formats, such as Sun's Raster-
     file or Pixar's PIC file.  Many public domain graphics pack-
     ages  also support their own image file formats, such as the
     Utah Raster Toolkit's RLE format, or the X  Window  System's
     XWD format.

     The ImFile routines of the SDSC image library recognize many
     of  these formats and may be used to read an image file into
     a tag table of virtual frame buffers, color  lookup  tables,
     and so on.

  Reading an Image File
     An image file may be read into a tag table with  a  call  to
     ImFileRead or ImFileFRead:

       ImFileRead( fd, format, flagsTable, dataTable );
       ImFileFRead( fp, format, flagsTable, dataTable );

    where _f_d is a  UNIX  file  descriptor,  _f_p  is  a  UNIX  FILE
    pointer,  _f_o_r_m_a_t  is  the name of the recognized formats (see
    ImFileRead(3IM) for a list), _f_l_a_g_s_T_a_b_l_e is a table  of  input
    control  flags,  and _d_a_t_a_T_a_b_l_e is the table to fill with tag-
    value pairs of data read in from the file.

     For both read calls, the input may be either  a  file  or  a
     pipe.
9


6                 Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



  Writing an Image File
     An image file may be written out from a  tag  table  with  a
     call to ImFileWrite or ImFileFWrite:

       ImFileWrite( fd, format, flagsTable, dataTable );
       ImFileFWrite( fp, format, flagsTable, dataTable );

    where _f_d is a  UNIX  file  descriptor,  _f_p  is  a  UNIX  FILE
    pointer,  _f_o_r_m_a_t  is  the name of the recognized formats (see
    ImFileWrite(3IM) for a list), _f_l_a_g_s_T_a_b_l_e is a table of output
    control  flags, and _d_a_t_a_T_a_b_l_e is the table of tag-value pairs
    of data to be written out to the file.

     For both write calls, the output may be either a file  or  a
     pipe.

NOTES
     Frame buffer information can be allocated either on  a  per-
     pixel or on a per-plane basis. The per-pixel basis is better
     to reduce paging. The  per-plane  allocation  is  better  to
     reduce  overall  storage.  For  a  per-pixel allocation, one
     might call

       v = ImVfbAlloc( 1280, 1024, IMVFBRGB | IMVFBZ );

    For a per-plane allocation, one might call

      vc = ImVfbAlloc( 1280, 1024, IMVFBRGB );
      vz = ImVfbAlloc( 1280, 1024, IMVFBZ );

   Color wizards  have  invented  a  number  of  useful  ways  of
   describing  color.   Two  of  the most popular methods used in
   computer graphics are termed RGB and HSI.  In  both  cases,  a
   three-dimensional  _c_o_l_o_r _s_p_a_c_e is defined.  Just as it takes 3
   coordinates, such as X, Y, and Z, to uniquely locate  a  point
   in  a  3D  world,  so  does  it take 3 coordinates to uniquely
   locate a color in a 3D color space.  For this reason, RGB  and
   HSI  each  require  three color coordinates, or _c_o_m_p_o_n_e_n_t_s, to
   uniquely identify a color in their 3D color spaces.

     The RGB Color Space
          In this color space, a color is described by  a  unique
          combination  of  three values, one each for red, green,
          and blue.  The color space is  named  after  the  first
          character  in  the  names  of  each of these color com-
          ponents.

          The RGB color space can  be  envisioned  as  a  cubical
          volume  with  each  edge measuring 256 units long.  The
          red, green, and blue color components locate a point in
          this volume and uniquely define a color.




SDSC              Last change: August 25, 1992                  7






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



          A high value for a color component indicates there is a
          lot  of  that component in the RGB color.  Similarly, a
          low value for a color component indicates there is very
          little  of  that component in the RGB color.  Pure red,
          for instance, has a high red component, but zero  green
          and  blue  components.  Pure blue has high blue values,
          but zero red and green.  And so on.  Black  has  zeroes
          for all three components, while white has 255's for all
          three.

          The RGB color space is  that  typically  used  for  the
          storage of high-quality images, such as those displayed
          on computer graphics  workstations.   Most  image  file
          formats support the storage of RGB images.

     The HSI Color Space
          In this color space, a color is described by  a  unique
          combination  of three values, one each for hue, satura-
          tion, and intensity.  The color space is, again,  named
          after the first character in the names of each of these
          color components.

          The HSI color space can be envisioned as two cones with
          their  bases joined: one cone points upwards, while the
          other points downwards.  Hue selects  the  basic  color
          for the pixel, such as "red" or "purple" or "orange" or
          "yellow".  Hue is measured as  an  angle,  in  degrees,
          around  the color cones.  An angle of 0 degrees is red.
          Larger angles  cycle  through  orange,  yellow,  green,
          blue, purple, and back to red at 360 degrees.

          Saturation controls how vivid the  color  is.   A  high
          value makes the color very pure, while lower values add
          progressively more gray to create pastel shades.  Meas-
          ured on the HSI color cones, saturation is the distance
          along a radius.

          Intensity controls the  brightness  of  the  color  and
          measures  a distance along the axis connecting the tips
          of the two cones.  An intensity of 0 creates black, and
          is  the  southernmost  tip of the lower color cone.  An
          intensity of 1.0 creates white, and is the northernmost
          tip  of  the upper color cone.  To get a pure color use
          an intensity of 0.5, placing the color in the middle of
          the  color space where the bases of the two color cones
          join.

          Colors in the HSI color space are often easier to mani-
          pulate  than  in the RGB color space.  To make an image
          brighter, increase the intensity value of  all  pixels,
          but  leave the hue and saturation components alone.  To
          make an image more pastel,  and  less  vivid,  decrease



8                 Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



          saturation  values.   To  change  all  yellow pixels to
          yellow-green, keeping their same saturation and  inten-
          sity,  adjust  their  hue components.  These operations
          would be more difficult in the RGB color space.

          Unlike the RGB color space, the HSI color space is  not
          typically  used  for  image storage.  imadjust converts
          pixel colors from RGB to HSI and back again  as  neces-
          sary.   For  this  reason,  adjusting images in the HSI
          color space is slower  than  adjusting  them  in  other
          color spaces.

     Different pixel components have  different  types  and  dif-
     ferent minimum and maximum values.

          Value        Type      Minimum   Maximum
8          ________________________________________
          red          Integer   0         255
          green        Integer   0         255
          blue         Integer   0         255
8          ________________________________________
          monochrome   Integer   0         1
          index 8      Integer   0         255
          index 16     Integer   0         65535
8          ________________________________________
          hue          Float     0.0       360.0
          saturation   Float     0.0       1.0
          intensity    Float     0.0       1.0
8          ________________________________________
          alpha        Integer   0         255
          wprot        Integer   0         255
          z-buffer     Integer   0         maxint
          idata        Integer   any       any
          fdata        Float     any       any

RETURNED VALUES
     Many of the image library procedures return values that  are
     pointers  to  a  new  ImVfb or ImClt.  For Vfb routines, the
     source Vfb, _s_o_u_r_c_e_V_f_b, is used as an input frame buffer.  If
     the  value of _d_e_s_t_V_f_b is equal to IMVFBNEW, then an entirely
     new Vfb will be created and returned.   Otherwise,  the  Vfb
     indicated by _d_e_s_t_V_f_b is modified and the value of _d_e_s_t_V_f_b is
     returned.  _s_o_u_r_c_e_V_f_b and _d_e_s_t_V_f_b can be the same Vfb without
     negative side effects.

     For ImClt routines, the source ImClt, _s_o_u_r_c_e_C_l_t, is used  as
     an  input lookup table.  If the value of _d_e_s_t_C_l_t is equal to
     IMCLTNEW, then an entirely new ImClt  will  be  created  and
     returned.   Otherwise,  the  ImClt  indicated  by _d_e_s_t_C_l_t is
     modified and the value of _d_e_s_t_C_l_t is  returned.   _s_o_u_r_c_e_C_l_t,
     and  _d_e_s_t_C_l_t  can  be  the  same ImClt without negative side
     effects.





SDSC              Last change: August 25, 1992                  9






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



RETURNS
     On an error, calls returning pointers  to  ImVfb  structures
     return  IMVFBNULL,  calls  returning ImClt structures return
     IMCLTNULL,  and  character  string  functions  return  NULL.
     Non-pointer functions return a -1 on errors.

     In all cases, on an error, the global ImErrNo is set  to  an
     error code indicating the cause of the error.  A description
     of the error can be printed with ImPError (3IM).

SUMMARY OF IM ROUTINES
                      ImVfb        *dstVfb;
                      ImVfb        *source1Vfb;
                      ImVfb        *source2Vfb;
                      int          fieldMask;
                      int          operation;
                      int     adjustField;
                      int     keyField;
                      int     operation;
                      float    degree;
                      float    degree;
                      float    degree;
                      ImVfb   *dstVfb;
                      ImVfb   *dstVfb;
                      ImVfb   *dstVfb;
                      ImVfb   *dstVfb;
                      ImVfb   *srcVfb;
                      ImVfb   *srcVfb;
                      ImVfb   *srcVfb;
                      ImVfb   *srcVfb;
                      float   adjustEnd;
                      float   adjustStart;
                      float   keyEnd;
                      float   keyStart;
     char      *ImFileQFFormat( fp, fileName )
     char      *ImFileQFormat( fd, fileName )
     char      *ImQError( )
     ImHistTable         *ImVfbHist( vfb, fieldMask, sort )
     float     *ImVfbStat( vfb, fieldMask, stats )
                      ImVfb *vfb;
     ImClt     *ImCltAlloc( numColors )
     ImClt     *ImCltDup( srcClt )
     void      ImCltFree( srcClt )
     int       ImCltQBlue( p )
     ImCltPtr  ImCltQFirst( srcClt )
     int       ImCltQGreen( p )
     ImCltPtr  ImCltQLast( srcClt )
     int       ImCltQNColors( srcClt )
     ImCltPtr  ImCltQNext( srcClt, p )
     ImCltPtr  ImCltQPrev( srcClt, p )
     ImCltPtr  ImCltQPtr( srcClt, i )
     int       ImCltQRed( p )



10                Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     ImClt     *ImCltRoll( srcClt, nEntries, dstClt )
     void      ImCltSBlue( p, b )
     void      ImCltSDec( srcClt, p )
     void      ImCltSGreen( p, g )
     void      ImCltSInc( srcClt, p )
     void      ImCltSRed( p, r )
     int       ImFileFRead( fp, "bmp", flagsTable, dataTable )
     int       ImFileFRead( fp, "cur", flagsTable, dataTable )
     int       ImFileFRead( fp, "gif", flagsTable, dataTable )
     int       ImFileFRead( fp, "hdf", flagsTable, dataTable )
     int       ImFileFRead( fp, "ico", flagsTable, dataTable )
     int       ImFileFRead( fp, "icon", flagsTable, dataTable )
     int       ImFileFRead( fp, "iff", flagsTable, dataTable )
     int       ImFileFRead( fp, "mpnt", flagsTable, dataTable )
     int       ImFileFRead( fp, "pbm", flagsTable, dataTable )
     int       ImFileFRead( fp, "pcx", flagsTable, dataTable )
     int       ImFileFRead( fp, "pgm", flagsTable, dataTable )
     int       ImFileFRead( fp, "pic", flagsTable, dataTable )
     int       ImFileFRead( fp, "pict", flagsTable, dataTable )
     int       ImFileFRead( fp, "pix", flagsTable, dataTable )
     int       ImFileFRead( fp, "pnm", flagsTable, dataTable )
     int       ImFileFRead( fp, "ppm", flagsTable, dataTable )
     int       ImFileFRead( fp, "ras", flagsTable, dataTable )
     int       ImFileFRead( fp, "rgb", flagsTable, dataTable )
     int       ImFileFRead( fp, "rla", flagsTable, dataTable )
     int       ImFileFRead( fp, "rle", flagsTable, dataTable )
     int       ImFileFRead( fp, "rpbm", flagsTable, dataTable )
     int       ImFileFRead( fp, "rpgm", flagsTable, dataTable )
     int       ImFileFRead( fp, "rpnm", flagsTable, dataTable )
     int       ImFileFRead( fp, "rppm", flagsTable, dataTable )
     int       ImFileFRead( fp, "synu", flagsTable, dataTable )
     int       ImFileFRead( fp, "tga", flagsTable, dataTable )
     int       ImFileFRead( fp, "tiff", flagsTable, dataTable )
     int       ImFileFRead( fp, "viff", flagsTable, dataTable )
     int       ImFileFRead( fp, "x", flagsTable, dataTable )
     int       ImFileFRead( fp, "xbm", flagsTable, dataTable )
     int       ImFileFRead( fp, "xwd", flagsTable, dataTable )
     int       ImFileFRead( fp, format, flagsTable, dataTable )
     int       ImFileFWrite( fp, "bmp", flagsTable, dataTable )
     int       ImFileFWrite( fp, "cur", flagsTable, dataTable )
     int       ImFileFWrite( fp, "eps", flagsTable, dataTable )
     int       ImFileFWrite( fp, "gif",  flagsTable, dataTable )
     int       ImFileFWrite( fp, "hdf", flagsTable, dataTable )
     int       ImFileFWrite( fp, "ico", flagsTable, dataTable )
     int       ImFileFWrite( fp, "icon", flagsTable, dataTable )
     int       ImFileFWrite( fp, "iff", flagsTable, dataTable )
     int       ImFileFWrite( fp, "mpnt", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pbm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pcx", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pgm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pic", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pict", flagsTable, dataTable )



SDSC              Last change: August 25, 1992                 11






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     int       ImFileFWrite( fp, "pix", flagsTable, dataTable )
     int       ImFileFWrite( fp, "pnm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "ppm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "ps", flagsTable, dataTable )
     int       ImFileFWrite( fp, "ras", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rgb", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rla", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rle", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rpbm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rpgm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rpnm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "rppm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "synu", flagsTable, dataTable )
     int       ImFileFWrite( fp, "tga", flagsTable, dataTable )
     int       ImFileFWrite( fp, "tiff", flagsTable, dataTable )
     int       ImFileFWrite( fp, "viff", flagsTable, dataTable )
     int       ImFileFWrite( fp, "x", flagsTable, dataTable )
     int       ImFileFWrite( fp, "xbm", flagsTable, dataTable )
     int       ImFileFWrite( fp, "xwd", flagsTable, dataTable )
     int       ImFileFWrite( fp, format, flagsTable, dataTable )
     int       ImFileFormatEquivs( baseNEquivs, baseEquivs, totalEquivs )
     int       ImFileFormatOptions( baseNOptions, baseOptions, totalOptions )
     int       ImFileQNFormat( )
     int       ImFileRead( fd, "bmp", flagsTable, dataTable )
     int       ImFileRead( fd, "cur", flagsTable, dataTable )
     int       ImFileRead( fd, "gif", flagsTable, dataTable )
     int       ImFileRead( fd, "hdf", flagsTable, dataTable )
     int       ImFileRead( fd, "ico", flagsTable, dataTable )
     int       ImFileRead( fd, "icon", flagsTable, dataTable )
     int       ImFileRead( fd, "iff", flagsTable, dataTable )
     int       ImFileRead( fd, "mpnt", flagsTable, dataTable )
     int       ImFileRead( fd, "pbm", flagsTable, dataTable )
     int       ImFileRead( fd, "pcx", flagsTable, dataTable )
     int       ImFileRead( fd, "pgm", flagsTable, dataTable )
     int       ImFileRead( fd, "pic", flagsTable, dataTable )
     int       ImFileRead( fd, "pict", flagsTable, dataTable )
     int       ImFileRead( fd, "pix", flagsTable, dataTable )
     int       ImFileRead( fd, "pnm", flagsTable, dataTable )
     int       ImFileRead( fd, "ppm", flagsTable, dataTable )
     int       ImFileRead( fd, "ras", flagsTable, dataTable )
     int       ImFileRead( fd, "rgb", flagsTable, dataTable )
     int       ImFileRead( fd, "rla", flagsTable, dataTable )
     int       ImFileRead( fd, "rle", flagsTable, dataTable )
     int       ImFileRead( fd, "rpbm", flagsTable, dataTable )
     int       ImFileRead( fd, "rpgm", flagsTable, dataTable )
     int       ImFileRead( fd, "rpnm", flagsTable, dataTable )
     int       ImFileRead( fd, "rppm", flagsTable, dataTable )
     int       ImFileRead( fd, "synu", flagsTable, dataTable )
     int       ImFileRead( fd, "tga", flagsTable, dataTable )
     int       ImFileRead( fd, "tiff", flagsTable, dataTable )
     int       ImFileRead( fd, "viff", flagsTable, dataTable )
     int       ImFileRead( fd, "x", flagsTable, dataTable )



12                Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     int       ImFileRead( fd, "xbm", flagsTable, dataTable )
     int       ImFileRead( fd, "xwd", flagsTable, dataTable )
     int       ImFileRead( fd, format, flagsTable, dataTable )
     int       ImFileWrite( fd, "bmp", flagsTable, dataTable )
     int       ImFileWrite( fd, "cur", flagsTable, dataTable )
     int       ImFileWrite( fd, "eps", flagsTable, dataTable )
     int       ImFileWrite( fd, "gif",  flagsTable, dataTable )
     int       ImFileWrite( fd, "hdf", flagsTable, dataTable )
     int       ImFileWrite( fd, "ico", flagsTable, dataTable )
     int       ImFileWrite( fd, "icon", flagsTable, dataTable )
     int       ImFileWrite( fd, "iff", flagsTable, dataTable )
     int       ImFileWrite( fd, "mpnt", flagsTable, dataTable )
     int       ImFileWrite( fd, "pbm", flagsTable, dataTable )
     int       ImFileWrite( fd, "pcx", flagsTable, dataTable )
     int       ImFileWrite( fd, "pgm", flagsTable, dataTable )
     int       ImFileWrite( fd, "pic", flagsTable, dataTable )
     int       ImFileWrite( fd, "pict", flagsTable, dataTable )
     int       ImFileWrite( fd, "pix", flagsTable, dataTable )
     int       ImFileWrite( fd, "pnm", flagsTable, dataTable )
     int       ImFileWrite( fd, "ppm", flagsTable, dataTable )
     int       ImFileWrite( fd, "ps", flagsTable, dataTable )
     int       ImFileWrite( fd, "ras", flagsTable, dataTable )
     int       ImFileWrite( fd, "rgb", flagsTable, dataTable )
     int       ImFileWrite( fd, "rla", flagsTable, dataTable )
     int       ImFileWrite( fd, "rle", flagsTable, dataTable )
     int       ImFileWrite( fd, "rpbm", flagsTable, dataTable )
     int       ImFileWrite( fd, "rpgm", flagsTable, dataTable )
     int       ImFileWrite( fd, "rpnm", flagsTable, dataTable )
     int       ImFileWrite( fd, "rppm", flagsTable, dataTable )
     int       ImFileWrite( fd, "synu", flagsTable, dataTable )
     int       ImFileWrite( fd, "tga", flagsTable, dataTable )
     int       ImFileWrite( fd, "tiff", flagsTable, dataTable )
     int       ImFileWrite( fd, "viff", flagsTable, dataTable )
     int       ImFileWrite( fd, "x", flagsTable, dataTable )
     int       ImFileWrite( fd, "xbm", flagsTable, dataTable )
     int       ImFileWrite( fd, "xwd", flagsTable, dataTable )
     int       ImFileWrite( fd, format, flagsTable, dataTable )
     void      ImHsiToRgb( hsi, rgb )
     void      ImPError( str )
     void      ImRgbToHsi( rgb, hsi )
     ImVfb     *ImVfbAdjust( srcVfb, keyField, keyStart, keyEnd, operation,
     ImVfb     *ImVfbAlloc( width, height, fields )
     ImVfb     *ImVfbComp( source1Vfb, source2Vfb, operation, fieldMask, dstVfb )
     ImVfb     *ImVfbCopy( srcVfb, srcXLeft, srcYTop, srcDX, srcDY, fieldMask, dstVfb, dstXLeft, dstYTop )
     ImVfb     *ImVfbDup( srcVfb )
     ImVfb     *ImVfbFill( srcVfb, srcXLeft, srcYTop, srcDx, srcDy,
     ImVfb     *ImVfbFlip( srcVfb, flipDirection, dstVfb )
     void      ImVfbFree( srcVfb )
     void      ImVfbHistTableFree( table )
     int       ImVfbQAlpha( srcVfb, p )
     int       ImVfbQBlue( srcVfb, p )
     ImClt     *ImVfbQClt( srcVfb )



SDSC              Last change: August 25, 1992                 13






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     ImVfbPtr  ImVfbQDown( srcVfb, p )
     float     ImVfbQFData( srcVfb, p )
     int       ImVfbQFields( srcVfb )
     ImVfbPtr  ImVfbQFirst( srcVfb )
     int       ImVfbQGray( srcVfb, p )
     int       ImVfbQGreen( srcVfb, p )
     int       ImVfbQGrey( srcVfb, p )
     int       ImVfbQHeight( srcVfb )
     int       ImVfbQIData( srcVfb, p )
     int       ImVfbQIndex( srcVfb, p )
     int       ImVfbQIndex16( srcVfb, p )
     int       ImVfbQIndex8( srcVfb, p )
     ImVfbPtr  ImVfbQLast( srcVfb )
     ImVfbPtr  ImVfbQLeft( srcVfb, p )
     int       ImVfbQMono( srcVfb, p )
     int       ImVfbQNBytes( srcVfb )
     ImVfbPtr  ImVfbQNext( srcVfb, p )
     ImVfbPtr  ImVfbQPrev( srcVfb, p )
     ImVfbPtr  ImVfbQPtr( srcVfb, x, y )
     int       ImVfbQRed( srcVfb, p )
     ImVfbPtr  ImVfbQRight( srcVfb, p )
     ImVfbPtr  ImVfbQUp( srcVfb, p )
     int       ImVfbQWidth( srcVfb )
     int       ImVfbQZ( srcVfb, p )
     ImVfb     *ImVfbResize( srcVfb, algorithm, dstVfb, width, height )
     ImVfb     *ImVfbRoll( srcVfb, xPixels, yPixels, dstVfb )
     ImVfb     *ImVfbRotate( srcVfb, degree, dstVfb )
     void      ImVfbSAlpha( srcVfb, p, a )
     void      ImVfbSBlue( srcVfb, p, b )
     void      ImVfbSClt( srcVfb, clt )
     void      ImVfbSDec( srcVfb, p )
     void      ImVfbSFData( srcVfb, p, f )
     void      ImVfbSGray( srcVfb, p, g )
     void      ImVfbSGreen( srcVfb, p, g )
     void      ImVfbSGrey( srcVfb, p, g )
     void      ImVfbSIData( srcVfb, p, i )
     void      ImVfbSInc( srcVfb, p )
     void      ImVfbSIndex( srcVfb, p, i )
     void      ImVfbSIndex16( srcVfb, p, i32 )
     void      ImVfbSIndex8( srcVfb, p, i8 )
     void      ImVfbSMono( srcVfb, p, m )
     void      ImVfbSRed( srcVfb, p, r )
     void      ImVfbSZ( srcVfb, p, z )
     ImVfb     *ImVfbToGray( srcVfb, dstVfb )
     ImVfb     *ImVfbToGrey( srcVfb, dstVfb )
     ImVfb     *ImVfbToIndex( srcVfb, numColors, dstVfb )
     ImVfb     *ImVfbToIndex16( srcVfb, dstVfb )
     ImVfb     *ImVfbToIndex8( srcVfb, dstVfb )
     ImVfb     *ImVfbToMono( srcVfb, threshold, dstVfb )
     ImVfb     *ImVfbToRgb( srcVfb, dstVfb )
     ImVfb     *ImVfbXShear( srcVfb, degree, dstVfb )
     ImVfb     *ImVfbYShear( srcVfb, degree, dstVfb )



14                Last change: August 25, 1992               SDSC






IMINTRO(3IM)           SDSC IMAGE LIBRARY            IMINTRO(3IM)



     cc        _f_l_a_g_s _f_i_l_e_s -lsdsc -lim
                      int fieldMask;
                      boolean sort;

AUTHORS
     Mike Bailey, T. Todd Elvins, and Dave Nadeau
     with Don  Doering,  Jesus  Ferrer,  Soraya  Gonzalez,  Chris
     Groening,  Toan-Vinh Le, Jim McLeod, Phil Mercurio, and John
     Moreland,
     San Diego Supercomputer Center

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










































SDSC              Last change: August 25, 1992                 15



