ltiff2viff(3)

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

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

INPUT

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

    struct xvimage **viff - pointer to a pointer of a VIFF image file (malloced in this routine)

    int verbose - if set prints Tiff image header information

    char *filename - the name of the input file

OUTPUT

    struct xvimage **viff_image - malloced and copied imagedata for VIFF image

MODIFICATIONS

DESCRIPTION
Ltiff2viff converts a TIFF image to a Khoros VIFF image. The verbose flag specifies verbose mode. In verbose mode, information about the input TIFF image and output VIFF image is printed out.

Tiff2viff will convert TIFF images setting the TIFF header with the following information:

BitsPerSample
    If the TIFF image has 1 bit per sample the resulting VIFF image will be of type BIT. Otherwise the resulting image will be of type BYTE. Tiff2viff will not accept a TIFF image with the bits per sample greater than 8.

SamplesPerPixel
    Tiff2viff will convert TIFF images that contain either 1, 3 or 4 samples per pixel. If the samples per pixel is 1, then the resulting VIFF image will contain one data band. If the samples per pixel is 3 or 4, then the resulting VIFF image will contain 3 data bands. In the 3 data band case, the image is most likely a true RGB image (24 bits).

PhotometricInterpretation
    Tiff2viff will convert TIFF images with a photometric interpretation of Min Is Black, Min Is White, RGB, and Palette. In the case that the TIFF image is Min Is Black, the resulting VIFF image will be a single band grey scale image with the black pixel equal to 0. In the case that the TIFF image is Min Is White, the resulting VIFF image will be a single band grey scale image with the white pixel equal to 0 (this is an inverted image). If the TIFF image's photometric interpretation is set to RGB, the resulting VIFF image will contain 3 data bands, one for red, one for green and one for blue (true RGB). The color space model is set to generic_RGB. Finally, if the TIFF image's photometric interpretation is set to Palette, the resulting VIFF image will contain a 3 column by N color colormap. The color space model is set to generic RGB. Note, Tiff2viff does not support photometric interpretation of Mask and Depth.

PlanerConfiguration
    Tiff2viff supports a TIFF image that contains a contiguous planer configuration or a separate configuration. Planer Configuration is only important with the TIFF image is a true 24 or 32 bit RGB image. The TIFF contiguous planer configuration implies that the pixels are arranged as RGBRGBRGB..., where as a separate planer configuration implies that the pixels are for each color component (red, green and blue) are stored as planes of bands. Note, a VIFF image always stores an image with the color compenents in separate bands.

Compression
    The compression type supported are limited to the support provided by the public domain TIFF library utilities. The current compression types supported are: None, LZW, CCITTFAX3, CCITTRLEW and PACKBITS.

Tiff2viff uses the public domain TIFF library utilities. This routine 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
tiff2viff(1), intro(3), vipl(3), verror(3), vutils(3) viff2tiff(1), lviff2tiff(3), libtiff(3)

RESTRICTIONS
Ltiff2viff does not support TIFF images that contain more that 8 bit per sample. Also, the photometric interpretation of transparency mask and depth are not supported.

AUTHOR
Tom Sauer

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