lvinsert(3)

LIBRARY ROUTINE
lvinsert - Insert a (sub)image into another image.

LIBRARY CALL
#include "vinclude.h"
int
lvinsert(img1,img2,xoff,yoff, real, imag)
struct  xvimage *img1,*img2;
int     xoff,yoff;
float   real, imag;

INPUT

img1
    input xvimage structure

img2
    input xvimage structure for subimage

xoff
    specifies the upper left X coordinate for the placement of the subimage.

yoff
    specifies the upper left Y coordinate for the placement of the subimage.

real
    specifies the real value for padding

imag
    specifies the imaginary value for padding with COMPLEX

OUTPUT

img1
    holds the result of the insert operation. The output data type is the same as the input data type.

MODIFICATIONS

DESCRIPTION
vinsert inserts a subimage into the input image to form the output image. The subimage is placed at the same coordinates is was extracted from unless the xoffset and yoffset of the upper left corner of the target location are specified.

If the subimage does not completely fit into the input image, then the input image will be padded to a larger size to encompass the subimage. The real variable specifies the padding value for the larger size image. In the event that images are of data storage type COMPLEX, the imag variable specifies the imaginary pad value.

For byte type images:

If the level value specified by user is greater than 255, the level value will be scaled down to 255. If the level specified by user is less than 0, the level value will by scaled up to 0.

There are no restrictions to the input image (img1) and the subimage (img2) size. It is possible to input a large image into a small image, thus the small image will no longer exist.

This routine will work on multiple band images. But both input images must contain the same number of data bands.

The input image and subimage must be of the same data storage type. The output image is the same data storage type as the input image.

img1
    is used for both the input xvimage structure and the output result xvimage structure. This is done to save space, but you must be careful not to overwrite important data. img2 should contain a smaller subimage.

xoff and yoff
    specify the location at which the subimage should be placed.

real
    specifies the padding value for real data, and in the case of COMPLEX data imag specifies the padding value for the imaginary part.

lvinsert returns a zero upon failure and a one upon success.

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

RESTRICTIONS

AUTHOR
John Rasure, Tom Sauer, Mark Young

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