lvlayer(3)

LIBRARY ROUTINE
lvlayer - Converts a multiband BIT image to a single band byte image.

LIBRARY CALL
#include "vinclude.h"
int
lvlayer(image, newimage, img_list)
struct xvimage  *image, **newimage;
int  *img_list;

INPUT

image
    the input xvimage structure to the multiband BIT image.

img_list
    a list of images for conversion to a BYTE image.

OUTPUT

newimage
    the resulting xvimage structure to the BYTE image.

MODIFICATIONS

DESCRIPTION
vlayer converts a multiband BIT image to a single band byte image.

The input BIT image should have a color map associated with each band, one map shared among all bands, or no map. Therefore the map scheme should be ONEPERBAND, SHARED, or NONE. Each input image color map has a map_row_size of 3 (corresponding to r g b), and a map_col_size of 2 (corresponding to 0 and 1), and is of type BYTE. The entries for 0 should be (r = 0, g = 0, b = 0), corresponding to black. The entries for 1 should correspond to the color attribute assigned to that band. A different color attribute is assigned to each band of the BINARY image, corresponding to some feature (ie. roads, etc.) for that layer.

The output image consists of a single band BYTE image with an associated color map. The output image is formed by replacing the band number (ie. 1, 2, 3, ...) at each location (ie. row and col) consisting of a 1 in the corresponding band of the input image. That is, for each BIT = 1 of a particular band of the input image, the corresponding band number (1, 2, 3,...) will be replaced in the output image.

The input image must be of data storage type BIT, and have a map sheme of ONEPERBAND, SHARED, or NONE. The resulting output image will be of data storage type BYTE, and have a map scheme of ONEPERBAND. The color space model and map enable of the input image will be passed along to the output image. The map of the output image will be adjusted in size to correspond to a map row size of the input image (ie. should be 3 - r g b), and a map col size equal to the number of bands in the input image plus one (this corresponds to a different color for each band including a color for 0). The color for 0 is set to be r = 0, g = 0, and b = 0 (ie. black).

SEE ALSO
vlayer(1), intro(3), vipl(3), verror(3), vutils(3)

RESTRICTIONS
Will only work on BIT images with a map scheme of ONEPERBAND, SHARED, or NONE.

AUTHOR
Charlie Gage

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