lvadd(3)

LIBRARY ROUTINE
lvadd - Adds two images pixel by pixel with an operation gating mask.

LIBRARY CALL
#include "vinclude.h"
int
lvadd(img1,img2,img3,mflg)
struct xvimage *img1, *img2, *img3;
int   mflg;

INPUT

img1
    first xvimage structure

img2
    second xvimage structure

img3
    gating mask image

mflg
    a flag set (equal 1) if gating image mask available

    Note that all inputs must be of the same data type and size.

OUTPUT

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

Return Value:
    1 on success, 0 on failure.

MODIFICATIONS

Scott Wilson (April 29, 1988)

Marcelo Teran, John Rasure, Tom Sauer

Scott Wilson (December 28, 1989) - Upgrade to multiband.

Jeremy Worley (February 25, 1991) - Added double and double complex processing.

DESCRIPTION
vadd will add two images pixel by pixel. img1 and img2 are the input images; img3 is the gating image, and mflg should be set to 1 if the gating image is to be used. A non-zero mask pixel in img3 enables the output pixel to contain the sum. A zero mask pixel in img3 just transfers the value of the corresponding pixel in img1 to the output pixel.

The two input images must be of the same size, data type, and have the same number of data bands, as must the optional mask image. Note that img1 is used for both the input xvimage structure and the resulting output xvimage structure. This is done to save space, but you must be careful not to overwrite important data.

SEE ALSO
vadd(1), intro(3), vipl(3), verror(3), vutils(3) lvcast(3)

RESTRICTIONS
lvadd will not operate on VFF_TYP_BIT data storage types.

AUTHOR
Scott Wilson

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