
viff2big(1)                  Khoros                   viff2big(1)

PROGRAM
     viff2big - Converts  VIFF file format to BIG image file for-
     mat

SYNTAX
     viff2big

     -i             input BIG image data file

     -o             resulting output image (viff file)

     [-V]           Gives the version for viff2big

     [-U]           Gives the usage for viff2big

     [-P]           Prompts for command line options

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

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

DESCRIPTION
     viff2big is a routine that converts a VIFF image file format
     into a BIG image file format. The BIG image file format
     describes the image format used by Terra-Mar MicroImage.
     This format is based on record sizes of 512.

     Record 1 contains all the header information. The remaining
     records, beginning with record 2 store image data one scan-
     line at a time in (BIL) band-interleaved-by-line format for
     any number of bands. Since a scanline has a variable number
     of pixels depending on the original data, each scanline is
     divided into an appropriate number of records (512 pixels
     per record). If the number of pixels per scanline is not
     evenly divisible by 512, then the last record for each line
     will contain the remainder for that line; it will be only
     partially full. Note, records are padded to a length of 512.

     The Band-Interleaved-By-Line order means that the first
     scanline of the first band is stored first. It is followed
     by the first scanline of the second band, third band, fourth
     band, and so on up to the last band avaliable. This order
     then repeats for the second scanline, the third scanline and
     so on.

     The image header is assigned as follows:

     Bytes[1-22]     reserved1[22];           Reserved
     Bytes[23]       data_type;               'L' -> MSS data
                                              'T' -> TM data
                                              'S' -> SPOT data
     Bytes[24]       reserved2;               Reserved
     Bytes[25-26]    num_channels;            Number of Channels/Bands
     Bytes[27-28]    start_line_num;          Starting Line Number
     Bytes[29-30]    start_pixel_num;         Starting Pixel Number
     Bytes[31-32]    num_lines;               Number of Lines (row size)
     Bytes[33-34]    num_pixels_line;         Number of Pixels per Line
                                                  (column size)
     Bytes[35-36]    reserved3[2];            Reserved
     Bytes[37-38]    reserved4[2];            Reserved
     Bytes[39-119]   title[80];               Title of Image
     Bytes[120-121]  records_line;            Records_Per_Line (rounded up)
     Bytes[122-512]  reserved5[392];          Reserved

     The image type for the BIG image file format is set by the
     number of bands:

     1.   If the number of bands is less than or equal to 3 the
          image type is set to 'S' = SPOT.

     2.   If the number of data bands is greaterr than 3 the
          image type is set to 'L' = MSS.

     IMPORTANT

     The utilities used to read and write the BIG image file are
     machine dependent.  WE ASSUME THAT THE BIG IMAGE WILL ALWAYS
     BE IN LITENDIAN BYTE FORMAT, since the Terra-Mar Image pro-
     cessing system runs under DOS on a PC. This means that a
     machine that uses bigendian byt order (i.e. sun, sony, etc)
     must byte swap some fields in the image header. So, the code
     allows conversion between litendian byte order and bigendian
     byte order.

     The only file that has machine dependencies is big.c in the
     file format library (libfile_formats.a).

     1. The not define flag
               This routine can be compiled so that it is not
               machine dependent by using -DNMD option. NMD
               stands for not machine dependent.  When compiled
               with this option the bigendian to litendian
               conversion is not performed.

     2. defines for machine dependencies
               The defines for machine dependencies (conversion
               to and from bigendian) are sun, bigendian, and
               ieeeorder. So big.c can be compiled with -Dbigen-
               dian. Note, when compiling on a sun machine, sun
               is defined so the conversion code from bigendian
               to litendian will be be compiled. If it is
               unwanted see 1. above.

REQUIRED ARGUMENTS
     -i     type: infile
            desc: input BIG image data file

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

OPTIONAL ARGUMENTS
     none

EXAMPLES
           viff2big -i image.xv -o image.big

     The file image.xv is the input viff image, and the result is
     the image.big, the same image in big file format.

SEE ALSO
     intro(1), verror(3), vgparms(3), vutils(3), lviff2big(3)

RESTRICTIONS
     The input image must be of data storage type BYTE.  The out-
     put image will be stored in little endian byte ordering.

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

Khoros                    Release: 1.0                          1

