MMACH (lmmach) functions


LIBRARY ROUTINE

lvcast1 - Upconvert all images to the highest input image data type.

LIBRARY CALL

int
lvcast1(xvimage **images, int image_num, int up_type)

INPUT

none

OUTPUT

none

RETURN VALUE

TRUE (1) on success, FALSE (0) on failure

DESCRIPTION

vcast1 This is a modified version of Khoros' vcast. Scaling and Normalization are turned off, so that BIT to BYTE_1 conversion yields pixel values of 0 or 255 on the BYTE image. 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, vcast1 scales the data by 1. This routine calls lvconvert to do the actual up convert/cast of the image data.

The inputs to lvcast1 include:

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. lvcast1 will return a 1 upon success and a 0 upon failure.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

Adriano N. Rodrigues: turned off scaling and normalization, so that bit to byte conversion yields pixel values of 0 or 255.

FILES

$MMACH/objects/library/lmmach/src/lvcast1.c

SEE ALSO

lmmach(3)

COPYRIGHT

Copyright (C) 1993-1997 Junior Barrera, Roberto Lotufo. All rights reserved.