lvcast(3)

LIBRARY ROUTINE
lvcast - Upconvert all images to the highest input image data type.

LIBRARY CALL
#include "vinclude.h"
int
lvcast(images, image_num, up_type)
struct xvimage **images;
int  image_num, up_type;

INPUT

images
    array of pointers to xvimage structures

image_num
    integer indicating the number of input images

up_type
    optional target data type. Pass in "-1" to select auto upconvert.

OUTPUT

images
    array of pointers to resulting xvimage structures.

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

DESCRIPTION
vcast will upconvert or upcast each input image to the highest input image data type. Optionally, the user may elect to upcast all images to a specified data type, as long as it is a data type that is equal to or greater than the highest data type of the input images. If the user tries to select a data type that is lower than the highest data type of the input images, an error message will be produced indicating that down casting is not allowed.

There are no restrictions as to the input image data types. The data types can range from BIT to DOUBLE. The input images may contain any combination of sizes or number of data bands. All map information from each input image is transferred to the corresponding output image.

Note that when converting from type BIT to BYTE, the output values will be 0 or 1. This is different from the results one would obtain using the defaults with vconvert. In trying to preserve the integrity of the data, vcast scales the data by 1. This routine calls lvconvert to do the actual up convert/cast of the image data.

The inputs to lvcast include:

struct xvimage *images[]

    This is an array containing pointers to all of the images that are to be upcast. There is no limit on the number of images to convert.

int image_num

    This is the number of pointers to images. That is, the size of *images[].

int up_type

    This is the optional target data type. The target data type is specified by passing in the integer representing the desired VIFF data type. If auto upconvert is to be used, then passing in the value "-1" will default to finding the highest data type of the input images and upcasting the remaining images to this data type. lvcast will return a 1 upon success and a 0 upon failure.

SEE ALSO
vcast(1), intro(3), vipl(3), verror(3), vutils(3) lvconvert(3)

RESTRICTIONS

AUTHOR
Charlie Gage

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