
rast2viff(1)                 Khoros                  rast2viff(1)

PROGRAM
     rast2viff - converts a SUN raster image to the VIFF image
     format

SYNTAX
     rast2viff

     -i             input Raster image file

     -o             resulting output image (viff file)

     [-p]           if yes, invert image (photonegative); if no
                    (default) do not invert image (photopositive)

     [-V]           Gives the version for rast2viff

     [-U]           Gives the usage for rast2viff

     [-P]           Prompts for command line options

     [-A [file1]]   Creates the answer file called rast2viff.ans
                    or file1

     [-a [file1]]   Uses rast2viff.ans or file1 as the answer
                    file

DESCRIPTION
     rast2viff :  rast2viff is a routine that converts a SUN ras-
     ter image into a VIFF image.

     This routine will convert SUN raster image of depth 1, 8 or
     24 into a VIFF image. This routine does not support SUN ras-
     ter images that have been encoded using run-length compres-
     sion. If the SUN raster image contains colormaps, those maps
     will be preserved in the VIFF image. The resulting VIFF
     image will be a BIT image if the SUN rater image had a depth
     of 1, or BYTE if the SUN raaster image had a depth of 8 or
     24. In the case that the depth of the SUN image is equal to
     24, then the VIFF image will contain 3 data bands (red,
     green and blue).

     If the SUN raster image is of type bit (depth = 1), then the
     -p option may be used to invert the image. If the image is
     not of type bit (depth = 1) then the -p option is ignored.

     The SUN raster image is defined as follows:

          A Sun raster image file is composed of three parts: a
          header containing 8 integers, a possibly empty set of
          colormap values, and the pixel image, stored a line at
          a time, in increasing y order.  The image is layed out
          in the file as in a memory pixrect.  Each line of the
          image is rounded up to the nearest 16 bits.

          The header is defined as follows:
                                  int  ras_magic;
                                  int  ras_width;
                                  int  ras_height;
                                  int  ras_depth;
                                  int  ras_length;
                                  int  ras_type;
                                  int  ras_maptype;
          The ras_magic field always contains the value
          0x59a66a95 (hex).
          The ras_width and ras_height are the width and height
          of the image given pixels.
          The ras_depth is the number of bits used per pixel (1,
          8, or 24).
          The ras_length is the number of bytes used to store the
          data of the image.
          The ras_type field is one of the following:
                  RT_OLD          0   -- Raw pixrect image in 68000 byte order
                  RT_STANDARD     1   -- Raw pixrect image in 68000 byte order

          For historical reasons, files of type RT_OLD will usu-
          ally have a 0 in the ras_length field and therefore the
          actual image length will need to be computed.

          The ras_maptype will be one of the following:
                  RMT_NONE        0   --ras_maplength is expected to be 0
                  RMT_EQUAL_RGB   1   --red[ras_maplength/3],green[],blue[]
                  RMT_RAW         2   --Sun's registered maptype

REQUIRED ARGUMENTS
     -i     type: infile
            desc: input Raster image file

     -o     type: outfile
            desc: resulting output image (viff file)

OPTIONAL ARGUMENTS
     -p     type: boolean
            desc: if yes, invert image (photonegative); if no
            (default) do not invert image (photopositive)
            default: false

EXAMPLES
     rast2viff -i raster.image -o viff.image

     raster.image is a sun raster image in in IEEE or Big Endian
     byte order (SUN's Byte Order), and viff.image is the result-
     ing khoros image.

SEE ALSO
     intro(1), verror(3), vgparms(3), vutils(3), lrast2viff(3)
     vconvert(1), vgamut(1)

RESTRICTIONS
     vrast2viff always assumes that the SUN raster image is in
     IEEE or Big Endian byte order (SUN's Byte Order).

COPYRIGHT
     Copyright 1991, University of New Mexico.  All rights
     reserved.

Khoros                    Release: 1.0                          1

