lviff2tiff(3)

LIBRARY ROUTINE
lviff2tiff - Convert a VIFF image to a TIFF image

LIBRARY CALL
#include "vinclude.h"
int lviff2tiff(tif, viff_image, verbose, compression, filename)
struct xvimage *viff_image;
TIFF *tif;
int verbose, compression;
char *filename;

INPUT

    TIFF *tif - pointer to the tif image structure (header returned by TIFFOpen opened for reading)

    struct xvimage *viff - pointer to a pointer of a VIFF image file.

    int verbose - if set prints image header information

    int compression - defines the compression type, valid inputs are COMPRESSION_NONE, COMPRESSION_LZW, COMPRESSION_CCITTFAX3, COMPRESSION_CCITTRLEW, COMPRESSION_PACKBITS

    char *filename - the name of the input file

OUTPUT

    TIFF *tif - pointer to the tif image structure containing the converted image

    lviff2tiff returns a 1 upon sucess and a 0 upon failure.

MODIFICATIONS

DESCRIPTION
Lviff2tiff converts a Khoros VIFF image to a TIFF image. TIFF stands for Tag Image File Format. The verbose flag specifies verbose mode. In verbose mode (verbose = 1), information about the input VIFF image and output TIFF image is printed out.

The viff2tiff converter is somewhat limited. Input VIFF images must be either 1 band or 3 band images. If the image is a 1 band image, it may contain a map with either 1 column or 3 columns. The resulting TIFF image will contain a 256 by 3 colormap (RGB). So, if a VIFF file has a 1 column map, that column is duplicated to form the 3 column TIFF image colormap. Also, the input VIFF image must be of data storage type BIT or BYTE.

The lviff2tiff routine supports a few different compression schemes. These are:
        COMPRESSION_NONE
        COMPRESSION_LZW
        CCOMPRESSION_CITTFAX3 - only works if the input VIFF image is of type BIT
        CCOMPRESSION_CITTRLEW
        COMPRESSION_ACKBITS - used for the Machintosh

The resulting TIFF image will have all fields set appropriatly based on the information from the VIFF image. The TIFF image is always written out with the pixels stored on separate "sample planes"

Lviff2tiff uses the public domain TIFF library utilities to write the resulting TIFF image. This routine (viff2tiff) is based on Release 2.2 of libtiff. The source for libtiff is as follows: The software is available for public ftp on
    ucbvax.berkeley.edu pub/tiff/tiff.tar.Z
        (128.132.130.12)
    uunet.uu.net graphics/tiff.tar.Z
        (192.48.96.2) Libtiff provides the mechanisms to read, write, uncompress and compress TIFF images.

Becasue the TIFF (Tag Image File Format) image specification is long and involved, please see the TIFF 5.0 specification. This specification can be obtained from:
        Developers' Desk
        Aldus Corp.
        411 First Ave. South
        Suite 200
        Seattle, WA 98104
        (206) 622-5500

SEE ALSO
viff2tiff(1), intro(3), vipl(3), verror(3), vutils(3) tiff2viff(1), ltiff2viff(3), tiff(n)

RESTRICTIONS
Lviff2tiff works only on VIFF images that have a data storage type of BIT or BYTE, and either 1 or 3 data bands. If the image has 1 data band and is byte, it is valid to have an either 1 column or 3 column map.

AUTHOR
Tom Sauer

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