
big2viff(1)                  Khoros                   big2viff(1)

PROGRAM
     big2viff - Converts a BIG file format to the VIFF image file
     format.

SYNTAX
     big2viff

     -i             input BIG data file

     -o             resulting output image (viff file)

     -c             lets user chose color space model:
                    0 (no model),
                    1 (choose ntscRGB model),
                    15 (choose genericRGB model),
                    7 (choose cieRGB model),
                    2 (choose ntscCMY model),
                    3 (choose ntscYIQ model),
                    4 (choose HSV model),
                    5 (choose HLS model),
                    6 (choose IHS model),
                    8 (choose cieXYZ model),
                    9 (choose cieUVW model),
                    10 (choose cieucsUVW model),
                    11 (choose cieucsSOW model),
                    12 (choose cieucsLab model),
                    or 14 (choose GENERIC model)

     [-V]           Gives the version for big2viff

     [-U]           Gives the usage for big2viff

     [-P]           Prompts for command line options

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

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

DESCRIPTION
     big2viff is a routine that converts a BIG image file format
     into a VIFF 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 for the BIG image file format is as fol-
     lows:

     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 following fields in the VIFF image header are set as
     follows:

     1.   data_storage_type = BYTE

     2.   data_encode_scheme = RAW

     3.   map_scheme = NONE

     4.   map_enable = OPTIONAL

     5.   location_type = NONE

     6.   pixsizx, pixsizy, startx, starty = 0

     7.   num_images = 1

     The remaining fields are obtained from the BIG image header.
     Note, since the BIG image file format pads all scan lines to
     multiples of 512 bytes per line, the VIFF image file could
     be much smaller.

     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
     convert 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 data file

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

     -c     type: integer
            desc: lets user chose color space model
            allowed values:
            0 (no model),
            1 (choose ntscRGB model),
            15 (choose genericRGB model),
            7 (choose cieRGB model),
            2 (choose ntscCMY model),
            3 (choose ntscYIQ model),
            4 (choose HSV model),
            5 (choose HLS model),
            6 (choose IHS model),
            8 (choose cieXYZ model),
            9 (choose cieUVW model),
            10 (choose cieucsUVW model),
            11 (choose cieucsSOW model),
            12 (choose cieucsLab model),
            or 14 (choose GENERIC model)

OPTIONAL ARGUMENTS
     none

EXAMPLES
     big2viff -i image.big -o image.viff -c 1

     This will convert an image in the BIG image file format to
     an image in VIFF image file format, and set the color space
     model to ntscRGB.

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

RESTRICTIONS
     big images are assumend to be in NS byte order (little
     endian).

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

Khoros                    Release: 1.0                          1

